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>
_copyFieldIds
The copy field ids.protected Set<String>
_dynFieldNames
The dynamic field names.protected Set<String>
_fieldNames
The simple field names.protected Set<String>
_fieldTypeNames
The 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 void
addCopyField(String source, String destination)
Add the given copy field.void
addDynamicField(String name)
Add a dynamic field name.void
addField(String name)
Add the given field name.void
addFieldType(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.boolean
hasCopyField(String source, String destination)
Test if the schema contains the given copy field.boolean
hasDynamicField(String name)
Test if the schema contains the given dynamic field.boolean
hasField(String name)
Test if the schema contains the given simple field.boolean
hasFieldType(String name)
Test if the schema contains the given field type.protected void
initFields(org.apache.solr.client.solrj.response.schema.SchemaRepresentation schema)
Initialize the field names from the schema representation.String
toString()
-
-
-
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.
-
-