public abstract class AbstractBatchIndexer extends Object implements BatchIndexer
| 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 boolean |
doDelete(String indexId,
String siteName,
String id) |
protected abstract boolean |
doSingleFileUpdate(String indexId,
String siteName,
String rootFolder,
String fileName,
boolean delete) |
protected boolean |
doUpdate(String indexId,
String siteName,
String id,
String xml) |
protected boolean |
doUpdateFile(String indexId,
String siteName,
String id,
File file) |
protected boolean |
doUpdateFile(String indexId,
String siteName,
String id,
File file,
Map<String,List<String>> additionalFields) |
protected String |
getIndexNameStr(String indexId) |
protected String |
getSiteBasedFileName(String siteName,
String fileName) |
protected boolean |
include(String fileName) |
void |
setExcludeFileNamePatterns(List<String> excludeFileNamePatterns) |
void |
setIncludeFileNamePatterns(List<String> includeFileNamePatterns) |
void |
setSearchService(org.craftercms.search.service.SearchService searchService) |
int |
updateIndex(String indexId,
String siteName,
String rootFolder,
List<String> fileNames,
boolean delete)
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 int updateIndex(String indexId, String siteName, String rootFolder, List<String> fileNames, boolean delete) 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 torootFolder - the root folder in the file system where the files arefileNames - the names or paths of the files to update/delete, relative to the root folderdelete - if the given files should be deleted from the index, otherwise they're addedBatchIndexingExceptionprotected boolean doUpdate(String indexId, String siteName, String id, String xml) throws org.craftercms.search.exception.SearchException
org.craftercms.search.exception.SearchExceptionprotected boolean doUpdateFile(String indexId, String siteName, String id, File file) throws org.craftercms.search.exception.SearchException
org.craftercms.search.exception.SearchExceptionprotected boolean doUpdateFile(String indexId, String siteName, String id, File file, Map<String,List<String>> additionalFields) throws org.craftercms.search.exception.SearchException
org.craftercms.search.exception.SearchExceptionprotected boolean doDelete(String indexId, String siteName, String id) throws org.craftercms.search.exception.SearchException
org.craftercms.search.exception.SearchExceptionprotected boolean include(String fileName)
protected abstract boolean doSingleFileUpdate(String indexId, String siteName, String rootFolder, String fileName, boolean delete) throws BatchIndexingException
BatchIndexingExceptionCopyright © 2016 CrafterCMS. All Rights Reserved.