public class BinaryFileWithMetadataBatchIndexer extends AbstractBatchIndexer
BatchIndexer that tries to match the update/deleted files against a series of
metadata/binary path patterns. If a file is matched as metadata, it's is parsed for a reference to it's binary. If
one is found, then an update will be issued for the binary file along with the metadata that is extracted from the
metadata file, or a delete for the referenced binary file. If the file is matched as binary, then an update/delete
is issued without any metadata.| Modifier and Type | Field and Description |
|---|---|
protected List<String> |
binaryPathPatterns |
protected String |
charEncoding |
protected List<DocumentProcessor> |
documentProcessors |
protected List<String> |
excludeMetadataProperties |
protected List<String> |
metadataPathPatterns |
protected List<String> |
referenceXPaths |
excludeFileNamePatterns, includeFileNamePatterns, searchService| Constructor and Description |
|---|
BinaryFileWithMetadataBatchIndexer() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
doSingleFileUpdate(String indexId,
String siteName,
String rootFolder,
String fileName,
boolean delete) |
protected Map<String,List<String>> |
extractMetadata(org.dom4j.Document document) |
protected void |
extractMetadataFromChildren(org.dom4j.Element element,
String key,
org.springframework.util.MultiValueMap<String,String> metadata) |
protected String |
getBinaryFileName(org.dom4j.Document document) |
protected boolean |
isBinaryFile(String filePath) |
protected boolean |
isMetadataFile(String filePath) |
protected org.dom4j.Document |
processDocument(org.dom4j.Document document,
File file,
String root) |
void |
setBinaryPathPatterns(List<String> binaryPathPatterns) |
void |
setDocumentProcessors(List<DocumentProcessor> documentProcessors) |
void |
setExcludeMetadataProperties(List<String> excludeMetadataProperties) |
void |
setMetadataPathPatterns(List<String> metadataPathPatterns) |
void |
setReferenceXPaths(List<String> referenceXPaths) |
doDelete, doUpdate, doUpdateFile, doUpdateFile, getIndexNameStr, getSiteBasedFileName, include, setExcludeFileNamePatterns, setIncludeFileNamePatterns, setSearchService, updateIndexprotected List<DocumentProcessor> documentProcessors
protected String charEncoding
public void setDocumentProcessors(List<DocumentProcessor> documentProcessors)
public void setExcludeMetadataProperties(List<String> excludeMetadataProperties)
protected boolean doSingleFileUpdate(String indexId, String siteName, String rootFolder, String fileName, boolean delete) throws BatchIndexingException
doSingleFileUpdate in class AbstractBatchIndexerBatchIndexingExceptionprotected boolean isMetadataFile(String filePath)
protected boolean isBinaryFile(String filePath)
protected String getBinaryFileName(org.dom4j.Document document)
protected org.dom4j.Document processDocument(org.dom4j.Document document,
File file,
String root)
throws org.dom4j.DocumentException
org.dom4j.DocumentExceptionCopyright © 2016 CrafterCMS. All Rights Reserved.