Annotation Interface Field
@Retention(RUNTIME)
@Target({FIELD,ANNOTATION_TYPE,METHOD})
@Documented
@Inherited
public @interface Field
- Author:
- Rizwan Idrees, Mohsin Husen, Artur Konczak, Jonathan Yan, Jakub Vavrik, Kevin Leturc, Peter-Josef Meisch, Xiao Yu, Aleksei Arsenev, Brian Kimmig, Morgan Lutz, Sascha Woo, Haibo Liu, Andriy Redko
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionboolean
String[]
int
to be used in combination withFieldType.Dense_Vector
boolean
Controls how Elasticsearch dynamically adds fields to the inner object within the document.
To be used in combination withFieldType.Object
orFieldType.Nested
boolean
to be used in combination withFieldType.Dense_Vector
boolean
to be used in combination withFieldType.Object
boolean
marks this field to be excluded from the _source in Elasticsearch (https://www.elastic.co/guide/en/elasticsearch/reference/7.15/mapping-source-field.html#include-exclude)boolean
int
String[]
boolean
boolean
boolean
boolean
implemented as array to enable the empty default valueto be used in combination withFieldType.Dense_Vector
to be used in combination withFieldType.Dense_Vector
overrides the field type in the mapping which otherwise will be taken from correspondingFieldType
int
The name to be used to store the field inside the document.boolean
NOte that null_value setting are not supported in Elasticsearch for all types.String[]
int
boolean
to be used in combination withFieldType.Rank_Feature
double
boolean
boolean
when this field is a {String
}, a {Collection
} or a {Map
} that is empty this property controlls whether the empty value is sent to Elasticsearch.boolean
if true, the field will be stored in Elasticsearch even if it has a null valueAlias forname()
.
-
Element Details
-
value
Alias forname()
.- Since:
- 3.2
- Default:
- ""
-
name
The name to be used to store the field inside the document. If not set, the name of the annotated property is used.- Since:
- 3.2
- Default:
- ""
-
type
FieldType type- Default:
- Auto
-
index
boolean index- Default:
- true
-
format
DateFormat[] format- Default:
- {date_optional_time, epoch_millis}
-
pattern
String[] pattern- Default:
- {}
-
store
boolean store- Default:
- false
-
fielddata
boolean fielddata- Default:
- false
-
searchAnalyzer
String searchAnalyzer- Default:
- ""
-
analyzer
String analyzer- Default:
- ""
-
normalizer
String normalizer- Default:
- ""
-
ignoreFields
String[] ignoreFields- Default:
- {}
-
includeInParent
boolean includeInParent- Default:
- false
-
copyTo
String[] copyTo- Default:
- {}
-
ignoreAbove
int ignoreAbove- Since:
- 4.0
- Default:
- -1
-
coerce
boolean coerce- Since:
- 4.0
- Default:
- true
-
docValues
boolean docValues- Since:
- 4.0
- Default:
- true
-
ignoreMalformed
boolean ignoreMalformed- Since:
- 4.0
- Default:
- false
-
indexOptions
IndexOptions indexOptions- Since:
- 4.0
- Default:
- none
-
indexPhrases
boolean indexPhrases- Since:
- 4.0
- Default:
- false
-
indexPrefixes
IndexPrefixes[] indexPrefixesimplemented as array to enable the empty default value- Since:
- 4.0
- Default:
- {}
-
norms
boolean norms- Since:
- 4.0
- Default:
- true
-
nullValue
String nullValueNOte that null_value setting are not supported in Elasticsearch for all types. For example setting a null_value on a field with type text will throw an exception in the server when the mapping is written to Elasticsearch. Alas, the Elasticsearch documentation does not specify on which types it is allowed on which it is not.- Since:
- 4.0
- Default:
- ""
-
positionIncrementGap
int positionIncrementGap- Since:
- 4.0
- Default:
- -1
-
similarity
String similarity- Since:
- 4.0
- Default:
- "default"
-
termVector
TermVector termVector- Since:
- 4.0
- Default:
- none
-
scalingFactor
double scalingFactor- Since:
- 4.0
- Default:
- 1.0
-
maxShingleSize
int maxShingleSize- Since:
- 4.0
- Default:
- -1
-
storeNullValue
boolean storeNullValueif true, the field will be stored in Elasticsearch even if it has a null value- Since:
- 4.1
- Default:
- false
-
positiveScoreImpact
boolean positiveScoreImpactto be used in combination withFieldType.Rank_Feature
- Since:
- 4.1
- Default:
- true
-
enabled
boolean enabledto be used in combination withFieldType.Object
- Since:
- 4.1
- Default:
- true
-
eagerGlobalOrdinals
boolean eagerGlobalOrdinals- Since:
- 4.1
- Default:
- false
-
nullValueType
NullValueType nullValueType- Since:
- 4.1
- Default:
- String
-
dims
int dimsto be used in combination withFieldType.Dense_Vector
- Since:
- 4.2
- Default:
- -1
-
elementType
String elementTypeto be used in combination withFieldType.Dense_Vector
- Since:
- 5.4
- Default:
- ""
-
knnSimilarity
KnnSimilarity knnSimilarityto be used in combination withFieldType.Dense_Vector
- Since:
- 5.4
- Default:
- DEFAULT
-
knnIndexOptions
KnnIndexOptions[] knnIndexOptionsto be used in combination withFieldType.Dense_Vector
- Since:
- 5.4
- Default:
- {}
-
dynamic
Dynamic dynamicControls how Elasticsearch dynamically adds fields to the inner object within the document.
To be used in combination withFieldType.Object
orFieldType.Nested
- Since:
- 4.3
- Default:
- INHERIT
-
excludeFromSource
boolean excludeFromSourcemarks this field to be excluded from the _source in Elasticsearch (https://www.elastic.co/guide/en/elasticsearch/reference/7.15/mapping-source-field.html#include-exclude)- Since:
- 4.3
- Default:
- false
-
storeEmptyValue
boolean storeEmptyValuewhen this field is a {String
}, a {Collection
} or a {Map
} that is empty this property controlls whether the empty value is sent to Elasticsearch.- Since:
- 5.1
- Default:
- true
-
mappedTypeName
String mappedTypeNameoverrides the field type in the mapping which otherwise will be taken from correspondingFieldType
- Since:
- 5.4
- Default:
- ""
-