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 Summary
Fields Modifier and Type Field Description protected Set<CopyFieldId>_copyFieldIdsThe copy field ids.protected Set<String>_dynFieldNamesThe dynamic field names.protected Set<String>_fieldNamesThe simple field names.protected Set<String>_fieldTypeNamesThe field type names.
-
Constructor Summary
Constructors Constructor Description SchemaFields(org.apache.solr.client.solrj.response.schema.SchemaRepresentation schemaRepresentation)Build a SchemaFields object from aSchemaRepresentation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCopyField(String source, String destination)Add the given copy field.voidaddDynamicField(String name)Add a dynamic field name.voidaddField(String name)Add the given field name.voidaddFieldType(String name)Add the given field type name.Set<CopyFieldId>getCopyFieldIds()Get the copy field ids.Set<String>getDynamicFieldNames()Get the dynamic field names.Set<String>getFieldNames()Get the simple field names.Set<String>getFieldTypeNames()Get the field types.booleanhasCopyField(String source, String destination)Test if the schema contains the given copy field.booleanhasDynamicField(String name)Test if the schema contains the given dynamic field.booleanhasField(String name)Test if the schema contains the given simple field.booleanhasFieldType(String name)Test if the schema contains the given field type.protected voidinitFields(org.apache.solr.client.solrj.response.schema.SchemaRepresentation schema)Initialize the field names from the schema representation.StringtoString()
-
-
-
Field Detail
-
_fieldNames
protected Set<String> _fieldNames
The simple field names.
-
_dynFieldNames
protected Set<String> _dynFieldNames
The dynamic field names.
-
_copyFieldIds
protected Set<CopyFieldId> _copyFieldIds
The copy field ids.
-
_fieldTypeNames
protected Set<String> _fieldTypeNames
The field type names.
-
-
Constructor Detail
-
SchemaFields
public SchemaFields(org.apache.solr.client.solrj.response.schema.SchemaRepresentation schemaRepresentation)
Build a SchemaFields object from aSchemaRepresentation.- Parameters:
schemaRepresentation- The schema representation.
-
-
Method Detail
-
getFieldNames
public Set<String> 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
public Set<String> 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
public Set<CopyFieldId> 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
public Set<String> 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.
-
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.
-
-