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 java.util.Collection;
018    import java.util.Locale;
019    
020    /**
021     * @author Michael C. Han
022     */
023    public interface IndexWriterHelper {
024    
025            public void addDocument(
026                            String searchEngineId, long companyId, Document document,
027                            boolean commitImmediately)
028                    throws SearchException;
029    
030            public void addDocuments(
031                            String searchEngineId, long companyId,
032                            Collection<Document> documents, boolean commitImmediately)
033                    throws SearchException;
034    
035            public void commit(String searchEngineId) throws SearchException;
036    
037            public void commit(String searchEngineId, long companyId)
038                    throws SearchException;
039    
040            public void deleteDocument(
041                            String searchEngineId, long companyId, String uid,
042                            boolean commitImmediately)
043                    throws SearchException;
044    
045            public void deleteDocuments(
046                            String searchEngineId, long companyId, Collection<String> uids,
047                            boolean commitImmediately)
048                    throws SearchException;
049    
050            public void deleteEntityDocuments(
051                            String searchEngineId, long companyId, String className,
052                            boolean commitImmediately)
053                    throws SearchException;
054    
055            public void indexKeyword(
056                            long companyId, String querySuggestion, float weight,
057                            String keywordType, Locale locale)
058                    throws SearchException;
059    
060            public void indexKeyword(
061                            String searchEngineId, long companyId, String querySuggestion,
062                            float weight, String keywordType, Locale locale)
063                    throws SearchException;
064    
065            public void indexQuerySuggestionDictionaries(long companyId)
066                    throws SearchException;
067    
068            public void indexQuerySuggestionDictionaries(
069                            String searchEngineId, long companyId)
070                    throws SearchException;
071    
072            public void indexQuerySuggestionDictionary(long companyId, Locale locale)
073                    throws SearchException;
074    
075            public void indexQuerySuggestionDictionary(
076                            String searchEngineId, long companyId, Locale locale)
077                    throws SearchException;
078    
079            public void indexSpellCheckerDictionaries(long companyId)
080                    throws SearchException;
081    
082            public void indexSpellCheckerDictionaries(
083                            String searchEngineId, long companyId)
084                    throws SearchException;
085    
086            public void indexSpellCheckerDictionary(long companyId, Locale locale)
087                    throws SearchException;
088    
089            public void indexSpellCheckerDictionary(
090                            String searchEngineId, long companyId, Locale locale)
091                    throws SearchException;
092    
093            public boolean isIndexReadOnly();
094    
095            public void partiallyUpdateDocument(
096                            String searchEngineId, long companyId, Document document,
097                            boolean commitImmediately)
098                    throws SearchException;
099    
100            public void partiallyUpdateDocuments(
101                            String searchEngineId, long companyId,
102                            Collection<Document> documents, boolean commitImmediately)
103                    throws SearchException;
104    
105            public void setIndexReadOnly(boolean indexReadOnly);
106    
107            public void updateDocument(
108                            String searchEngineId, long companyId, Document document,
109                            boolean commitImmediately)
110                    throws SearchException;
111    
112            public void updateDocuments(
113                            String searchEngineId, long companyId,
114                            Collection<Document> documents, boolean commitImmediately)
115                    throws SearchException;
116    
117            public void updatePermissionFields(String name, String primKey);
118    
119    }