001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.search;
016    
017    import com.liferay.portal.kernel.backgroundtask.BackgroundTask;
018    
019    import java.io.Serializable;
020    
021    import java.util.Collection;
022    import java.util.Locale;
023    import java.util.Map;
024    
025    /**
026     * @author Michael C. Han
027     */
028    public interface IndexWriterHelper {
029    
030            public void addDocument(
031                            String searchEngineId, long companyId, Document document,
032                            boolean commitImmediately)
033                    throws SearchException;
034    
035            public void addDocuments(
036                            String searchEngineId, long companyId,
037                            Collection<Document> documents, boolean commitImmediately)
038                    throws SearchException;
039    
040            public void commit(String searchEngineId) throws SearchException;
041    
042            public void commit(String searchEngineId, long companyId)
043                    throws SearchException;
044    
045            public void deleteDocument(
046                            String searchEngineId, long companyId, String uid,
047                            boolean commitImmediately)
048                    throws SearchException;
049    
050            public void deleteDocuments(
051                            String searchEngineId, long companyId, Collection<String> uids,
052                            boolean commitImmediately)
053                    throws SearchException;
054    
055            public void deleteEntityDocuments(
056                            String searchEngineId, long companyId, String className,
057                            boolean commitImmediately)
058                    throws SearchException;
059    
060            public int getReindexTaskCount(long groupId, boolean completed)
061                    throws SearchException;
062    
063            public void indexKeyword(
064                            long companyId, String querySuggestion, float weight,
065                            String keywordType, Locale locale)
066                    throws SearchException;
067    
068            public void indexKeyword(
069                            String searchEngineId, long companyId, String querySuggestion,
070                            float weight, String keywordType, Locale locale)
071                    throws SearchException;
072    
073            public void indexQuerySuggestionDictionaries(long companyId)
074                    throws SearchException;
075    
076            public void indexQuerySuggestionDictionaries(
077                            String searchEngineId, long companyId)
078                    throws SearchException;
079    
080            public void indexQuerySuggestionDictionary(long companyId, Locale locale)
081                    throws SearchException;
082    
083            public void indexQuerySuggestionDictionary(
084                            String searchEngineId, long companyId, Locale locale)
085                    throws SearchException;
086    
087            public void indexSpellCheckerDictionaries(long companyId)
088                    throws SearchException;
089    
090            public void indexSpellCheckerDictionaries(
091                            String searchEngineId, long companyId)
092                    throws SearchException;
093    
094            public void indexSpellCheckerDictionary(long companyId, Locale locale)
095                    throws SearchException;
096    
097            public void indexSpellCheckerDictionary(
098                            String searchEngineId, long companyId, Locale locale)
099                    throws SearchException;
100    
101            public boolean isIndexReadOnly();
102    
103            public void partiallyUpdateDocument(
104                            String searchEngineId, long companyId, Document document,
105                            boolean commitImmediately)
106                    throws SearchException;
107    
108            public void partiallyUpdateDocuments(
109                            String searchEngineId, long companyId,
110                            Collection<Document> documents, boolean commitImmediately)
111                    throws SearchException;
112    
113            public BackgroundTask reindex(
114                            long userId, String jobName, long[] companyIds,
115                            Map<String, Serializable> taskContextMap)
116                    throws SearchException;
117    
118            public BackgroundTask reindex(
119                            long userId, String jobName, long[] companyIds, String className,
120                            Map<String, Serializable> taskContextMap)
121                    throws SearchException;
122    
123            public void setIndexReadOnly(boolean indexReadOnly);
124    
125            public void updateDocument(
126                            String searchEngineId, long companyId, Document document,
127                            boolean commitImmediately)
128                    throws SearchException;
129    
130            public void updateDocuments(
131                            String searchEngineId, long companyId,
132                            Collection<Document> documents, boolean commitImmediately)
133                    throws SearchException;
134    
135            public void updatePermissionFields(String name, String primKey);
136    
137    }