Class FieldDefinition
java.lang.Object
org.ametys.cms.search.solr.schema.FieldDefinition
- All Implemented Interfaces:
SchemaDefinition
- Direct Known Subclasses:
DynamicFieldDefinition
Represents a field definition in a solr schema.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanIf the field is stored as docValues.protected booleanWhether the field is indexed.protected booleanIf the field is multi-valued.protected StringThe field name, can contain a star character to represent a dynamic field (i.e.protected booleanWhether the field is stored.protected StringThe field type. -
Constructor Summary
ConstructorsConstructorDescriptionFieldDefinition(String name, String type, boolean multiValued, boolean docValues) Build a field definition, indexed and stored.FieldDefinition(String name, String type, boolean multiValued, boolean docValues, boolean indexed, boolean stored) Build a field definition.FieldDefinition(Map<String, Object> attributes) Build a field definition from a map of attributes. -
Method Summary
Modifier and TypeMethodDescriptionGet the attributes to build the field.booleanexists(SchemaFields schemaFields) Test if the definition is already definedgetName()Get the field name.org.apache.solr.client.solrj.request.schema.SchemaRequest.UpdateGet the schema request update.getType()Get the field type.booleanTrue to store the field as docValues.booleanTrue to store the field as indexed.booleanIf the field is multi-valued.booleanisStored()True to store the field as stored.voidsetDocValues(boolean docValues) Set if the field is stored as docValues.voidsetIndexed(boolean indexed) Set if the field is stored as indexed.voidsetMultiValued(boolean multiValued) Set if the field is multi-valued.voidSet the field name.voidsetStored(boolean stored) Set if the field is stored as stored.voidSet the field type.
-
Field Details
-
_name
The field name, can contain a star character to represent a dynamic field (i.e. *_type). -
_type
The field type. -
_multiValued
If the field is multi-valued. -
_docValues
If the field is stored as docValues. -
_indexed
Whether the field is indexed. -
_stored
Whether the field is stored.
-
-
Constructor Details
-
FieldDefinition
Build a field definition, indexed and stored.- Parameters:
name- The field name, can contain a star character to represent a dynamic field (i.e. *_type).type- The field type.multiValued-trueif the field is multi-valued.docValues-trueif the field is stored as docValues.
-
FieldDefinition
public FieldDefinition(String name, String type, boolean multiValued, boolean docValues, boolean indexed, boolean stored) Build a field definition.- Parameters:
name- The field name, can contain a star character to represent a dynamic field (i.e. *_type).type- The field type.multiValued-trueif the field is multi-valued.docValues-trueif the field is stored as docValues.indexed-trueif the field is indexed.stored-trueif the field is stored.
-
FieldDefinition
Build a field definition from a map of attributes.- Parameters:
attributes- the Map of attributes.
-
-
Method Details
-
getName
Get the field name.- Returns:
- The field name.
-
setName
Set the field name.- Parameters:
name- the field name.
-
getType
Get the field type.- Returns:
- The field type.
-
setType
Set the field type.- Parameters:
type- the field type.
-
isMultiValued
If the field is multi-valued.- Returns:
- true if the field is multi-valued, false otherwise.
-
setMultiValued
Set if the field is multi-valued.- Parameters:
multiValued-trueif the field is multi-valued.
-
isDocValues
True to store the field as docValues.- Returns:
- true to store the field as docValues, false otherwise.
-
setDocValues
Set if the field is stored as docValues.- Parameters:
docValues-trueif the field is stored as docValues.
-
isIndexed
True to store the field as indexed.- Returns:
- true to store the field as indexed, false otherwise.
-
setIndexed
Set if the field is stored as indexed.- Parameters:
indexed-trueif the field is stored as indexed.
-
isStored
True to store the field as stored.- Returns:
- true to store the field as stored, false otherwise.
-
setStored
Set if the field is stored as stored.- Parameters:
stored-trueif the field is stored as stored.
-
_getAttributes
Get the attributes to build the field.- Returns:
- the attributes as a map
-
getSchemaUpdate
Description copied from interface:SchemaDefinitionGet the schema request update.- Specified by:
getSchemaUpdatein interfaceSchemaDefinition- Returns:
- The update request
-
exists
Description copied from interface:SchemaDefinitionTest if the definition is already defined- Specified by:
existsin interfaceSchemaDefinition- Parameters:
schemaFields- the existing schema fields- Returns:
trueif the definition is in the schema fields
-