diff --git a/docs/reference/mapping/types.asciidoc b/docs/reference/mapping/types.asciidoc index ef6aae3f5b1..5ea6da315ad 100644 --- a/docs/reference/mapping/types.asciidoc +++ b/docs/reference/mapping/types.asciidoc @@ -1,74 +1,115 @@ [[mapping-types]] == Field data types -Elasticsearch supports a number of different data types for the fields in a -document: +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 support the same +search functionality but may have different space usage or performance +characteristics. + +Currently, the only type family is `keyword`, which consists of the `keyword`, +`constant_keyword`, and `wildcard` field types. Other type families have only a +single field type. For example, the `boolean` type family consists of one field +type: `boolean`. + [discrete] [[_core_datatypes]] -=== Core data types +==== Common types + +<>:: Binary value encoded as a Base64 string. +<>:: `true` and `false` values. +Keyword:: The keyword family, including <>, + <>, and + <>. +<>:: Numeric types, such as `long` and `double`, used to + express amounts. +Dates:: Date types, including <> and + <>. +<>:: Defines an alias for an existing field. -string:: <>, <> and <> -<>:: `long`, `integer`, `short`, `byte`, `double`, `float`, `half_float`, `scaled_float` -<>:: `date` -<>:: `date_nanos` -<>:: `boolean` -<>:: `binary` -<>:: `integer_range`, `float_range`, `long_range`, `double_range`, `date_range`, `ip_range` [discrete] -=== Complex data types -<>:: `object` for single JSON objects -<>:: `nested` for arrays of JSON objects +[[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. + + +[discrete] +[[structured-data-types]] +==== Structured data types + +<>:: Range types, such as `long_range`, `double_range`, + `date_range`, and `ip_range`. +<>:: IPv4 and IPv6 addresses. +{plugins}/mapper-murmur3.html[`murmur3`]:: Compute and stores hashes of +values. + + +[discrete] +[[aggregated-data-types]] +==== Aggregate data types + +<>:: Pre-aggregated numerical values. + + +[discrete] +[[text-search-types]] +==== Text search types + +<>:: 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. +<>:: A count of tokens in a text. + + +[discrete] +[[document-ranking-types]] +==== Document ranking types + +<>:: Records dense 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 +==== Spatial data types + +<>:: Latitude and longitude points. +<>:: Complex shapes, such as polygons. +<>:: Arbitrary cartesian points. +<>:: Arbitrary cartesian geometries. -<>:: `geo_point` for lat/lon points -<>:: `geo_shape` for complex shapes like polygons -<>:: `point` for arbitrary cartesian points. -<>:: `shape` for arbitrary cartesian geometries. [discrete] -=== Specialised data types +[[other-types]] +==== Other types -<>:: `ip` for IPv4 and IPv6 addresses -<>:: - `completion` to provide auto-complete suggestions +<>:: Indexes queries written in <>. -<>:: `token_count` to count the number of tokens in a string -{plugins}/mapper-murmur3.html[`mapper-murmur3`]:: `murmur3` to compute hashes of values at index-time and store them in the index -{plugins}/mapper-annotated-text.html[`mapper-annotated-text`]:: `annotated-text` to 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 - -<>:: Record numeric feature to boost hits at query time. - -<>:: Record numeric features to boost hits at query time. - -<>:: Record dense vectors of float values. - -<>:: 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. - -<>:: `histogram` for pre-aggregated numerical values for percentiles aggregations. - -<>:: Specialization of `keyword` for the case when all documents have the same value. [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 data type. See <>. +same field type. See <>. [discrete] === Multi-fields @@ -81,7 +122,7 @@ the <>, the <> analyzer, and the <>. -This is the purpose of _multi-fields_. Most data types support multi-fields +This is the purpose of _multi-fields_. Most field types support multi-fields via the <> parameter. include::types/alias.asciidoc[] diff --git a/docs/reference/search/field-caps.asciidoc b/docs/reference/search/field-caps.asciidoc index a4bc8eae30c..7754cf22b55 100644 --- a/docs/reference/search/field-caps.asciidoc +++ b/docs/reference/search/field-caps.asciidoc @@ -76,10 +76,10 @@ query rewrites to `match_none` on every shard. The types used in the response describe _families_ of field types. -Normally a family type is the same as the field type declared in the mapping, +Normally a type family is the same as the field type declared in the mapping, but to simplify matters certain field types that behave identically are -described using a family type. For example, `keyword`, `constant_keyword` and `wildcard` -field types are all described as the `keyword` family type. +described using a type family. For example, `keyword`, `constant_keyword` and `wildcard` +field types are all described as the `keyword` type family. @@ -90,8 +90,8 @@ field types are all described as the `keyword` family type. Whether this field can be aggregated on all indices. `indices`:: - The list of indices where this field has the same family type, or null if all indices - have the same family type for the field. + The list of indices where this field has the same type family, or null if all indices + have the same type family for the field. `non_searchable_indices`:: The list of indices where this field is not searchable, or null if all indices