Elasticsearch supports a number of different data types for the fields in a document:
ipfor IPv4 and IPv6 addresses
- Completion data type
completionto provide auto-complete suggestions
- Token count
token_countto count the number of tokens in a string
murmur3to compute hashes of values at index-time and store them in the index
annotated-textto index text containing special markup (typically used for identifying named entities)
- Accepts queries from the query-dsl
- Defines parent/child relation for documents within the same index
- Rank feature
- Record numeric feature to boost hits at query time.
- Rank features
- Record numeric features to boost hits at query time.
- Dense vector
- Record dense vectors of float values.
- Sparse vector
- Record sparse vectors of float values.
- A text-like field optimized for queries to implement as-you-type completion
- Defines an alias to an existing field.
- Allows an entire JSON object to be indexed as a single field.
shapefor arbitrary cartesian geometries.
histogramfor pre-aggregated numerical values for percentiles aggregations.
- Constant keyword
keywordfor the case when all documents have the same value.
In Elasticsearch, arrays do not require a dedicated field data type. Any field can contain zero or more values by default, however, all values in the array must be of the same data type. See Arrays.
It is often useful to index the same field in different ways for different
purposes. For instance, a
string field could be mapped as
text field for full-text search, and as a
keyword field for
sorting or aggregations. Alternatively, you could index a text field with
standard analyzer, the
english analyzer, and the
This is the purpose of multi-fields. Most data types support multi-fields