Class FieldDefinition
- java.lang.Object
-
- org.ametys.cms.search.solr.schema.FieldDefinition
-
- All Implemented Interfaces:
SchemaDefinition
public class FieldDefinition extends Object implements SchemaDefinition
Represents a field definition (simple field or dynamic field) in a solr schema.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean_docValuesIf the field is stored as docValues.protected boolean_indexedWhether the field is indexed.protected boolean_multiValuedIf the field is multi-valued.protected String_nameThe field name, can contain a star character to represent a dynamic field (i.e.protected boolean_storedWhether the field is stored.protected String_typeThe field type.
-
Constructor Summary
Constructors Constructor Description FieldDefinition(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleangetBoolean(Map<String,Object> attributes, String name, boolean defaultValue)StringgetName()Get the field name.StringgetType()Get the field type.booleanisDocValues()True to store the field as docValues.booleanisDynamic()Test if the field is dynamic.booleanisIndexed()True to store the field as indexed.booleanisMultiValued()If 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.voidsetName(String name)Set the field name.voidsetStored(boolean stored)Set if the field is stored as stored.voidsetType(String type)Set the field type.
-
-
-
Field Detail
-
_name
protected String _name
The field name, can contain a star character to represent a dynamic field (i.e. *_type).
-
_multiValued
protected boolean _multiValued
If the field is multi-valued.
-
_docValues
protected boolean _docValues
If the field is stored as docValues.
-
_indexed
protected boolean _indexed
Whether the field is indexed.
-
_stored
protected boolean _stored
Whether the field is stored.
-
-
Constructor Detail
-
FieldDefinition
public FieldDefinition(String name, String type, boolean multiValued, boolean docValues)
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
public FieldDefinition(Map<String,Object> attributes)
Build a field definition from a map of attributes.- Parameters:
attributes- the Map of attributes.
-
-
Method Detail
-
getBoolean
private boolean getBoolean(Map<String,Object> attributes, String name, boolean defaultValue)
-
isMultiValued
public boolean isMultiValued()
If the field is multi-valued.- Returns:
- true if the field is multi-valued, false otherwise.
-
setMultiValued
public void setMultiValued(boolean multiValued)
Set if the field is multi-valued.- Parameters:
multiValued-trueif the field is multi-valued.
-
isDocValues
public boolean isDocValues()
True to store the field as docValues.- Returns:
- true to store the field as docValues, false otherwise.
-
setDocValues
public void setDocValues(boolean docValues)
Set if the field is stored as docValues.- Parameters:
docValues-trueif the field is stored as docValues.
-
isIndexed
public boolean isIndexed()
True to store the field as indexed.- Returns:
- true to store the field as indexed, false otherwise.
-
setIndexed
public void setIndexed(boolean indexed)
Set if the field is stored as indexed.- Parameters:
indexed-trueif the field is stored as indexed.
-
isStored
public boolean isStored()
True to store the field as stored.- Returns:
- true to store the field as stored, false otherwise.
-
setStored
public void setStored(boolean stored)
Set if the field is stored as stored.- Parameters:
stored-trueif the field is stored as stored.
-
isDynamic
public boolean isDynamic()
Test if the field is dynamic.- Returns:
- true if the field is dynamic.
-
-