WARNING: Version 2.4 of Elasticsearch has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
Field datatypesedit
Elasticsearch supports a number of different datatypes for the fields in a document:
Core datatypesedit
- String datatype
-
string - Numeric datatypes
-
long,integer,short,byte,double,float - Date datatype
-
date - Boolean datatype
-
boolean - Binary datatype
-
binary
Complex datatypesedit
- Array datatype
-
Array support does not require a dedicated
type - Object datatype
-
objectfor single JSON objects - Nested datatype
-
nestedfor arrays of JSON objects
Geo datatypesedit
- Geo-point datatype
-
geo_pointfor lat/lon points - Geo-Shape datatype
-
geo_shapefor complex shapes like polygons
Specialised datatypesedit
- IPv4 datatype
-
ipfor IPv4 addresses - Completion datatype
-
completionto provide auto-complete suggestions - Token count datatype
-
token_countto count the number of tokens in a string -
mapper-murmur3 -
murmur3to compute hashes of values at index-time and store them in the index - Attachment datatype
-
See the
mapper-attachmentsplugin which supports indexingattachmentslike Microsoft Office formats, Open Document formats, ePub, HTML, etc. into anattachmentdatatype.
Multi-fieldsedit
It is often useful to index the same field in different ways for different
purposes. For instance, a string field could be indexed as
an analyzed field for full-text search, and as a not_analyzed field for
sorting or aggregations. Alternatively, you could index a string field with
the standard analyzer, the
english analyzer, and the
french analyzer.
This is the purpose of multi-fields. Most datatypes support multi-fields
via the fields parameter.