001    /**
002     * Copyright (c) 2000-2011 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.Locale;
020    
021    import javax.portlet.PortletURL;
022    
023    /**
024     * @author Brian Wing Shun Chan
025     * @author Raymond Augé
026     * @author Ryan Park
027     */
028    public interface Indexer {
029    
030            public static final int DEFAULT_INTERVAL = 1000;
031    
032            public void delete(long companyId, String uid) throws SearchException;
033    
034            public void delete(Object obj) throws SearchException;
035    
036            public String[] getClassNames();
037    
038            public Document getDocument(Object obj) throws SearchException;
039    
040            public BooleanQuery getFacetQuery(
041                            String className, SearchContext searchContext)
042                    throws Exception;
043    
044            public BooleanQuery getFullQuery(SearchContext searchContext)
045                    throws SearchException;
046    
047            public IndexerPostProcessor[] getIndexerPostProcessors();
048    
049            public String getPortletId();
050    
051            public String getSearchEngineId();
052    
053            public String getSortField(String orderByCol);
054    
055            public Summary getSummary(
056                            Document document, Locale locale, String snippet,
057                            PortletURL portletURL)
058                    throws SearchException;
059    
060            public boolean hasPermission(
061                            PermissionChecker permissionChecker, long entryClassPK,
062                            String actionId)
063                    throws Exception;
064    
065            public boolean isFilterSearch();
066    
067            public boolean isStagingAware();
068    
069            public void postProcessContextQuery(
070                            BooleanQuery contextQuery, SearchContext searchContext)
071                    throws Exception;
072    
073            public void postProcessSearchQuery(
074                            BooleanQuery searchQuery, SearchContext searchContext)
075                    throws Exception;
076    
077            public void registerIndexerPostProcessor(
078                    IndexerPostProcessor indexerPostProcessor);
079    
080            public void reindex(Object obj) throws SearchException;
081    
082            public void reindex(String className, long classPK) throws SearchException;
083    
084            public void reindex(String[] ids) throws SearchException;
085    
086            public Hits search(SearchContext searchContext) throws SearchException;
087    
088            public void unregisterIndexerPostProcessor(
089                    IndexerPostProcessor indexerPostProcessor);
090    
091    }