public abstract class AbstractBatchIndexer extends Object implements BatchIndexer
BatchIndexers. Basically sub-classes only need to provide the processing of each of the files to be indexed.| Modifier and Type | Field and Description |
|---|---|
protected List<String> |
excludeFileNamePatterns |
protected List<String> |
includeFileNamePatterns |
protected org.craftercms.search.service.SearchService |
searchService |
| Constructor and Description |
|---|
AbstractBatchIndexer() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
doSingleFileUpdate(String indexId,
String siteName,
org.craftercms.core.service.ContentStoreService contentStoreService,
org.craftercms.core.service.Context context,
String path,
boolean delete,
IndexingStatus status) |
protected boolean |
include(String fileName) |
void |
setExcludeFileNamePatterns(List<String> excludeFileNamePatterns) |
void |
setIncludeFileNamePatterns(List<String> includeFileNamePatterns) |
void |
setSearchService(org.craftercms.search.service.SearchService searchService) |
void |
updateIndex(String indexId,
String siteName,
org.craftercms.core.service.ContentStoreService contentStoreService,
org.craftercms.core.service.Context context,
List<String> paths,
boolean delete,
IndexingStatus status)
Updates the specified search index with the given batch of files.
|
public void setSearchService(org.craftercms.search.service.SearchService searchService)
public void setIncludeFileNamePatterns(List<String> includeFileNamePatterns)
public void setExcludeFileNamePatterns(List<String> excludeFileNamePatterns)
public void updateIndex(String indexId, String siteName, org.craftercms.core.service.ContentStoreService contentStoreService, org.craftercms.core.service.Context context, List<String> paths, boolean delete, IndexingStatus status) throws BatchIndexingException
BatchIndexerupdateIndex in interface BatchIndexerindexId - the ID of the index, or null to use a default indexsiteName - the name of the site the files belong tocontentStoreService - the content store service used to retrieve the files and content to indexcontext - the context of the file store being usedpaths - the paths in the content store of the files to indexdelete - if the given files should be deleted from the index, otherwise they're addedstatus - status object used to track index updates and deletesBatchIndexingExceptionprotected boolean include(String fileName)
Copyright © 2018 CrafterCMS. All rights reserved.