public abstract class BaseIndexer<T> extends Object implements Indexer<T>
DEFAULT_INTERVAL
Constructor and Description |
---|
BaseIndexer() |
Modifier and Type | Method and Description |
---|---|
protected void |
addAssetFields(Document document,
String className,
long classPK)
Deprecated.
As of Judson (7.1.x), no direct replacement. Logic now
encapsulated in
document.AssetDocumentContrbutor |
protected void |
addDefaultHighlightFieldNames(QueryConfig queryConfig) |
protected void |
addDefaultSelectedFieldNames(SearchContext searchContext) |
protected void |
addFacetClause(SearchContext searchContext,
BooleanFilter facetBooleanFilter,
Collection<Facet> facets)
Deprecated.
As of Wilberforce (7.0.x)
|
protected void |
addFacetSelectedFieldNames(SearchContext searchContext,
QueryConfig queryConfig) |
protected void |
addLocalizedField(Document document,
String field,
Locale siteDefaultLocale,
Map<Locale,String> map) |
protected void |
addSearchAssetCategoryIds(BooleanFilter queryBooleanFilter,
SearchContext searchContext) |
protected void |
addSearchAssetCategoryTitles(Document document,
String field,
List<AssetCategory> assetCategories)
Deprecated.
As of Judson (7.1.x), no direct replacement. Logic not
encapsulated in
document.AssetCategoryDocumentContrbutor |
protected void |
addSearchAssetTagNames(BooleanFilter queryBooleanFilter,
SearchContext searchContext) |
protected Filter |
addSearchClassTypeIds(BooleanFilter contextBooleanFilter,
SearchContext searchContext) |
protected void |
addSearchEntryClassNames(BooleanFilter queryBooleanFilter,
SearchContext searchContext) |
protected Map<String,Query> |
addSearchExpando(BooleanQuery searchQuery,
SearchContext searchContext,
String keywords) |
protected void |
addSearchFolderId(BooleanFilter queryBooleanFilter,
SearchContext searchContext) |
protected void |
addSearchGroupId(BooleanFilter queryBooleanFilter,
SearchContext searchContext)
Deprecated.
As of Judson (7.1.x)
|
protected Map<String,Query> |
addSearchKeywords(BooleanQuery searchQuery,
SearchContext searchContext) |
protected void |
addSearchLayout(BooleanFilter queryBooleanFilter,
SearchContext searchContext) |
protected Map<String,Query> |
addSearchLocalizedTerm(BooleanQuery searchQuery,
SearchContext searchContext,
String field,
boolean like) |
protected Query |
addSearchTerm(BooleanQuery searchQuery,
SearchContext searchContext,
String field,
boolean like) |
protected void |
addSearchUserId(BooleanFilter queryBooleanFilter,
SearchContext searchContext) |
protected void |
addSelectedLocalizedFieldNames(Set<String> selectedFieldNames,
String... languageIds) |
protected void |
addStagingGroupKeyword(Document document,
long groupId) |
protected void |
addStatus(BooleanFilter contextBooleanFilter,
SearchContext searchContext) |
protected void |
addTrashFields(Document document,
TrashedModel trashedModel)
Deprecated.
As of Judson (7.1.x), with no direct replacement
|
protected BooleanQuery |
createFullQuery(BooleanFilter fullQueryBooleanFilter,
SearchContext searchContext) |
protected Summary |
createSummary(Document document) |
protected Summary |
createSummary(Document document,
String titleField,
String contentField) |
void |
delete(long companyId,
String uid) |
void |
delete(T object) |
protected void |
deleteDocument(long companyId,
long field1) |
protected void |
deleteDocument(long companyId,
long field1,
String field2) |
protected void |
deleteDocument(long companyId,
String field1) |
protected void |
deleteDocument(long companyId,
String field1,
String field2) |
protected abstract void |
doDelete(T object) |
protected abstract Document |
doGetDocument(T object) |
protected String |
doGetSortField(String orderByCol)
Deprecated.
As of Judson (7.1.x), replaced by
SortFieldTranslator |
protected abstract Summary |
doGetSummary(Document document,
Locale locale,
String snippet,
PortletRequest portletRequest,
PortletResponse portletResponse) |
protected void |
doPostProcessSearchQuery(Indexer<?> indexer,
BooleanQuery searchQuery,
SearchContext searchContext)
Deprecated.
As of Wilberforce (7.0.x), added strictly to support
backwards compatibility of
Indexer.postProcessSearchQuery(BooleanQuery, SearchContext) |
protected abstract void |
doReindex(String[] ids) |
protected abstract void |
doReindex(String className,
long classPK) |
protected abstract void |
doReindex(T object) |
protected Hits |
doSearch(SearchContext searchContext) |
boolean |
equals(Object object) |
protected Document |
getBaseModelDocument(String portletId,
BaseModel<?> baseModel) |
protected Document |
getBaseModelDocument(String portletId,
BaseModel<?> baseModel,
BaseModel<?> workflowedBaseModel) |
protected String |
getClassName(SearchContext searchContext) |
protected String[] |
getDefaultSelectedFieldNames() |
protected String[] |
getDefaultSelectedLocalizedFieldNames() |
Document |
getDocument(T object) |
protected List<DocumentContributor> |
getDocumentContributors() |
protected String |
getExpandoFieldName(SearchContext searchContext,
ExpandoBridge expandoBridge,
String attributeName) |
protected List<ExpandoQueryContributor> |
getExpandoQueryContributors() |
BooleanFilter |
getFacetBooleanFilter(String className,
SearchContext searchContext) |
BooleanQuery |
getFullQuery(SearchContext searchContext) |
IndexerPostProcessor[] |
getIndexerPostProcessors() |
protected Locale |
getLocale(PortletRequest portletRequest) |
protected Set<String> |
getLocalizedCountryNames(Country country) |
String[] |
getSearchClassNames() |
String |
getSearchEngineId() |
protected Group |
getSiteGroup(long groupId) |
protected long |
getSiteGroupId(long groupId) |
protected Locale |
getSnippetLocale(Document document,
Locale locale) |
String |
getSortField(String orderByCol)
Deprecated.
As of Judson (7.1.x), replaced by
#getSortField |
String |
getSortField(String orderByCol,
int sortType)
Deprecated.
As of Judson (7.1.x), replaced by
#getSortField |
Summary |
getSummary(Document document,
String snippet,
PortletRequest portletRequest,
PortletResponse portletResponse) |
int |
hashCode() |
boolean |
hasPermission(PermissionChecker permissionChecker,
String entryClassName,
long entryClassPK,
String actionId) |
boolean |
isCommitImmediately() |
boolean |
isFilterSearch()
Return
true if the indexer participates in post-search
result filtering. |
boolean |
isIndexerEnabled() |
boolean |
isPermissionAware()
Returns
true if the indexer adds permission related filters
to the search query prior to execution |
boolean |
isSelectAllLocales() |
boolean |
isStagingAware() |
protected boolean |
isStagingGroup(long groupId) |
protected boolean |
isUseSearchResultPermissionFilter(SearchContext searchContext) |
protected boolean |
isVisible(int entryStatus,
int queryStatus) |
boolean |
isVisible(long classPK,
int status) |
boolean |
isVisibleRelatedEntry(long classPK,
int status)
Deprecated.
As of Judson (7.1.x), replaced by
RelatedEntryIndexer.isVisibleRelatedEntry(long, int) |
protected Document |
newDocument() |
protected void |
populateAddresses(Document document,
List<Address> addresses,
long regionId,
long countryId) |
protected Map<Locale,String> |
populateMap(AssetEntry assetEntry,
Map<Locale,String> map) |
void |
postProcessContextBooleanFilter(BooleanFilter contextBooleanFilter,
SearchContext searchContext) |
void |
postProcessContextQuery(BooleanQuery contextQuery,
SearchContext searchContext)
Deprecated.
As of Wilberforce (7.0.x), replaced by
postProcessContextBooleanFilter(BooleanFilter,
SearchContext) |
protected void |
postProcessFullQuery(BooleanQuery fullQuery,
SearchContext searchContext) |
void |
postProcessSearchQuery(BooleanQuery searchQuery,
BooleanFilter fullQueryBooleanFilter,
SearchContext searchContext) |
void |
postProcessSearchQuery(BooleanQuery searchQuery,
SearchContext searchContext)
Deprecated.
As of Wilberforce (7.0.x), replaced by
postProcessSearchQuery(BooleanQuery, BooleanFilter,
SearchContext) |
protected void |
processHits(SearchContext searchContext,
Hits hits) |
void |
registerIndexerPostProcessor(IndexerPostProcessor indexerPostProcessor) |
void |
reindex(Collection<T> collection) |
void |
reindex(String[] ids) |
void |
reindex(String className,
long classPK) |
void |
reindex(T object) |
protected void |
resetFullQuery(SearchContext searchContext) |
Hits |
search(SearchContext searchContext) |
Hits |
search(SearchContext searchContext,
String... selectedFieldNames) |
long |
searchCount(SearchContext searchContext) |
void |
setCommitImmediately(boolean commitImmediately) |
protected void |
setDefaultSelectedFieldNames(String... defaultLocalizedFieldNames) |
protected void |
setDefaultSelectedLocalizedFieldNames(String... defaultLocalizedFieldNames) |
protected void |
setFilterSearch(boolean filterSearch) |
void |
setIndexerEnabled(boolean indexerEnabled) |
protected void |
setPermissionAware(boolean permissionAware) |
void |
setSelectAllLocales(boolean selectAllLocales) |
protected void |
setStagingAware(boolean stagingAware) |
void |
unregisterIndexerPostProcessor(IndexerPostProcessor indexerPostProcessor) |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getClassName
public void delete(long companyId, String uid) throws SearchException
delete
in interface Indexer<T>
SearchException
public void delete(T object) throws SearchException
delete
in interface Indexer<T>
SearchException
public boolean equals(Object object)
equals
in class Object
public Document getDocument(T object) throws SearchException
getDocument
in interface Indexer<T>
SearchException
public BooleanFilter getFacetBooleanFilter(String className, SearchContext searchContext) throws Exception
getFacetBooleanFilter
in interface Indexer<T>
Exception
public BooleanQuery getFullQuery(SearchContext searchContext) throws SearchException
getFullQuery
in interface Indexer<T>
SearchException
public IndexerPostProcessor[] getIndexerPostProcessors()
getIndexerPostProcessors
in interface Indexer<T>
public String[] getSearchClassNames()
getSearchClassNames
in interface Indexer<T>
public String getSearchEngineId()
getSearchEngineId
in interface Indexer<T>
@Deprecated public String getSortField(String orderByCol)
#getSortField
getSortField
in interface Indexer<T>
@Deprecated public String getSortField(String orderByCol, int sortType)
#getSortField
getSortField
in interface Indexer<T>
public Summary getSummary(Document document, String snippet, PortletRequest portletRequest, PortletResponse portletResponse) throws SearchException
getSummary
in interface Indexer<T>
SearchException
public int hashCode()
hashCode
in class Object
public boolean hasPermission(PermissionChecker permissionChecker, String entryClassName, long entryClassPK, String actionId) throws Exception
hasPermission
in interface Indexer<T>
Exception
public boolean isCommitImmediately()
isCommitImmediately
in interface Indexer<T>
public boolean isFilterSearch()
Indexer
true
if the indexer participates in post-search
result filtering.isFilterSearch
in interface Indexer<T>
true
if the indexer participates in post-search
result filtering; false
otherwiseSearchResultPermissionFilter
public boolean isIndexerEnabled()
isIndexerEnabled
in interface Indexer<T>
public boolean isPermissionAware()
Indexer
true
if the indexer adds permission related filters
to the search query prior to executionisPermissionAware
in interface Indexer<T>
true
if the indexer adds permission related filters
to the search query prior to execution; false
otherwiseSearchPermissionChecker
public boolean isSelectAllLocales()
public boolean isStagingAware()
isStagingAware
in interface Indexer<T>
public boolean isVisible(long classPK, int status) throws Exception
@Deprecated public boolean isVisibleRelatedEntry(long classPK, int status) throws Exception
RelatedEntryIndexer.isVisibleRelatedEntry(long, int)
isVisibleRelatedEntry
in interface Indexer<T>
classPK
- status
- Exception
public void postProcessContextBooleanFilter(BooleanFilter contextBooleanFilter, SearchContext searchContext) throws Exception
postProcessContextBooleanFilter
in interface Indexer<T>
Exception
@Deprecated public void postProcessContextQuery(BooleanQuery contextQuery, SearchContext searchContext) throws Exception
postProcessContextBooleanFilter(BooleanFilter,
SearchContext)
postProcessContextQuery
in interface Indexer<T>
Exception
public void postProcessSearchQuery(BooleanQuery searchQuery, BooleanFilter fullQueryBooleanFilter, SearchContext searchContext) throws Exception
postProcessSearchQuery
in interface Indexer<T>
Exception
@Deprecated public void postProcessSearchQuery(BooleanQuery searchQuery, SearchContext searchContext) throws Exception
postProcessSearchQuery(BooleanQuery, BooleanFilter,
SearchContext)
postProcessSearchQuery
in interface Indexer<T>
Exception
public void registerIndexerPostProcessor(IndexerPostProcessor indexerPostProcessor)
registerIndexerPostProcessor
in interface Indexer<T>
public void reindex(String className, long classPK) throws SearchException
reindex
in interface Indexer<T>
SearchException
public void reindex(String[] ids) throws SearchException
reindex
in interface Indexer<T>
SearchException
public void reindex(T object) throws SearchException
reindex
in interface Indexer<T>
SearchException
public Hits search(SearchContext searchContext) throws SearchException
search
in interface Indexer<T>
SearchException
public Hits search(SearchContext searchContext, String... selectedFieldNames) throws SearchException
search
in interface Indexer<T>
SearchException
public long searchCount(SearchContext searchContext) throws SearchException
searchCount
in interface Indexer<T>
SearchException
public void setCommitImmediately(boolean commitImmediately)
public void setIndexerEnabled(boolean indexerEnabled)
setIndexerEnabled
in interface Indexer<T>
public void setSelectAllLocales(boolean selectAllLocales)
public void unregisterIndexerPostProcessor(IndexerPostProcessor indexerPostProcessor)
unregisterIndexerPostProcessor
in interface Indexer<T>
@Deprecated protected void addAssetFields(Document document, String className, long classPK)
document.AssetDocumentContrbutor
document
- className
- classPK
- protected void addDefaultHighlightFieldNames(QueryConfig queryConfig)
protected void addDefaultSelectedFieldNames(SearchContext searchContext)
@Deprecated protected void addFacetClause(SearchContext searchContext, BooleanFilter facetBooleanFilter, Collection<Facet> facets) throws ParseException
ParseException
protected void addFacetSelectedFieldNames(SearchContext searchContext, QueryConfig queryConfig)
protected void addLocalizedField(Document document, String field, Locale siteDefaultLocale, Map<Locale,String> map)
protected void addSearchAssetCategoryIds(BooleanFilter queryBooleanFilter, SearchContext searchContext) throws Exception
Exception
@Deprecated protected void addSearchAssetCategoryTitles(Document document, String field, List<AssetCategory> assetCategories)
document.AssetCategoryDocumentContrbutor
document
- field
- assetCategories
- protected void addSearchAssetTagNames(BooleanFilter queryBooleanFilter, SearchContext searchContext) throws Exception
Exception
protected Filter addSearchClassTypeIds(BooleanFilter contextBooleanFilter, SearchContext searchContext) throws Exception
Exception
protected void addSearchEntryClassNames(BooleanFilter queryBooleanFilter, SearchContext searchContext) throws Exception
Exception
protected Map<String,Query> addSearchExpando(BooleanQuery searchQuery, SearchContext searchContext, String keywords) throws Exception
Exception
protected void addSearchFolderId(BooleanFilter queryBooleanFilter, SearchContext searchContext) throws Exception
Exception
@Deprecated protected void addSearchGroupId(BooleanFilter queryBooleanFilter, SearchContext searchContext) throws Exception
Exception
protected Map<String,Query> addSearchKeywords(BooleanQuery searchQuery, SearchContext searchContext) throws Exception
Exception
protected void addSearchLayout(BooleanFilter queryBooleanFilter, SearchContext searchContext) throws Exception
Exception
protected Map<String,Query> addSearchLocalizedTerm(BooleanQuery searchQuery, SearchContext searchContext, String field, boolean like) throws Exception
Exception
protected Query addSearchTerm(BooleanQuery searchQuery, SearchContext searchContext, String field, boolean like) throws Exception
Exception
protected void addSearchUserId(BooleanFilter queryBooleanFilter, SearchContext searchContext) throws Exception
Exception
protected void addSelectedLocalizedFieldNames(Set<String> selectedFieldNames, String... languageIds)
protected void addStagingGroupKeyword(Document document, long groupId)
protected void addStatus(BooleanFilter contextBooleanFilter, SearchContext searchContext) throws Exception
Exception
@Deprecated protected void addTrashFields(Document document, TrashedModel trashedModel)
protected BooleanQuery createFullQuery(BooleanFilter fullQueryBooleanFilter, SearchContext searchContext) throws Exception
Exception
protected Summary createSummary(Document document, String titleField, String contentField)
protected void deleteDocument(long companyId, long field1) throws Exception
Exception
protected void deleteDocument(long companyId, long field1, String field2) throws Exception
Exception
protected void deleteDocument(long companyId, String field1) throws Exception
Exception
protected void deleteDocument(long companyId, String field1, String field2) throws Exception
Exception
protected abstract void doDelete(T object) throws Exception
Exception
protected abstract Document doGetDocument(T object) throws Exception
Exception
@Deprecated protected String doGetSortField(String orderByCol)
SortFieldTranslator
protected abstract Summary doGetSummary(Document document, Locale locale, String snippet, PortletRequest portletRequest, PortletResponse portletResponse) throws Exception
Exception
@Deprecated protected void doPostProcessSearchQuery(Indexer<?> indexer, BooleanQuery searchQuery, SearchContext searchContext) throws Exception
Indexer.postProcessSearchQuery(BooleanQuery, SearchContext)
Exception
protected abstract void doReindex(String className, long classPK) throws Exception
Exception
protected abstract void doReindex(String[] ids) throws Exception
Exception
protected abstract void doReindex(T object) throws Exception
Exception
protected Hits doSearch(SearchContext searchContext) throws SearchException
SearchException
protected Document getBaseModelDocument(String portletId, BaseModel<?> baseModel)
protected Document getBaseModelDocument(String portletId, BaseModel<?> baseModel, BaseModel<?> workflowedBaseModel)
protected String getClassName(SearchContext searchContext)
protected String[] getDefaultSelectedFieldNames()
protected String[] getDefaultSelectedLocalizedFieldNames()
protected List<DocumentContributor> getDocumentContributors()
protected String getExpandoFieldName(SearchContext searchContext, ExpandoBridge expandoBridge, String attributeName)
protected List<ExpandoQueryContributor> getExpandoQueryContributors()
protected Locale getLocale(PortletRequest portletRequest)
protected Set<String> getLocalizedCountryNames(Country country)
protected Group getSiteGroup(long groupId)
protected long getSiteGroupId(long groupId)
protected Locale getSnippetLocale(Document document, Locale locale)
protected boolean isStagingGroup(long groupId)
protected boolean isUseSearchResultPermissionFilter(SearchContext searchContext)
protected boolean isVisible(int entryStatus, int queryStatus)
protected Document newDocument()
protected void populateAddresses(Document document, List<Address> addresses, long regionId, long countryId) throws PortalException
PortalException
protected Map<Locale,String> populateMap(AssetEntry assetEntry, Map<Locale,String> map)
protected void postProcessFullQuery(BooleanQuery fullQuery, SearchContext searchContext) throws Exception
Exception
protected void processHits(SearchContext searchContext, Hits hits) throws SearchException
SearchException
protected void resetFullQuery(SearchContext searchContext)
protected void setDefaultSelectedFieldNames(String... defaultLocalizedFieldNames)
protected void setDefaultSelectedLocalizedFieldNames(String... defaultLocalizedFieldNames)
protected void setFilterSearch(boolean filterSearch)
protected void setPermissionAware(boolean permissionAware)
protected void setStagingAware(boolean stagingAware)