Package de.cxp.ocs.preprocessor.impl
Class ExtractCategoryLevelDataProcessor
- java.lang.Object
-
- de.cxp.ocs.preprocessor.impl.ExtractCategoryLevelDataProcessor
-
- All Implemented Interfaces:
DocumentPreProcessor
public class ExtractCategoryLevelDataProcessor extends Object implements DocumentPreProcessor
Extracts the category levels of a single category path field into separate level and a leaf field if the *lvl and *leaf fields exists in the field configuration. Example:source: category: [A/B/C/D, Z/X/Y] becomes: category_lvl_0: A,Z category_lvl_1: B,X category_lvl_2: C,Y category_lvl_3: D category_leaf: D,Y
Will be auto configured if the following configuration entry is present:data-processor-configuration: processors: - ExtractCategoryLevelDataProcessor- Author:
- hjk
- See Also:
CategorySearchData
-
-
Constructor Summary
Constructors Constructor Description ExtractCategoryLevelDataProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinitialize(FieldConfigAccess fieldConfig, Map<String,String> preProcessorConfig)DataPreProcessor MUST have a no-args constructor.booleanprocess(Document document, boolean visible)Called for each source document.
-
-
-
Method Detail
-
initialize
public void initialize(FieldConfigAccess fieldConfig, Map<String,String> preProcessorConfig)
Description copied from interface:DocumentPreProcessorDataPreProcessor MUST have a no-args constructor. To configure it afterwards, this method will be used.- Specified by:
initializein interfaceDocumentPreProcessorpreProcessorConfig- custom string-to-string map that can be configured per DocumentPreProcessor.
-
process
public boolean process(Document document, boolean visible)
Description copied from interface:DocumentPreProcessorCalled for each source document.- Specified by:
processin interfaceDocumentPreProcessorvisible- weather or not the record is currently marked for indexing.- Returns:
trueif the record should be indexed,falseotherwise.
-
-