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(Object obj) throws SearchException;
033    
034            public String[] getClassNames();
035    
036            public Document getDocument(Object obj)    throws SearchException;
037    
038            public BooleanQuery getFacetQuery(
039                            String className, SearchContext searchContext)
040                    throws Exception;
041    
042            public IndexerPostProcessor[] getIndexerPostProcessors();
043    
044            public String getSearchEngineId();
045    
046            public String getSortField(String orderByCol);
047    
048            public Summary getSummary(
049                            Document document, Locale locale, String snippet,
050                            PortletURL portletURL)
051                    throws SearchException;
052    
053            public boolean hasPermission(
054                            PermissionChecker permissionChecker, long entryClassPK,
055                            String actionId)
056                    throws Exception;
057    
058            public boolean isFilterSearch();
059    
060            public boolean isStagingAware();
061    
062            public void postProcessContextQuery(
063                            BooleanQuery contextQuery, SearchContext searchContext)
064                    throws Exception;
065    
066            public void postProcessSearchQuery(
067                            BooleanQuery searchQuery, SearchContext searchContext)
068                    throws Exception;
069    
070            public void registerIndexerPostProcessor(
071                    IndexerPostProcessor indexerPostProcessor);
072    
073            public void reindex(Object obj) throws SearchException;
074    
075            public void reindex(String className, long classPK) throws SearchException;
076    
077            public void reindex(String[] ids) throws SearchException;
078    
079            public Hits search(SearchContext searchContext) throws SearchException;
080    
081            public void unregisterIndexerPostProcessor(
082                    IndexerPostProcessor indexerPostProcessor);
083    
084    }