[[mapping-types]] == Field data types Each field has a _field data type_, or _field type_. This type indicates the kind of data the field contains, such as strings or boolean values, and its intended use. For example, you can index strings to both `text` and `keyword` fields. However, `text` field values are <> for full-text search while `keyword` strings are left as-is for filtering and sorting. Field types are grouped by _family_. Types in the same family have exactly the same search behavior but may have different space usage or performance characteristics. Currently, there are two type families, `keyword` and `text`. Other type families have only a single field type. For example, the `boolean` type family consists of one field type: `boolean`. [discrete] [[_core_datatypes]] ==== Common types <>:: Binary value encoded as a Base64 string. <>:: `true` and `false` values. <>:: The keyword family, including `keyword`, `constant_keyword`, and `wildcard`. <>:: Numeric types, such as `long` and `double`, used to express amounts. Dates:: Date types, including <> and <>. <>:: Defines an alias for an existing field. [discrete] [[object-types]] ==== Objects and relational types <>:: A JSON object. <>:: An entire JSON object as a single field value. <>:: A JSON object that preserves the relationship between its subfields. <>:: Defines a parent/child relationship for documents in the same index. <>:: Provides aliases for sub-fields at the same level. [discrete] [[structured-data-types]] ==== Structured data types <>:: Range types, such as `long_range`, `double_range`, `date_range`, and `ip_range`. <>:: IPv4 and IPv6 addresses. <>:: Software versions. Supports https://semver.org/[Semantic Versioning] precedence rules. {plugins}/mapper-murmur3.html[`murmur3`]:: Compute and stores hashes of values. [discrete] [[aggregated-data-types]] ==== Aggregate data types <>:: Pre-aggregated metric values. <>:: Pre-aggregated numerical values in the form of a histogram. [discrete] [[text-search-types]] ==== Text search types <>:: The text family, including `text` and `match_only_text`. Analyzed, unstructured text. {plugins}/mapper-annotated-text.html[`annotated-text`]:: Text containing special markup. Used for identifying named entities. <>:: Used for auto-complete suggestions. <>:: `text`-like type for as-you-type completion. <>:: Used for performing <>. <>:: A count of tokens in a text. [discrete] [[document-ranking-types]] ==== Document ranking types <>:: Records dense vectors of float values. <>:: Records sparse vectors of float values. <>:: Records a numeric feature to boost hits at query time. <>:: Records numeric features to boost hits at query time. [discrete] [[spatial_datatypes]] ==== Spatial data types <>:: Latitude and longitude points. <>:: Complex shapes, such as polygons. <>:: Arbitrary cartesian points. <>:: Arbitrary cartesian geometries. [discrete] [[other-types]] ==== Other types <>:: Indexes queries written in <>. [discrete] [[types-array-handling]] === Arrays In {es}, 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 field type. See <>. [discrete] [[types-multi-fields]] === 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 <>, the <> analyzer, and the <>. This is the purpose of _multi-fields_. Most field types support multi-fields via the <> parameter. include::types/aggregate-metric-double.asciidoc[] include::types/alias.asciidoc[] include::types/array.asciidoc[] include::types/binary.asciidoc[] include::types/boolean.asciidoc[] include::types/completion.asciidoc[] include::types/date.asciidoc[] include::types/date_nanos.asciidoc[] include::types/dense-vector.asciidoc[] include::types/flattened.asciidoc[] include::types/geo-point.asciidoc[] include::types/geo-shape.asciidoc[] include::types/histogram.asciidoc[] include::types/ip.asciidoc[] include::types/parent-join.asciidoc[] include::types/keyword.asciidoc[] include::types/nested.asciidoc[] include::types/numeric.asciidoc[] include::types/object.asciidoc[] include::types/passthrough.asciidoc[] include::types/percolator.asciidoc[] include::types/point.asciidoc[] include::types/range.asciidoc[] include::types/rank-feature.asciidoc[] include::types/rank-features.asciidoc[] include::types/search-as-you-type.asciidoc[] include::types/semantic-text.asciidoc[] include::types/shape.asciidoc[] include::types/sparse-vector.asciidoc[] include::types/text.asciidoc[] include::types/token-count.asciidoc[] include::types/unsigned_long.asciidoc[] include::types/version.asciidoc[]