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 void |
doDelete(String indexId,
String siteName,
String id,
IndexingStatus status) |
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 void |
doUpdate(String indexId,
String siteName,
String id,
String xml,
IndexingStatus status) |
protected void |
doUpdateContent(String indexId,
String siteName,
String id,
org.craftercms.core.service.Content content,
IndexingStatus status) |
protected void |
doUpdateContent(String indexId,
String siteName,
String id,
org.craftercms.core.service.Content content,
Map<String,List<String>> additionalFields,
IndexingStatus status) |
protected String |
getIndexNameStr(String indexId) |
protected String |
getSiteBasedPath(String siteName,
String path) |
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 void doUpdate(String indexId, String siteName, String id, String xml, IndexingStatus status)
protected void doUpdateContent(String indexId, String siteName, String id, org.craftercms.core.service.Content content, IndexingStatus status) throws IOException
IOExceptionprotected void doUpdateContent(String indexId, String siteName, String id, org.craftercms.core.service.Content content, Map<String,List<String>> additionalFields, IndexingStatus status) throws IOException
IOExceptionprotected void doDelete(String indexId, String siteName, String id, IndexingStatus status)
protected boolean include(String fileName)
Copyright © 2017 CrafterCMS. All Rights Reserved.