Class ElasticsearchMappings
ElasticSearch automatically recognises array types so they are not explicitly mapped as such. For arrays of objects the type must be set to nested so the arrays are searched properly see https://www.elastic.co/guide/en/elasticsearch/guide/current/nested-objects.html
It is expected that indexes to which these mappings are applied have their
default analyzer set to "keyword", which does not tokenise fields. The
index-wide default analyzer cannot be set via these mappings, so needs to be
set in the index settings during index creation. For the results mapping the
_all field is disabled and a custom all field is used in its place. The index
settings must have "index.query.default_field": "all_field_values" set
for the queries to use the custom all field. The custom all field has its
analyzer set to "whitespace" by these mappings, so that it gets tokenised
using whitespace.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of the custom 'all' field for resultsstatic final Stringstatic final StringElasticsearch data typesstatic final StringThe configuration document typestatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringString constants used in mappingsstatic final StringName of the Elasticsearch field by which documents are sorted by defaultstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddDocMappingIfMissing(String alias, CheckedSupplier<String, IOException> mappingSupplier, Client client, ClusterState state, org.elasticsearch.core.TimeValue masterNodeTimeout, ActionListener<Boolean> listener, int minVersion)
-
Field Details
-
ENABLED
String constants used in mappings- See Also:
-
ANALYZER
- See Also:
-
WHITESPACE
- See Also:
-
NESTED
- See Also:
-
COPY_TO
- See Also:
-
PATH
- See Also:
-
PROPERTIES
- See Also:
-
TYPE
- See Also:
-
DYNAMIC
- See Also:
-
ALL_FIELD_VALUES
Name of the custom 'all' field for results- See Also:
-
ES_DOC
Name of the Elasticsearch field by which documents are sorted by default- See Also:
-
CONFIG_TYPE
The configuration document type- See Also:
-
BOOLEAN
Elasticsearch data types- See Also:
-
DATE
- See Also:
-
DOUBLE
- See Also:
-
INTEGER
- See Also:
-
KEYWORD
- See Also:
-
LONG
- See Also:
-
TEXT
- See Also:
-
-
Method Details
-
addDocMappingIfMissing
public static void addDocMappingIfMissing(String alias, CheckedSupplier<String, IOException> mappingSupplier, Client client, ClusterState state, org.elasticsearch.core.TimeValue masterNodeTimeout, ActionListener<Boolean> listener, int minVersion)
-