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
101 public boolean isFilterSearch();
102
103 public boolean isIndexerEnabled();
104
105
114 public boolean isPermissionAware();
115
116 public boolean isStagingAware();
117
118 public boolean isVisible(long classPK, int status) throws Exception;
119
120 public boolean isVisibleRelatedEntry(long classPK, int status)
121 throws Exception;
122
123 public void postProcessContextBooleanFilter(
124 BooleanFilter contextBooleanFilter, SearchContext searchContext)
125 throws Exception;
126
127
132 @Deprecated
133 public void postProcessContextQuery(
134 BooleanQuery contextQuery, SearchContext searchContext)
135 throws Exception;
136
137 public void postProcessSearchQuery(
138 BooleanQuery searchQuery, BooleanFilter fullQueryBooleanFilter,
139 SearchContext searchContext)
140 throws Exception;
141
142
147 @Deprecated
148 public void postProcessSearchQuery(
149 BooleanQuery searchQuery, SearchContext searchContext)
150 throws Exception;
151
152 public void registerIndexerPostProcessor(
153 IndexerPostProcessor indexerPostProcessor);
154
155 @Bufferable
156 public void reindex(Collection<T> objects) throws SearchException;
157
158 @Bufferable
159 public void reindex(String className, long classPK) throws SearchException;
160
161 public void reindex(String[] ids) throws SearchException;
162
163 @Bufferable
164 public void reindex(T object) throws SearchException;
165
166 public Hits search(SearchContext searchContext) throws SearchException;
167
168 public Hits search(
169 SearchContext searchContext, String... selectedFieldNames)
170 throws SearchException;
171
172 public long searchCount(SearchContext searchContext) throws SearchException;
173
174 public void setIndexerEnabled(boolean indexerEnabled);
175
176 public void unregisterIndexerPostProcessor(
177 IndexerPostProcessor indexerPostProcessor);
178
179 }