Class FieldConfigIndex

java.lang.Object
de.cxp.ocs.config.FieldConfigIndex
All Implemented Interfaces:
FieldConfigAccess

public final class FieldConfigIndex extends Object implements FieldConfigAccess
Special class that cares about resolving the correct field configuration, especially for "the category field" and dynamic fields.
  • Constructor Details

    • FieldConfigIndex

      public FieldConfigIndex(FieldConfiguration fieldConfiguration)
      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

      public void processDynamicFieldConfig(FieldConfiguration fieldConfiguration)
    • getFieldsByUsage

      public Map<String,Field> getFieldsByUsage(FieldUsage usage)
      Description copied from interface: FieldConfigAccess
      Get all fields that have the specified usage configured.
      Specified by:
      getFieldsByUsage in interface FieldConfigAccess
      Parameters:
      usage - filter criterion
      Returns:
      matching fields
    • getFieldsByType

      public Map<String,Field> getFieldsByType(FieldType type)
      Description copied from interface: FieldConfigAccess
      get all fields that have the specified field type configured.
      Specified by:
      getFieldsByType in interface FieldConfigAccess
      Parameters:
      type - filter criterion
      Returns:
      matching fields
    • getField

      public Optional<Field> getField(String fieldName)
      Get field by unique field name.
      Specified by:
      getField in interface FieldConfigAccess
      Parameters:
      fieldName -
      Returns:
    • getMatchingFields

      public Set<Field> getMatchingFields(String fieldName)
      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 to getField(String)
      Specified by:
      getMatchingFields in interface FieldConfigAccess
      Parameters:
      fieldName -
      Returns:
    • getMatchingField

      public Optional<Field> getMatchingField(String fieldName, FieldUsage usage)
      Get field with that name and the specified usage.
      Specified by:
      getMatchingField in interface FieldConfigAccess
      Parameters:
      fieldName -
      usage -
      Returns:
    • getMatchingFields

      public Set<Field> getMatchingFields(String fieldName, Object value)
      Similar to getMatchingField(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 interface FieldConfigAccess
      Parameters:
      fieldName -
      value -
      Returns:
    • getMatchingField

      public Optional<Field> getMatchingField(String fieldName, Object value, FieldUsage usage)
      /** Similar to getMatchingField(String, Object) but additionally tries to generate a field configuration based on the dynamic fields. Those fields are then filtered by the specified FieldUsage.
      Parameters:
      fieldName -
      value -
      usage -
      Returns:
    • getMatchingField

      public Optional<Field> getMatchingField(String fieldName, Object value, Set<FieldUsage> searchedUsages)