Skip to content

Commit 414bbc5

Browse files
committed
[DOCS] Clarify array is not a field datatype
1 parent e514966 commit 414bbc5

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

docs/reference/mapping/types.asciidoc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ string:: <<text,`text`>> and <<keyword,`keyword`>>
1717

1818
[float]
1919
=== Complex datatypes
20-
21-
<<array>>:: Array support does not require a dedicated `type`
2220
<<object>>:: `object` for single JSON objects
2321
<<nested>>:: `nested` for arrays of JSON objects
2422

@@ -56,6 +54,10 @@ string:: <<text,`text`>> and <<keyword,`keyword`>>
5654

5755
<<flattened>>:: Allows an entire JSON object to be indexed as a single field.
5856

57+
[float]
58+
[[types-array-handling]]
59+
=== Array handling
60+
In {es}, arrays do not require a dedicated field datatype. See <<array>>.
5961

6062
[float]
6163
=== Multi-fields
@@ -73,8 +75,6 @@ via the <<multi-fields>> parameter.
7375

7476
include::types/alias.asciidoc[]
7577

76-
include::types/array.asciidoc[]
77-
7878
include::types/binary.asciidoc[]
7979

8080
include::types/range.asciidoc[]
@@ -118,3 +118,5 @@ include::types/dense-vector.asciidoc[]
118118
include::types/sparse-vector.asciidoc[]
119119

120120
include::types/search-as-you-type.asciidoc[]
121+
122+
include::types/array.asciidoc[]

docs/reference/mapping/types/array.asciidoc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[[array]]
2-
=== Array datatype
2+
=== Array handling
33

4-
In Elasticsearch, there is no dedicated `array` type. Any field can contain
5-
zero or more values by default, however, all values in the array must be of
6-
the same datatype. For instance:
4+
In Elasticsearch, there is no dedicated `array` datatype. Any field can contain
5+
zero or more values by default, however, all values in the array must be of the
6+
same datatype. For instance:
77

88
* an array of strings: [ `"one"`, `"two"` ]
99
* an array of integers: [ `1`, `2` ]
@@ -81,6 +81,7 @@ GET my_index/_search
8181
<3> The second document contains no arrays, but can be indexed into the same fields.
8282
<4> The query looks for `elasticsearch` in the `tags` field, and matches both documents.
8383

84+
[[multi-value-fields-inverted-index]]
8485
.Multi-value fields and the inverted index
8586
****************************************************
8687

docs/reference/mapping/types/numeric.asciidoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ to help make a decision.
7878
|`half_float`|+2^-24^+ |+65504+ |+11+ / +3.31+
7979
|=======================================================================
8080

81+
[[number-array]]
82+
==== Array handling for numeric fields
83+
You can use a numeric field to store an array of numbers. However, all values in
84+
the array must be of the same datatype. See <<array>>.
85+
8186
[[number-params]]
8287
==== Parameters for numeric fields
8388

docs/reference/mapping/types/text.asciidoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ PUT my_index
3030
--------------------------------
3131
// CONSOLE
3232

33+
[[text-array]]
34+
==== Array handling for text fields
35+
You can use a `text` field to store an array of strings. See <<array>>.
36+
37+
[[text-multi-fields]]
38+
==== Use a field as both text and keyword
3339
Sometimes it is useful to have both a full text (`text`) and a keyword
3440
(`keyword`) version of the same field: one for full text search and the
3541
other for aggregations and sorting. This can be achieved with

0 commit comments

Comments
 (0)