Package de.cxp.ocs.config
Class FieldConfigIndex
java.lang.Object
de.cxp.ocs.config.FieldConfigIndex
- All Implemented Interfaces:
FieldConfigAccess
Special class that cares about resolving the correct field configuration,
especially for "the category field" and dynamic fields.
-
Constructor Summary
ConstructorsConstructorDescriptionFieldConfigIndex
(FieldConfiguration fieldConfiguration) Constructor of the Field Index that prepares the given field configurations to match static and dynamic fields. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFieldConfig
(FieldConfiguration fieldConfig) Add field configuration from another index so that both indexes can be searched simultaneously.Get field by unique field name.getFieldsByType
(FieldType type) get all fields that have the specified field type configured.getFieldsByUsage
(FieldUsage usage) Get all fields that have the specified usage configured.getMatchingField
(String fieldName, FieldUsage usage) Get field with that name and the specified usage.getMatchingField
(String fieldName, Object value, FieldUsage usage) /** Similar togetMatchingField(String, Object)
but additionally tries to generate a field configuration based on the dynamic fields.getMatchingField
(String fieldName, Object value, Set<FieldUsage> searchedUsages) getMatchingFields
(String fieldName) Get all fields that have the the specified name as field-name or source-field.getMatchingFields
(String fieldName, Object value) Similar togetMatchingField(String)
but additionally tries to generate a field configuration based on the dynamic fields.void
processDynamicFieldConfig
(FieldConfiguration fieldConfiguration) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.cxp.ocs.config.FieldConfigAccess
getPrimaryCategoryField
-
Constructor Details
-
FieldConfigIndex
Constructor of the Field Index that prepares the given field configurations to match static and dynamic fields.- Parameters:
fieldConfiguration
- full field configuration
-
-
Method Details
-
addFieldConfig
public void addFieldConfig(FieldConfiguration fieldConfig) throws FieldConfigIncompatibilityException Add field configuration from another index so that both indexes can be searched simultaneously.- Parameters:
fieldConfig
- additional field config- Throws:
FieldConfigIncompatibilityException
- in case the field-config "schema" has conflicts with the existing field config
-
processDynamicFieldConfig
-
getFieldsByUsage
Description copied from interface:FieldConfigAccess
Get all fields that have the specified usage configured.- Specified by:
getFieldsByUsage
in interfaceFieldConfigAccess
- Parameters:
usage
- filter criterion- Returns:
- matching fields
-
getFieldsByType
Description copied from interface:FieldConfigAccess
get all fields that have the specified field type configured.- Specified by:
getFieldsByType
in interfaceFieldConfigAccess
- Parameters:
type
- filter criterion- Returns:
- matching fields
-
getField
Get field by unique field name.- Specified by:
getField
in interfaceFieldConfigAccess
- Parameters:
fieldName
-- Returns:
-
getMatchingFields
Get all fields that have the the specified name as field-name or source-field. If source-fields are not given at initialization (such at the search service), this function works similar togetField(String)
- Specified by:
getMatchingFields
in interfaceFieldConfigAccess
- Parameters:
fieldName
-- Returns:
-
getMatchingField
Get field with that name and the specified usage.- Specified by:
getMatchingField
in interfaceFieldConfigAccess
- Parameters:
fieldName
-usage
-- Returns:
-
getMatchingFields
Similar togetMatchingField(String)
but additionally tries to generate a field configuration based on the dynamic fields. If no dynamic fields are configured (such as at the search-service), no field configs are generated.- Specified by:
getMatchingFields
in interfaceFieldConfigAccess
- Parameters:
fieldName
-value
-- Returns:
-
getMatchingField
/** Similar togetMatchingField(String, Object)
but additionally tries to generate a field configuration based on the dynamic fields. Those fields are then filtered by the specifiedFieldUsage
.- Parameters:
fieldName
-value
-usage
-- Returns:
-
getMatchingField
-