Package com.liferay.portal.kernel.search
Class BaseIndexer<T>
Object
com.liferay.portal.kernel.search.BaseIndexer<T>
- All Implemented Interfaces:
Indexer<T>
- Direct Known Subclasses:
BaseSearcher
- Author:
- Brian Wing Shun Chan, Hugo Huijser, Ryan Park, Raymond Augé
-
Field Summary
Fields inherited from interface com.liferay.portal.kernel.search.Indexer
DEFAULT_INTERVAL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddDefaultHighlightFieldNames(QueryConfig queryConfig) protected voidaddDefaultSelectedFieldNames(SearchContext searchContext) protected voidaddFacetClause(SearchContext searchContext, BooleanFilter facetBooleanFilter, Collection<Facet> facets) Deprecated.As of Wilberforce (7.0.x)protected voidaddFacetSelectedFieldNames(SearchContext searchContext, QueryConfig queryConfig) protected voidaddLocalizedField(Document document, String field, Locale siteDefaultLocale, Map<Locale, String> map) protected voidaddSearchAssetCategoryIds(BooleanFilter queryBooleanFilter, SearchContext searchContext) protected voidaddSearchAssetTagNames(BooleanFilter queryBooleanFilter, SearchContext searchContext) protected FilteraddSearchClassTypeIds(BooleanFilter contextBooleanFilter, SearchContext searchContext) protected voidaddSearchEntryClassNames(BooleanFilter queryBooleanFilter, SearchContext searchContext) addSearchExpando(BooleanQuery searchQuery, SearchContext searchContext, String keywords) protected voidaddSearchFolderId(BooleanFilter queryBooleanFilter, SearchContext searchContext) addSearchKeywords(BooleanQuery searchQuery, SearchContext searchContext) protected voidaddSearchLayout(BooleanFilter queryBooleanFilter, SearchContext searchContext) addSearchLocalizedTerm(BooleanQuery searchQuery, SearchContext searchContext, String field, boolean like) protected QueryaddSearchTerm(BooleanQuery searchQuery, SearchContext searchContext, String field, boolean like) protected voidaddSearchUserId(BooleanFilter queryBooleanFilter, SearchContext searchContext) protected voidaddSelectedLocalizedFieldNames(Set<String> selectedFieldNames, String... languageIds) protected voidaddStagingGroupKeyword(Document document, long groupId) protected voidaddStatus(BooleanFilter contextBooleanFilter, SearchContext searchContext) protected BooleanQuerycreateFullQuery(BooleanFilter fullQueryBooleanFilter, SearchContext searchContext) protected SummarycreateSummary(Document document) protected SummarycreateSummary(Document document, String titleField, String contentField) voidvoidprotected voiddeleteDocument(long companyId, long field1) protected voiddeleteDocument(long companyId, long field1, String field2) protected voiddeleteDocument(long companyId, String field1) protected voiddeleteDocument(long companyId, String field1, String field2) protected abstract voidprotected abstract DocumentdoGetDocument(T object) protected StringdoGetSortField(String orderByCol) Deprecated.As of Judson (7.1.x), replaced bycom.liferay.portal.search.contributor.sort.SortFieldTranslatorprotected abstract SummarydoGetSummary(Document document, Locale locale, String snippet, PortletRequest portletRequest, PortletResponse portletResponse) protected voiddoPostProcessSearchQuery(Indexer<?> indexer, BooleanQuery searchQuery, SearchContext searchContext) Deprecated.As of Wilberforce (7.0.x), added strictly to support backwards compatibility ofIndexer.postProcessSearchQuery(BooleanQuery, SearchContext)protected abstract voidprotected abstract voidprotected abstract voidprotected HitsdoSearch(SearchContext searchContext) booleanprotected DocumentgetBaseModelDocument(String portletId, BaseModel<?> baseModel) protected DocumentgetBaseModelDocument(String portletId, BaseModel<?> baseModel, BaseModel<?> workflowedBaseModel) protected StringgetClassName(SearchContext searchContext) protected String[]protected String[]getDocument(T object) protected StringgetExpandoFieldName(SearchContext searchContext, ExpandoBridge expandoBridge, String attributeName) protected List<ExpandoQueryContributor>getFacetBooleanFilter(String className, SearchContext searchContext) getFullQuery(SearchContext searchContext) protected LocalegetLocale(PortletRequest portletRequest) getLocalizedCountryNames(Country country) String[]protected GroupgetSiteGroup(long groupId) protected longgetSiteGroupId(long groupId) protected LocalegetSnippetLocale(Document document, Locale locale) getSortField(String orderByCol) Deprecated.As of Judson (7.1.x), replaced by#getSortFieldgetSummary(Document document, String snippet, PortletRequest portletRequest, PortletResponse portletResponse) inthashCode()booleanhasPermission(PermissionChecker permissionChecker, String entryClassName, long entryClassPK, String actionId) booleanbooleanReturntrueif the indexer participates in post-search result filtering.booleanbooleanReturnstrueif the indexer adds permission related filters to the search query prior to executionbooleanbooleanprotected booleanisStagingGroup(long groupId) protected booleanisUseSearchResultPermissionFilter(SearchContext searchContext) protected booleanisVisible(int entryStatus, int queryStatus) booleanisVisible(long classPK, int status) protected Documentprotected voidpopulateAddresses(Document document, List<Address> addresses, long regionId, long countryId) populateMap(AssetEntry assetEntry, Map<Locale, String> map) voidpostProcessContextBooleanFilter(BooleanFilter contextBooleanFilter, SearchContext searchContext) voidpostProcessContextQuery(BooleanQuery contextQuery, SearchContext searchContext) Deprecated.As of Wilberforce (7.0.x), replaced bypostProcessContextBooleanFilter(BooleanFilter, SearchContext)protected voidpostProcessFullQuery(BooleanQuery fullQuery, SearchContext searchContext) voidpostProcessSearchQuery(BooleanQuery searchQuery, BooleanFilter fullQueryBooleanFilter, SearchContext searchContext) voidpostProcessSearchQuery(BooleanQuery searchQuery, SearchContext searchContext) Deprecated.As of Wilberforce (7.0.x), replaced bypostProcessSearchQuery(BooleanQuery, BooleanFilter, SearchContext)protected voidprocessHits(SearchContext searchContext, Hits hits) voidvoidvoidreindex(Collection<T> collection) voidprotected voidresetFullQuery(SearchContext searchContext) search(SearchContext searchContext) search(SearchContext searchContext, String... selectedFieldNames) longsearchCount(SearchContext searchContext) voidsetCommitImmediately(boolean commitImmediately) protected voidsetDefaultSelectedFieldNames(String... defaultLocalizedFieldNames) protected voidsetDefaultSelectedLocalizedFieldNames(String... defaultLocalizedFieldNames) protected voidsetFilterSearch(boolean filterSearch) voidsetIndexerEnabled(boolean indexerEnabled) protected voidsetPermissionAware(boolean permissionAware) voidsetSelectAllLocales(boolean selectAllLocales) protected voidsetStagingAware(boolean stagingAware) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.liferay.portal.kernel.search.Indexer
getClassName, getCompanyId, getSummary, reindex
-
Constructor Details
-
BaseIndexer
public BaseIndexer()
-
-
Method Details
-
delete
- Specified by:
deletein interfaceIndexer<T>- Throws:
SearchException
-
delete
- Specified by:
deletein interfaceIndexer<T>- Throws:
SearchException
-
equals
-
getDocument
- Specified by:
getDocumentin interfaceIndexer<T>- Throws:
SearchException
-
getFacetBooleanFilter
public BooleanFilter getFacetBooleanFilter(String className, SearchContext searchContext) throws Exception - Specified by:
getFacetBooleanFilterin interfaceIndexer<T>- Throws:
Exception
-
getFullQuery
- Specified by:
getFullQueryin interfaceIndexer<T>- Throws:
SearchException
-
getIndexerPostProcessors
- Specified by:
getIndexerPostProcessorsin interfaceIndexer<T>
-
getSearchClassNames
- Specified by:
getSearchClassNamesin interfaceIndexer<T>
-
getSortField
Deprecated.As of Judson (7.1.x), replaced by#getSortField- Specified by:
getSortFieldin interfaceIndexer<T>
-
getSummary
public Summary getSummary(Document document, String snippet, PortletRequest portletRequest, PortletResponse portletResponse) throws SearchException - Specified by:
getSummaryin interfaceIndexer<T>- Throws:
SearchException
-
hashCode
public int hashCode() -
hasPermission
public boolean hasPermission(PermissionChecker permissionChecker, String entryClassName, long entryClassPK, String actionId) throws Exception - Specified by:
hasPermissionin interfaceIndexer<T>- Throws:
Exception
-
isCommitImmediately
public boolean isCommitImmediately()- Specified by:
isCommitImmediatelyin interfaceIndexer<T>
-
isFilterSearch
public boolean isFilterSearch()Description copied from interface:IndexerReturntrueif the indexer participates in post-search result filtering.- Specified by:
isFilterSearchin interfaceIndexer<T>- Returns:
trueif the indexer participates in post-search result filtering;falseotherwise- See Also:
-
isIndexerEnabled
public boolean isIndexerEnabled()- Specified by:
isIndexerEnabledin interfaceIndexer<T>
-
isPermissionAware
public boolean isPermissionAware()Description copied from interface:IndexerReturnstrueif the indexer adds permission related filters to the search query prior to execution- Specified by:
isPermissionAwarein interfaceIndexer<T>- Returns:
trueif the indexer adds permission related filters to the search query prior to execution;falseotherwise- See Also:
-
isSelectAllLocales
public boolean isSelectAllLocales() -
isStagingAware
public boolean isStagingAware()- Specified by:
isStagingAwarein interfaceIndexer<T>
-
isVisible
-
postProcessContextBooleanFilter
public void postProcessContextBooleanFilter(BooleanFilter contextBooleanFilter, SearchContext searchContext) throws Exception - Specified by:
postProcessContextBooleanFilterin interfaceIndexer<T>- Throws:
Exception
-
postProcessContextQuery
@Deprecated public void postProcessContextQuery(BooleanQuery contextQuery, SearchContext searchContext) throws Exception Deprecated.As of Wilberforce (7.0.x), replaced bypostProcessContextBooleanFilter(BooleanFilter, SearchContext)- Specified by:
postProcessContextQueryin interfaceIndexer<T>- Throws:
Exception
-
postProcessSearchQuery
public void postProcessSearchQuery(BooleanQuery searchQuery, BooleanFilter fullQueryBooleanFilter, SearchContext searchContext) throws Exception - Specified by:
postProcessSearchQueryin interfaceIndexer<T>- Throws:
Exception
-
postProcessSearchQuery
@Deprecated public void postProcessSearchQuery(BooleanQuery searchQuery, SearchContext searchContext) throws Exception Deprecated.As of Wilberforce (7.0.x), replaced bypostProcessSearchQuery(BooleanQuery, BooleanFilter, SearchContext)- Specified by:
postProcessSearchQueryin interfaceIndexer<T>- Throws:
Exception
-
reindex
-
reindex
- Specified by:
reindexin interfaceIndexer<T>- Throws:
SearchException
-
reindex
- Specified by:
reindexin interfaceIndexer<T>- Throws:
SearchException
-
reindex
- Specified by:
reindexin interfaceIndexer<T>- Throws:
SearchException
-
search
- Specified by:
searchin interfaceIndexer<T>- Throws:
SearchException
-
search
public Hits search(SearchContext searchContext, String... selectedFieldNames) throws SearchException - Specified by:
searchin interfaceIndexer<T>- Throws:
SearchException
-
searchCount
- Specified by:
searchCountin interfaceIndexer<T>- Throws:
SearchException
-
setCommitImmediately
public void setCommitImmediately(boolean commitImmediately) -
setIndexerEnabled
public void setIndexerEnabled(boolean indexerEnabled) - Specified by:
setIndexerEnabledin interfaceIndexer<T>
-
setSelectAllLocales
public void setSelectAllLocales(boolean selectAllLocales) -
addDefaultHighlightFieldNames
-
addDefaultSelectedFieldNames
-
addFacetClause
@Deprecated protected void addFacetClause(SearchContext searchContext, BooleanFilter facetBooleanFilter, Collection<Facet> facets) throws ParseException Deprecated.As of Wilberforce (7.0.x)- Throws:
ParseException
-
addFacetSelectedFieldNames
-
addLocalizedField
-
addSearchAssetCategoryIds
protected void addSearchAssetCategoryIds(BooleanFilter queryBooleanFilter, SearchContext searchContext) throws Exception - Throws:
Exception
-
addSearchAssetTagNames
protected void addSearchAssetTagNames(BooleanFilter queryBooleanFilter, SearchContext searchContext) throws Exception - Throws:
Exception
-
addSearchClassTypeIds
protected Filter addSearchClassTypeIds(BooleanFilter contextBooleanFilter, SearchContext searchContext) throws Exception - Throws:
Exception
-
addSearchEntryClassNames
protected void addSearchEntryClassNames(BooleanFilter queryBooleanFilter, SearchContext searchContext) throws Exception - Throws:
Exception
-
addSearchExpando
protected Map<String,Query> addSearchExpando(BooleanQuery searchQuery, SearchContext searchContext, String keywords) throws Exception - Throws:
Exception
-
addSearchFolderId
protected void addSearchFolderId(BooleanFilter queryBooleanFilter, SearchContext searchContext) throws Exception - Throws:
Exception
-
addSearchKeywords
protected Map<String,Query> addSearchKeywords(BooleanQuery searchQuery, SearchContext searchContext) throws Exception - Throws:
Exception
-
addSearchLayout
protected void addSearchLayout(BooleanFilter queryBooleanFilter, SearchContext searchContext) throws Exception - Throws:
Exception
-
addSearchLocalizedTerm
protected Map<String,Query> addSearchLocalizedTerm(BooleanQuery searchQuery, SearchContext searchContext, String field, boolean like) throws Exception - Throws:
Exception
-
addSearchTerm
protected Query addSearchTerm(BooleanQuery searchQuery, SearchContext searchContext, String field, boolean like) throws Exception - Throws:
Exception
-
addSearchUserId
protected void addSearchUserId(BooleanFilter queryBooleanFilter, SearchContext searchContext) throws Exception - Throws:
Exception
-
addSelectedLocalizedFieldNames
-
addStagingGroupKeyword
-
addStatus
protected void addStatus(BooleanFilter contextBooleanFilter, SearchContext searchContext) throws Exception - Throws:
Exception
-
createFullQuery
protected BooleanQuery createFullQuery(BooleanFilter fullQueryBooleanFilter, SearchContext searchContext) throws Exception - Throws:
Exception
-
createSummary
-
createSummary
-
deleteDocument
- Throws:
Exception
-
deleteDocument
- Throws:
Exception
-
deleteDocument
- Throws:
Exception
-
deleteDocument
- Throws:
Exception
-
doDelete
- Throws:
Exception
-
doGetDocument
- Throws:
Exception
-
doGetSortField
Deprecated.As of Judson (7.1.x), replaced bycom.liferay.portal.search.contributor.sort.SortFieldTranslator -
doGetSummary
protected abstract Summary doGetSummary(Document document, Locale locale, String snippet, PortletRequest portletRequest, PortletResponse portletResponse) throws Exception - Throws:
Exception
-
doPostProcessSearchQuery
@Deprecated protected void doPostProcessSearchQuery(Indexer<?> indexer, BooleanQuery searchQuery, SearchContext searchContext) throws Exception Deprecated.As of Wilberforce (7.0.x), added strictly to support backwards compatibility ofIndexer.postProcessSearchQuery(BooleanQuery, SearchContext)- Throws:
Exception
-
doReindex
- Throws:
Exception
-
doReindex
- Throws:
Exception
-
doReindex
- Throws:
Exception
-
doSearch
- Throws:
SearchException
-
getBaseModelDocument
-
getBaseModelDocument
-
getClassName
-
getDefaultSelectedFieldNames
-
getDefaultSelectedLocalizedFieldNames
-
getExpandoFieldName
protected String getExpandoFieldName(SearchContext searchContext, ExpandoBridge expandoBridge, String attributeName) -
getExpandoQueryContributors
-
getLocale
-
getLocalizedCountryNames
-
getSiteGroup
-
getSiteGroupId
protected long getSiteGroupId(long groupId) -
getSnippetLocale
-
isStagingGroup
protected boolean isStagingGroup(long groupId) -
isUseSearchResultPermissionFilter
-
isVisible
protected boolean isVisible(int entryStatus, int queryStatus) -
newDocument
-
populateAddresses
protected void populateAddresses(Document document, List<Address> addresses, long regionId, long countryId) throws PortalException - Throws:
PortalException
-
populateMap
-
postProcessFullQuery
protected void postProcessFullQuery(BooleanQuery fullQuery, SearchContext searchContext) throws Exception - Throws:
Exception
-
processHits
- Throws:
SearchException
-
resetFullQuery
-
setDefaultSelectedFieldNames
-
setDefaultSelectedLocalizedFieldNames
-
setFilterSearch
protected void setFilterSearch(boolean filterSearch) -
setPermissionAware
protected void setPermissionAware(boolean permissionAware) -
setStagingAware
protected void setStagingAware(boolean stagingAware)
-