Skip to content

[DOCS] Clarify array is not a field datatype #43931

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions docs/reference/mapping/types.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ string:: <<text,`text`>> and <<keyword,`keyword`>>

[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

Expand Down Expand Up @@ -56,6 +54,12 @@ string:: <<text,`text`>> and <<keyword,`keyword`>>

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

[float]
[[types-array-handling]]
=== Arrays
In {es}, arrays do not require a dedicated field datatype. Any field can contain
zero or more values by default, however, all values in the array must be of the
same datatype. See <<array>>.

[float]
=== Multi-fields
Expand Down
9 changes: 5 additions & 4 deletions docs/reference/mapping/types/array.asciidoc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[[array]]
=== Array datatype
=== Arrays

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

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

[[multi-value-fields-inverted-index]]
.Multi-value fields and the inverted index
****************************************************
Expand Down
2 changes: 2 additions & 0 deletions docs/reference/mapping/types/text.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ PUT my_index
--------------------------------
// CONSOLE

[[text-multi-fields]]
==== Use a field as both text and keyword
Sometimes it is useful to have both a full text (`text`) and a keyword
(`keyword`) version of the same field: one for full text search and the
other for aggregations and sorting. This can be achieved with
Expand Down