Skip to content

Commit 49350dd

Browse files
authored
[DOCS] Reorg field data types page (#61117)
1 parent 904c866 commit 49350dd

File tree

2 files changed

+86
-43
lines changed

2 files changed

+86
-43
lines changed

docs/reference/mapping/types.asciidoc

Lines changed: 81 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,115 @@
11
[[mapping-types]]
22
== Field data types
33

4-
Elasticsearch supports a number of different data types for the fields in a
5-
document:
4+
Each field has a _field data type_, or _field type_. This type indicates the
5+
kind of data the field contains, such as strings or boolean values, and its
6+
intended use. For example, you can index strings to both `text` and `keyword`
7+
fields. However, `text` field values are <<analysis,analyzed>> for full-text
8+
search while `keyword` strings are left as-is for filtering and sorting.
9+
10+
Field types are grouped by _family_. Types in the same family support the same
11+
search functionality but may have different space usage or performance
12+
characteristics.
13+
14+
Currently, the only type family is `keyword`, which consists of the `keyword`,
15+
`constant_keyword`, and `wildcard` field types. Other type families have only a
16+
single field type. For example, the `boolean` type family consists of one field
17+
type: `boolean`.
18+
619

720
[discrete]
821
[[_core_datatypes]]
9-
=== Core data types
22+
==== Common types
23+
24+
<<binary,`binary`>>:: Binary value encoded as a Base64 string.
25+
<<boolean,`boolean`>>:: `true` and `false` values.
26+
Keyword:: The keyword family, including <<keyword, `keyword`>>,
27+
<<constant-keyword,`constant_keyword`>>, and
28+
<<wildcard, `wildcard`>>.
29+
<<number,Numbers>>:: Numeric types, such as `long` and `double`, used to
30+
express amounts.
31+
Dates:: Date types, including <<date,`date`>> and
32+
<<date_nanos,`date_nanos`>>.
33+
<<alias,`alias`>>:: Defines an alias for an existing field.
1034

11-
string:: <<text,`text`>>, <<keyword,`keyword`>> and <<wildcard,`wildcard`>>
12-
<<number>>:: `long`, `integer`, `short`, `byte`, `double`, `float`, `half_float`, `scaled_float`
13-
<<date>>:: `date`
14-
<<date_nanos>>:: `date_nanos`
15-
<<boolean>>:: `boolean`
16-
<<binary>>:: `binary`
17-
<<range>>:: `integer_range`, `float_range`, `long_range`, `double_range`, `date_range`, `ip_range`
1835

1936
[discrete]
20-
=== Complex data types
21-
<<object>>:: `object` for single JSON objects
22-
<<nested>>:: `nested` for arrays of JSON objects
37+
[[object-types]]
38+
==== Objects and relational types
39+
40+
<<object,`object`>>:: A JSON object.
41+
<<flattened,`flattened`>>:: An entire JSON object as a single field value.
42+
<<nested,`nested`>>:: A JSON object that preserves the relationship
43+
between its subfields.
44+
<<parent-join,`join`>>:: Defines a parent/child relationship for documents
45+
in the same index.
46+
2347

2448
[discrete]
25-
[[spatial_datatypes]]
26-
=== Spatial data types
49+
[[structured-data-types]]
50+
==== Structured data types
51+
52+
<<range,Range>>:: Range types, such as `long_range`, `double_range`,
53+
`date_range`, and `ip_range`.
54+
<<ip,`ip`>>:: IPv4 and IPv6 addresses.
55+
{plugins}/mapper-murmur3.html[`murmur3`]:: Compute and stores hashes of
56+
values.
2757

28-
<<geo-point>>:: `geo_point` for lat/lon points
29-
<<geo-shape>>:: `geo_shape` for complex shapes like polygons
30-
<<point>>:: `point` for arbitrary cartesian points.
31-
<<shape>>:: `shape` for arbitrary cartesian geometries.
3258

3359
[discrete]
34-
=== Specialised data types
60+
[[aggregated-data-types]]
61+
==== Aggregate data types
3562

36-
<<ip>>:: `ip` for IPv4 and IPv6 addresses
37-
<<completion-suggester,Completion data type>>::
38-
`completion` to provide auto-complete suggestions
63+
<<histogram,`histogram`>>:: Pre-aggregated numerical values.
3964

40-
<<token-count>>:: `token_count` to count the number of tokens in a string
41-
{plugins}/mapper-murmur3.html[`mapper-murmur3`]:: `murmur3` to compute hashes of values at index-time and store them in the index
42-
{plugins}/mapper-annotated-text.html[`mapper-annotated-text`]:: `annotated-text` to index text containing special markup (typically used for identifying named entities)
4365

44-
<<percolator>>:: Accepts queries from the query-dsl
66+
[discrete]
67+
[[text-search-types]]
68+
==== Text search types
4569

46-
<<parent-join>>:: Defines parent/child relation for documents within the same index
70+
<<text,`text`>>:: Analyzed, unstructured text.
71+
{plugins}/mapper-annotated-text.html[`annotated-text`]:: Text containing special
72+
markup. Used for identifying named entities.
73+
<<completion-suggester,`completion`>>:: Used for auto-complete suggestions.
74+
<<search-as-you-type,`search_as_you_type`>>:: `text`-like type for
75+
as-you-type completion.
76+
<<token-count,`token_count`>>:: A count of tokens in a text.
4777

48-
<<rank-feature>>:: Record numeric feature to boost hits at query time.
4978

50-
<<rank-features>>:: Record numeric features to boost hits at query time.
79+
[discrete]
80+
[[document-ranking-types]]
81+
==== Document ranking types
5182

52-
<<dense-vector>>:: Record dense vectors of float values.
83+
<<dense-vector,`dense_vector`>>:: Records dense vectors of float values.
84+
<<rank-feature,`rank_feature`>>:: Records a numeric feature to boost hits at
85+
query time.
86+
<<rank-features,`rank_features`>>:: Records numeric features to boost hits at
87+
query time.
5388

54-
<<search-as-you-type>>:: A text-like field optimized for queries to implement as-you-type completion
5589

56-
<<alias>>:: Defines an alias to an existing field.
90+
[discrete]
91+
[[spatial_datatypes]]
92+
==== Spatial data types
5793

58-
<<flattened>>:: Allows an entire JSON object to be indexed as a single field.
94+
<<geo-point,`geo_point`>>:: Latitude and longitude points.
95+
<<geo-shape,`geo_shape`>>:: Complex shapes, such as polygons.
96+
<<point,`point`>>:: Arbitrary cartesian points.
97+
<<shape,`shape`>>:: Arbitrary cartesian geometries.
98+
99+
100+
[discrete]
101+
[[other-types]]
102+
==== Other types
59103

60-
<<histogram>>:: `histogram` for pre-aggregated numerical values for percentiles aggregations.
104+
<<percolator,`percolator`>>:: Indexes queries written in <<query-dsl,Query DSL>>.
61105

62-
<<constant-keyword>>:: Specialization of `keyword` for the case when all documents have the same value.
63106

64107
[discrete]
65108
[[types-array-handling]]
66109
=== Arrays
67110
In {es}, arrays do not require a dedicated field data type. Any field can contain
68111
zero or more values by default, however, all values in the array must be of the
69-
same data type. See <<array>>.
112+
same field type. See <<array>>.
70113

71114
[discrete]
72115
=== Multi-fields
@@ -79,7 +122,7 @@ the <<analysis-standard-analyzer,`standard` analyzer>>, the
79122
<<english-analyzer,`english`>> analyzer, and the
80123
<<french-analyzer,`french` analyzer>>.
81124

82-
This is the purpose of _multi-fields_. Most data types support multi-fields
125+
This is the purpose of _multi-fields_. Most field types support multi-fields
83126
via the <<multi-fields>> parameter.
84127

85128
include::types/alias.asciidoc[]

docs/reference/search/field-caps.asciidoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ query rewrites to `match_none` on every shard.
7676

7777

7878
The types used in the response describe _families_ of field types.
79-
Normally a family type is the same as the field type declared in the mapping,
79+
Normally a type family is the same as the field type declared in the mapping,
8080
but to simplify matters certain field types that behave identically are
81-
described using a family type. For example, `keyword`, `constant_keyword` and `wildcard`
82-
field types are all described as the `keyword` family type.
81+
described using a type family. For example, `keyword`, `constant_keyword` and `wildcard`
82+
field types are all described as the `keyword` type family.
8383

8484

8585

@@ -90,8 +90,8 @@ field types are all described as the `keyword` family type.
9090
Whether this field can be aggregated on all indices.
9191

9292
`indices`::
93-
The list of indices where this field has the same family type, or null if all indices
94-
have the same family type for the field.
93+
The list of indices where this field has the same type family, or null if all indices
94+
have the same type family for the field.
9595

9696
`non_searchable_indices`::
9797
The list of indices where this field is not searchable, or null if all indices

0 commit comments

Comments
 (0)