com.liferay.portal.kernel.search
Class BaseIndexer
java.lang.Object
com.liferay.portal.kernel.search.BaseIndexer
- All Implemented Interfaces:
- Indexer
- Direct Known Subclasses:
- AssetCategoryIndexer, AssetIndexer, AssetSearcher, AssetVocabularyIndexer, BaseAlloyIndexer, BaseSearcher, BlogsIndexer, BookmarksEntryIndexer, BookmarksFolderIndexer, CalIndexer, ContactIndexer, DDLIndexer, DLFileEntryIndexer, DLFolderIndexer, FacetedSearcher, FolderSearcher, JournalArticleIndexer, JournalFolderIndexer, MBMessageIndexer, MBThreadIndexer, OrganizationIndexer, PluginPackageIndexer, SCIndexer, TrashIndexer, UserGroupIndexer, UserIndexer, WikiNodeIndexer, WikiPageIndexer
public abstract class BaseIndexer
- extends Object
- implements Indexer
Method Summary |
protected void |
addAssetFields(Document document,
String className,
long classPK)
|
protected void |
addLocalizedSearchTerm(BooleanQuery searchQuery,
SearchContext searchContext,
String field,
boolean like)
Deprecated. As of 6.2.0, replaced by addSearchLocalizedTerm(BooleanQuery, SearchContext, String,
boolean) |
protected void |
addRelatedClassNames(BooleanQuery contextQuery,
SearchContext searchContext)
|
void |
addRelatedEntryFields(Document document,
Object obj)
|
protected void |
addSearchArrayQuery(BooleanQuery searchQuery,
SearchContext searchContext,
String field)
|
protected void |
addSearchAssetCategoryIds(BooleanQuery contextQuery,
SearchContext searchContext)
|
protected void |
addSearchAssetCategoryTitles(Document document,
String field,
List<AssetCategory> assetCategories)
|
protected void |
addSearchAssetTagNames(BooleanQuery contextQuery,
SearchContext searchContext)
|
protected void |
addSearchClassTypeIds(BooleanQuery contextQuery,
SearchContext searchContext)
|
protected void |
addSearchDDMStruture(BooleanQuery searchQuery,
SearchContext searchContext,
DDMStructure ddmStructure)
|
protected void |
addSearchEntryClassNames(BooleanQuery contextQuery,
SearchContext searchContext)
|
protected void |
addSearchExpando(BooleanQuery searchQuery,
SearchContext searchContext,
String keywords)
|
protected void |
addSearchFolderId(BooleanQuery contextQuery,
SearchContext searchContext)
|
protected void |
addSearchGroupId(BooleanQuery contextQuery,
SearchContext searchContext)
|
protected void |
addSearchKeywords(BooleanQuery searchQuery,
SearchContext searchContext)
|
protected void |
addSearchLayout(BooleanQuery contextQuery,
SearchContext searchContext)
|
protected void |
addSearchLocalizedTerm(BooleanQuery searchQuery,
SearchContext searchContext,
String field,
boolean like)
|
protected void |
addSearchTerm(BooleanQuery searchQuery,
SearchContext searchContext,
String field,
boolean like)
|
protected void |
addSearchUserId(BooleanQuery contextQuery,
SearchContext searchContext)
|
protected void |
addStagingGroupKeyword(Document document,
long groupId)
|
protected void |
addStatus(BooleanQuery contextQuery,
SearchContext searchContext)
|
protected void |
addTrashFields(Document document,
TrashedModel trashedModel)
|
protected BooleanQuery |
createFullQuery(BooleanQuery contextQuery,
SearchContext searchContext)
|
protected Summary |
createLocalizedSummary(Document document,
Locale locale)
|
protected Summary |
createLocalizedSummary(Document document,
Locale locale,
String titleField,
String contentField)
|
protected Summary |
createSummary(Document document)
|
protected Summary |
createSummary(Document document,
String titleField,
String contentField)
|
void |
delete(long companyId,
String uid)
|
void |
delete(Object obj)
|
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(Object obj)
|
protected abstract Document |
doGetDocument(Object obj)
|
protected String |
doGetSortField(String orderByCol)
|
protected abstract Summary |
doGetSummary(Document document,
Locale locale,
String snippet,
PortletURL portletURL)
|
protected abstract void |
doReindex(Object obj)
|
protected abstract void |
doReindex(String[] ids)
|
protected abstract void |
doReindex(String className,
long classPK)
|
protected void |
doReindexDDMStructures(List<Long> structureIds)
|
protected Hits |
doSearch(SearchContext searchContext)
|
protected Hits |
filterSearch(Hits hits,
PermissionChecker permissionChecker,
SearchContext searchContext)
Deprecated. As of 7.0.0, with no direct replacement |
protected Document |
getBaseModelDocument(String portletId,
BaseModel<?> baseModel)
|
protected Document |
getBaseModelDocument(String portletId,
BaseModel<?> baseModel,
BaseModel<?> workflowedBaseModel)
|
protected String |
getClassName(SearchContext searchContext)
|
Document |
getDocument(Object obj)
|
BooleanQuery |
getFacetQuery(String className,
SearchContext searchContext)
|
BooleanQuery |
getFullQuery(SearchContext searchContext)
|
IndexerPostProcessor[] |
getIndexerPostProcessors()
|
protected Set<String> |
getLocalizedCountryNames(Country country)
|
protected long |
getParentGroupId(long groupId)
Deprecated. As of 6.2.0 renamed to getSiteGroupId(long) |
protected abstract String |
getPortletId(SearchContext searchContext)
|
String |
getSearchEngineId()
|
protected long |
getSiteGroupId(long groupId)
|
protected Locale |
getSnippetLocale(Document document,
Locale locale)
|
String |
getSortField(String orderByCol)
|
String |
getSortField(String orderByCol,
int sortType)
|
Summary |
getSummary(Document document,
Locale locale,
String snippet,
PortletURL portletURL)
|
boolean |
hasPermission(PermissionChecker permissionChecker,
String entryClassName,
long entryClassPK,
String actionId)
|
boolean |
isCommitImmediately()
|
boolean |
isFilterSearch()
|
boolean |
isIndexerEnabled()
|
boolean |
isPermissionAware()
|
boolean |
isStagingAware()
|
protected boolean |
isUseSearchResultPermissionFilter(SearchContext searchContext)
|
protected boolean |
isVisible(int entryStatus,
int queryStatus)
|
boolean |
isVisible(long classPK,
int status)
|
boolean |
isVisibleRelatedEntry(long classPK,
int status)
|
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 |
postProcessContextQuery(BooleanQuery contextQuery,
SearchContext searchContext)
|
protected void |
postProcessFullQuery(BooleanQuery fullQuery,
SearchContext searchContext)
|
void |
postProcessSearchQuery(BooleanQuery searchQuery,
SearchContext searchContext)
|
protected void |
processHits(SearchContext searchContext,
Hits hits)
|
void |
registerIndexerPostProcessor(IndexerPostProcessor indexerPostProcessor)
|
void |
reindex(Object obj)
|
void |
reindex(String[] ids)
|
void |
reindex(String className,
long classPK)
|
void |
reindexDDMStructures(List<Long> ddmStructureIds)
|
Hits |
search(SearchContext searchContext)
|
void |
setCommitImmediately(boolean commitImmediately)
|
protected void |
setFilterSearch(boolean filterSearch)
|
protected void |
setIndexerEnabled(boolean indexerEnabled)
|
protected void |
setPermissionAware(boolean permissionAware)
|
protected void |
setSortableTextFields(String[] sortableTextFields)
|
protected void |
setStagingAware(boolean stagingAware)
|
void |
unregisterIndexerPostProcessor(IndexerPostProcessor indexerPostProcessor)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INDEX_FILTER_SEARCH_LIMIT
public static final int INDEX_FILTER_SEARCH_LIMIT
- Deprecated. As of 7.0.0, with no direct replacement
BaseIndexer
public BaseIndexer()
addRelatedEntryFields
public void addRelatedEntryFields(Document document,
Object obj)
throws Exception
- Specified by:
addRelatedEntryFields
in interface Indexer
- Throws:
Exception
delete
public void delete(long companyId,
String uid)
throws SearchException
- Specified by:
delete
in interface Indexer
- Throws:
SearchException
delete
public void delete(Object obj)
throws SearchException
- Specified by:
delete
in interface Indexer
- Throws:
SearchException
getDocument
public Document getDocument(Object obj)
throws SearchException
- Specified by:
getDocument
in interface Indexer
- Throws:
SearchException
getFacetQuery
public BooleanQuery getFacetQuery(String className,
SearchContext searchContext)
throws Exception
- Specified by:
getFacetQuery
in interface Indexer
- Throws:
Exception
getFullQuery
public BooleanQuery getFullQuery(SearchContext searchContext)
throws SearchException
- Specified by:
getFullQuery
in interface Indexer
- Throws:
SearchException
getIndexerPostProcessors
public IndexerPostProcessor[] getIndexerPostProcessors()
- Specified by:
getIndexerPostProcessors
in interface Indexer
getSearchEngineId
public String getSearchEngineId()
- Specified by:
getSearchEngineId
in interface Indexer
getSortField
public String getSortField(String orderByCol)
- Specified by:
getSortField
in interface Indexer
getSortField
public String getSortField(String orderByCol,
int sortType)
- Specified by:
getSortField
in interface Indexer
getSummary
public Summary getSummary(Document document,
Locale locale,
String snippet,
PortletURL portletURL)
throws SearchException
- Specified by:
getSummary
in interface Indexer
- Throws:
SearchException
hasPermission
public boolean hasPermission(PermissionChecker permissionChecker,
String entryClassName,
long entryClassPK,
String actionId)
throws Exception
- Specified by:
hasPermission
in interface Indexer
- Throws:
Exception
isCommitImmediately
public boolean isCommitImmediately()
isFilterSearch
public boolean isFilterSearch()
- Specified by:
isFilterSearch
in interface Indexer
isIndexerEnabled
public boolean isIndexerEnabled()
isPermissionAware
public boolean isPermissionAware()
- Specified by:
isPermissionAware
in interface Indexer
isStagingAware
public boolean isStagingAware()
- Specified by:
isStagingAware
in interface Indexer
isVisible
public boolean isVisible(long classPK,
int status)
throws Exception
- Specified by:
isVisible
in interface Indexer
- Throws:
Exception
isVisibleRelatedEntry
public boolean isVisibleRelatedEntry(long classPK,
int status)
throws Exception
- Specified by:
isVisibleRelatedEntry
in interface Indexer
- Throws:
Exception
postProcessContextQuery
public void postProcessContextQuery(BooleanQuery contextQuery,
SearchContext searchContext)
throws Exception
- Specified by:
postProcessContextQuery
in interface Indexer
- Throws:
Exception
postProcessSearchQuery
public void postProcessSearchQuery(BooleanQuery searchQuery,
SearchContext searchContext)
throws Exception
- Specified by:
postProcessSearchQuery
in interface Indexer
- Throws:
Exception
registerIndexerPostProcessor
public void registerIndexerPostProcessor(IndexerPostProcessor indexerPostProcessor)
- Specified by:
registerIndexerPostProcessor
in interface Indexer
reindex
public void reindex(Object obj)
throws SearchException
- Specified by:
reindex
in interface Indexer
- Throws:
SearchException
reindex
public void reindex(String className,
long classPK)
throws SearchException
- Specified by:
reindex
in interface Indexer
- Throws:
SearchException
reindex
public void reindex(String[] ids)
throws SearchException
- Specified by:
reindex
in interface Indexer
- Throws:
SearchException
reindexDDMStructures
public void reindexDDMStructures(List<Long> ddmStructureIds)
throws SearchException
- Specified by:
reindexDDMStructures
in interface Indexer
- Throws:
SearchException
search
public Hits search(SearchContext searchContext)
throws SearchException
- Specified by:
search
in interface Indexer
- Throws:
SearchException
setCommitImmediately
public void setCommitImmediately(boolean commitImmediately)
unregisterIndexerPostProcessor
public void unregisterIndexerPostProcessor(IndexerPostProcessor indexerPostProcessor)
- Specified by:
unregisterIndexerPostProcessor
in interface Indexer
addAssetFields
protected void addAssetFields(Document document,
String className,
long classPK)
throws SystemException
- Throws:
SystemException
addLocalizedSearchTerm
protected void addLocalizedSearchTerm(BooleanQuery searchQuery,
SearchContext searchContext,
String field,
boolean like)
throws Exception
- Deprecated. As of 6.2.0, replaced by
addSearchLocalizedTerm(BooleanQuery, SearchContext, String,
boolean)
- Throws:
Exception
addRelatedClassNames
protected void addRelatedClassNames(BooleanQuery contextQuery,
SearchContext searchContext)
throws Exception
- Throws:
Exception
addSearchArrayQuery
protected void addSearchArrayQuery(BooleanQuery searchQuery,
SearchContext searchContext,
String field)
throws Exception
- Throws:
Exception
addSearchAssetCategoryIds
protected void addSearchAssetCategoryIds(BooleanQuery contextQuery,
SearchContext searchContext)
throws Exception
- Throws:
Exception
addSearchAssetCategoryTitles
protected void addSearchAssetCategoryTitles(Document document,
String field,
List<AssetCategory> assetCategories)
addSearchAssetTagNames
protected void addSearchAssetTagNames(BooleanQuery contextQuery,
SearchContext searchContext)
throws Exception
- Throws:
Exception
addSearchClassTypeIds
protected void addSearchClassTypeIds(BooleanQuery contextQuery,
SearchContext searchContext)
throws Exception
- Throws:
Exception
addSearchDDMStruture
protected void addSearchDDMStruture(BooleanQuery searchQuery,
SearchContext searchContext,
DDMStructure ddmStructure)
throws Exception
- Throws:
Exception
addSearchEntryClassNames
protected void addSearchEntryClassNames(BooleanQuery contextQuery,
SearchContext searchContext)
throws Exception
- Throws:
Exception
addSearchExpando
protected void addSearchExpando(BooleanQuery searchQuery,
SearchContext searchContext,
String keywords)
throws Exception
- Throws:
Exception
addSearchFolderId
protected void addSearchFolderId(BooleanQuery contextQuery,
SearchContext searchContext)
throws Exception
- Throws:
Exception
addSearchGroupId
protected void addSearchGroupId(BooleanQuery contextQuery,
SearchContext searchContext)
throws Exception
- Throws:
Exception
addSearchKeywords
protected void addSearchKeywords(BooleanQuery searchQuery,
SearchContext searchContext)
throws Exception
- Throws:
Exception
addSearchLayout
protected void addSearchLayout(BooleanQuery contextQuery,
SearchContext searchContext)
throws Exception
- Throws:
Exception
addSearchLocalizedTerm
protected void addSearchLocalizedTerm(BooleanQuery searchQuery,
SearchContext searchContext,
String field,
boolean like)
throws Exception
- Throws:
Exception
addSearchTerm
protected void addSearchTerm(BooleanQuery searchQuery,
SearchContext searchContext,
String field,
boolean like)
throws Exception
- Throws:
Exception
addSearchUserId
protected void addSearchUserId(BooleanQuery contextQuery,
SearchContext searchContext)
throws Exception
- Throws:
Exception
addStagingGroupKeyword
protected void addStagingGroupKeyword(Document document,
long groupId)
throws Exception
- Throws:
Exception
addStatus
protected void addStatus(BooleanQuery contextQuery,
SearchContext searchContext)
throws Exception
- Throws:
Exception
addTrashFields
protected void addTrashFields(Document document,
TrashedModel trashedModel)
throws SystemException
- Throws:
SystemException
createFullQuery
protected BooleanQuery createFullQuery(BooleanQuery contextQuery,
SearchContext searchContext)
throws Exception
- Throws:
Exception
createLocalizedSummary
protected Summary createLocalizedSummary(Document document,
Locale locale)
createLocalizedSummary
protected Summary createLocalizedSummary(Document document,
Locale locale,
String titleField,
String contentField)
createSummary
protected Summary createSummary(Document document)
createSummary
protected Summary createSummary(Document document,
String titleField,
String contentField)
deleteDocument
protected void deleteDocument(long companyId,
long field1)
throws Exception
- Throws:
Exception
deleteDocument
protected void deleteDocument(long companyId,
long field1,
String field2)
throws Exception
- Throws:
Exception
deleteDocument
protected void deleteDocument(long companyId,
String field1)
throws Exception
- Throws:
Exception
deleteDocument
protected void deleteDocument(long companyId,
String field1,
String field2)
throws Exception
- Throws:
Exception
doDelete
protected abstract void doDelete(Object obj)
throws Exception
- Throws:
Exception
doGetDocument
protected abstract Document doGetDocument(Object obj)
throws Exception
- Throws:
Exception
doGetSortField
protected String doGetSortField(String orderByCol)
doGetSummary
protected abstract Summary doGetSummary(Document document,
Locale locale,
String snippet,
PortletURL portletURL)
throws Exception
- Throws:
Exception
doReindex
protected abstract void doReindex(Object obj)
throws Exception
- Throws:
Exception
doReindex
protected abstract void doReindex(String className,
long classPK)
throws Exception
- Throws:
Exception
doReindex
protected abstract void doReindex(String[] ids)
throws Exception
- Throws:
Exception
doReindexDDMStructures
protected void doReindexDDMStructures(List<Long> structureIds)
throws Exception
- Throws:
Exception
doSearch
protected Hits doSearch(SearchContext searchContext)
throws SearchException
- Throws:
SearchException
filterSearch
protected Hits filterSearch(Hits hits,
PermissionChecker permissionChecker,
SearchContext searchContext)
- Deprecated. As of 7.0.0, with no direct replacement
getBaseModelDocument
protected Document getBaseModelDocument(String portletId,
BaseModel<?> baseModel)
throws SystemException
- Throws:
SystemException
getBaseModelDocument
protected Document getBaseModelDocument(String portletId,
BaseModel<?> baseModel,
BaseModel<?> workflowedBaseModel)
throws SystemException
- Throws:
SystemException
getClassName
protected String getClassName(SearchContext searchContext)
getLocalizedCountryNames
protected Set<String> getLocalizedCountryNames(Country country)
getParentGroupId
protected long getParentGroupId(long groupId)
- Deprecated. As of 6.2.0 renamed to
getSiteGroupId(long)
getPortletId
protected abstract String getPortletId(SearchContext searchContext)
getSiteGroupId
protected long getSiteGroupId(long groupId)
getSnippetLocale
protected Locale getSnippetLocale(Document document,
Locale locale)
isUseSearchResultPermissionFilter
protected boolean isUseSearchResultPermissionFilter(SearchContext searchContext)
isVisible
protected boolean isVisible(int entryStatus,
int queryStatus)
newDocument
protected Document newDocument()
populateAddresses
protected void populateAddresses(Document document,
List<Address> addresses,
long regionId,
long countryId)
throws PortalException,
SystemException
- Throws:
PortalException
SystemException
populateMap
protected Map<Locale,String> populateMap(AssetEntry assetEntry,
Map<Locale,String> map)
postProcessFullQuery
protected void postProcessFullQuery(BooleanQuery fullQuery,
SearchContext searchContext)
throws Exception
- Throws:
Exception
processHits
protected void processHits(SearchContext searchContext,
Hits hits)
throws SearchException
- Throws:
SearchException
setFilterSearch
protected void setFilterSearch(boolean filterSearch)
setIndexerEnabled
protected void setIndexerEnabled(boolean indexerEnabled)
setPermissionAware
protected void setPermissionAware(boolean permissionAware)
setSortableTextFields
protected void setSortableTextFields(String[] sortableTextFields)
setStagingAware
protected void setStagingAware(boolean stagingAware)