001
014
015 package com.liferay.portal.kernel.search;
016
017 import com.liferay.portal.kernel.search.filter.BooleanFilter;
018 import com.liferay.portal.security.permission.PermissionChecker;
019
020 import java.util.Collection;
021 import java.util.Locale;
022
023 import javax.portlet.PortletRequest;
024 import javax.portlet.PortletResponse;
025
026
031 public interface Indexer<T> {
032
033 public static final int DEFAULT_INTERVAL = 10000;
034
035 public void delete(long companyId, String uid) throws SearchException;
036
037 @Bufferable
038 public void delete(T object) throws SearchException;
039
040 public String getClassName();
041
042
045 @Deprecated
046 public String[] getClassNames();
047
048 public Document getDocument(T object) throws SearchException;
049
050 public BooleanFilter getFacetBooleanFilter(
051 String className, SearchContext searchContext)
052 throws Exception;
053
054 public BooleanQuery getFullQuery(SearchContext searchContext)
055 throws SearchException;
056
057 public IndexerPostProcessor[] getIndexerPostProcessors();
058
059
062 @Deprecated
063 public String getPortletId();
064
065 public String[] getSearchClassNames();
066
067 public String getSearchEngineId();
068
069 public String getSortField(String orderByCol);
070
071 public String getSortField(String orderByCol, int sortType);
072
073
077 @Deprecated
078 public Summary getSummary(Document document, Locale locale, String snippet)
079 throws SearchException;
080
081 public Summary getSummary(
082 Document document, String snippet, PortletRequest portletRequest,
083 PortletResponse portletResponse)
084 throws SearchException;
085
086 public boolean hasPermission(
087 PermissionChecker permissionChecker, String entryClassName,
088 long entryClassPK, String actionId)
089 throws Exception;
090
091 public boolean isCommitImmediately();
092
093 public boolean isFilterSearch();
094
095 public boolean isIndexerEnabled();
096
097 public boolean isPermissionAware();
098
099 public boolean isStagingAware();
100
101 public boolean isVisible(long classPK, int status) throws Exception;
102
103 public boolean isVisibleRelatedEntry(long classPK, int status)
104 throws Exception;
105
106 public void postProcessContextBooleanFilter(
107 BooleanFilter contextBooleanFilter, SearchContext searchContext)
108 throws Exception;
109
110
115 @Deprecated
116 public void postProcessContextQuery(
117 BooleanQuery contextQuery, SearchContext searchContext)
118 throws Exception;
119
120 public void postProcessSearchQuery(
121 BooleanQuery searchQuery, BooleanFilter fullQueryBooleanFilter,
122 SearchContext searchContext)
123 throws Exception;
124
125
130 @Deprecated
131 public void postProcessSearchQuery(
132 BooleanQuery searchQuery, SearchContext searchContext)
133 throws Exception;
134
135 public void registerIndexerPostProcessor(
136 IndexerPostProcessor indexerPostProcessor);
137
138 @Bufferable
139 public void reindex(Collection<T> objects) throws SearchException;
140
141 @Bufferable
142 public void reindex(String className, long classPK) throws SearchException;
143
144 public void reindex(String[] ids) throws SearchException;
145
146 @Bufferable
147 public void reindex(T object) throws SearchException;
148
149 public Hits search(SearchContext searchContext) throws SearchException;
150
151 public Hits search(
152 SearchContext searchContext, String... selectedFieldNames)
153 throws SearchException;
154
155 public long searchCount(SearchContext searchContext) throws SearchException;
156
157 public void setIndexerEnabled(boolean indexerEnabled);
158
159 public void unregisterIndexerPostProcessor(
160 IndexerPostProcessor indexerPostProcessor);
161
162 }