public abstract class AbstractBatchIndexer extends AbstractMetadataCollector implements BatchIndexer
BatchIndexer
s. 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> |
excludePathPatterns |
protected List<String> |
includePathPatterns |
metadataExtractors
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,
UpdateDetail updateDetail,
UpdateStatus updateStatus,
Map<String,String> metadata) |
protected boolean |
include(String path) |
void |
setExcludePathPatterns(List<String> excludePathPatterns) |
void |
setIncludePathPatterns(List<String> includePathPatterns) |
void |
updateIndex(String indexId,
String siteName,
org.craftercms.core.service.ContentStoreService contentStoreService,
org.craftercms.core.service.Context context,
UpdateSet updateSet,
UpdateStatus updateStatus)
Updates the specified search index with the given batch of files.
|
collectMetadata, setMetadataExtractors
public void updateIndex(String indexId, String siteName, org.craftercms.core.service.ContentStoreService contentStoreService, org.craftercms.core.service.Context context, UpdateSet updateSet, UpdateStatus updateStatus) throws BatchIndexingException
BatchIndexer
updateIndex
in interface BatchIndexer
indexId
- 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 usedupdateSet
- the set of files to update/deleteupdateStatus
- status object used to track index updates and deletesBatchIndexingException
protected boolean include(String path)
protected abstract void doSingleFileUpdate(String indexId, String siteName, org.craftercms.core.service.ContentStoreService contentStoreService, org.craftercms.core.service.Context context, String path, boolean delete, UpdateDetail updateDetail, UpdateStatus updateStatus, Map<String,String> metadata) throws Exception
Exception
Copyright © 2019 CrafterCMS. All rights reserved.