001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.kernel.search;
016    
017    import com.liferay.portal.security.permission.PermissionChecker;
018    
019    import java.util.List;
020    import java.util.Locale;
021    
022    import javax.portlet.PortletURL;
023    
024    /**
025     * @author Brian Wing Shun Chan
026     * @author Raymond Aug??
027     * @author Ryan Park
028     */
029    public interface Indexer {
030    
031            public static final int DEFAULT_INTERVAL = 10000;
032    
033            public void addRelatedEntryFields(Document document, Object obj)
034                    throws Exception;
035    
036            public void delete(long companyId, String uid) throws SearchException;
037    
038            public void delete(Object obj) throws SearchException;
039    
040            public String[] getClassNames();
041    
042            public Document getDocument(Object obj) throws SearchException;
043    
044            public BooleanQuery getFacetQuery(
045                            String className, SearchContext searchContext)
046                    throws Exception;
047    
048            public BooleanQuery getFullQuery(SearchContext searchContext)
049                    throws SearchException;
050    
051            public IndexerPostProcessor[] getIndexerPostProcessors();
052    
053            public String getPortletId();
054    
055            public String getSearchEngineId();
056    
057            public String getSortField(String orderByCol);
058    
059            public String getSortField(String orderByCol, int sortType);
060    
061            public Summary getSummary(
062                            Document document, Locale locale, String snippet,
063                            PortletURL portletURL)
064                    throws SearchException;
065    
066            public boolean hasPermission(
067                            PermissionChecker permissionChecker, String entryClassName,
068                            long entryClassPK, String actionId)
069                    throws Exception;
070    
071            public boolean isFilterSearch();
072    
073            public boolean isPermissionAware();
074    
075            public boolean isStagingAware();
076    
077            public void postProcessContextQuery(
078                            BooleanQuery contextQuery, SearchContext searchContext)
079                    throws Exception;
080    
081            public void postProcessSearchQuery(
082                            BooleanQuery searchQuery, SearchContext searchContext)
083                    throws Exception;
084    
085            public void registerIndexerPostProcessor(
086                    IndexerPostProcessor indexerPostProcessor);
087    
088            public void reindex(Object obj) throws SearchException;
089    
090            public void reindex(String className, long classPK) throws SearchException;
091    
092            public void reindex(String[] ids) throws SearchException;
093    
094            public void reindexDDMStructures(List<Long> ddmStructureIds)
095                    throws SearchException;
096    
097            public Hits search(SearchContext searchContext) throws SearchException;
098    
099            public void unregisterIndexerPostProcessor(
100                    IndexerPostProcessor indexerPostProcessor);
101    
102    }