Class SchemaFields

java.lang.Object
org.ametys.cms.search.solr.schema.SchemaFields

public class SchemaFields extends Object
Represents the field names of a solr schema, mainly used to track existing fields.
  • Field Details

  • Constructor Details

    • SchemaFields

      public SchemaFields(org.apache.solr.client.solrj.response.schema.SchemaRepresentation schemaRepresentation)
      Build a SchemaFields object from a SchemaRepresentation.
      Parameters:
      schemaRepresentation - The schema representation.
  • Method Details

    • getFieldNames

      Get the simple field names.
      Returns:
      The simple field names.
    • hasField

      public boolean hasField(String name)
      Test if the schema contains the given simple field.
      Parameters:
      name - The field name to test.
      Returns:
      true if the schema contains the given simple field.
    • addField

      public void addField(String name)
      Add the given field name.
      Parameters:
      name - the field name to add.
    • getDynamicFieldNames

      Get the dynamic field names.
      Returns:
      The dynamic field names.
    • hasDynamicField

      public boolean hasDynamicField(String name)
      Test if the schema contains the given dynamic field.
      Parameters:
      name - The dynamic field name to test.
      Returns:
      true if the schema contains the given dynamic field.
    • addDynamicField

      public void addDynamicField(String name)
      Add a dynamic field name.
      Parameters:
      name - the dynamic field name to add.
    • getCopyFieldIds

      Get the copy field ids.
      Returns:
      The copy field ids.
    • hasCopyField

      public boolean hasCopyField(String source, String destination)
      Test if the schema contains the given copy field.
      Parameters:
      source - The copy field source.
      destination - The copy field destination.
      Returns:
      true if the schema contains the given copy field.
    • addCopyField

      public void addCopyField(String source, String destination)
      Add the given copy field.
      Parameters:
      source - The copy field source.
      destination - The copy field destination.
    • getFieldTypeNames

      Get the field types.
      Returns:
      The field types.
    • hasFieldType

      public boolean hasFieldType(String name)
      Test if the schema contains the given field type.
      Parameters:
      name - The field type name to test.
      Returns:
      true if the schema contains the given field type.
    • addFieldType

      public void addFieldType(String name)
      Add the given field type name.
      Parameters:
      name - the field type name to add.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • initFields

      protected void initFields(org.apache.solr.client.solrj.response.schema.SchemaRepresentation schema)
      Initialize the field names from the schema representation.
      Parameters:
      schema - The schema representation.