[[mapping-types]]
== Field datatypes

Elasticsearch supports a number of different datatypes for the fields in a
document:

[float]
=== Core datatypes

string::        <<text,`text`>> and <<keyword,`keyword`>>
<<number>>::    `long`, `integer`, `short`, `byte`, `double`, `float`
<<date>>::      `date`
<<boolean>>::   `boolean`
<<binary>>::    `binary`

[float]
=== Complex datatypes

<<array>>::     Array support does not require a dedicated `type`
<<object>>::    `object` for single JSON objects
<<nested>>::    `nested` for arrays of JSON objects

[float]
=== Geo datatypes

<<geo-point>>::     `geo_point` for lat/lon points
<<geo-shape>>::     `geo_shape` for complex shapes like polygons

[float]
=== Specialised datatypes

<<ip>>::            `ip` for IPv4 and IPv6 addresses
<<search-suggesters-completion,Completion datatype>>::
                    `completion` to provide auto-complete suggestions
<<token-count>>::   `token_count` to count the number of tokens in a string
{plugins}/mapper-size.html[`mapper-murmur3`]:: `murmur3` to compute hashes of values at index-time and store them in the index

Attachment datatype::

    See the {plugins}/mapper-attachments.html[`mapper-attachments`] plugin
    which supports indexing `attachments` like Microsoft Office formats, Open
    Document formats, ePub, HTML, etc. into an `attachment` datatype.

<<percolator>>::    Accepts queries from the query-dsl

[float]
=== Multi-fields

It is often useful to index the same field in different ways for different
purposes. For instance, a `string` field could be mapped as
a `text` field for full-text search, and as a `keyword` field for
sorting or aggregations.  Alternatively, you could index a text field with
the <<analysis-standard-analyzer,`standard` analyzer>>, the
<<english-analyzer,`english`>> analyzer, and the
<<french-analyzer,`french` analyzer>>.

This is the purpose of _multi-fields_.  Most datatypes support multi-fields
via the <<multi-fields>> parameter.

include::types/array.asciidoc[]

include::types/binary.asciidoc[]

include::types/boolean.asciidoc[]

include::types/date.asciidoc[]

include::types/geo-point.asciidoc[]

include::types/geo-shape.asciidoc[]

include::types/ip.asciidoc[]

include::types/keyword.asciidoc[]

include::types/nested.asciidoc[]

include::types/numeric.asciidoc[]

include::types/object.asciidoc[]

include::types/string.asciidoc[]

include::types/text.asciidoc[]

include::types/token-count.asciidoc[]

include::types/percolator.asciidoc[]






