June 2017
Beginner to intermediate
404 pages
8h 22m
English
There is no special data type for an array. A field can contain one or more fields of the same data type. Let's look at an example where we have two documents, as shown next:
Document 1:
{ "keyword_field" : "keyword1" }
Document 2:
{ "keyword_field" : ["keyword2", "keyword3"]}
The mapping for keyword_field is defined as shown next:
{ "properties": { "keyword_field": { "type": "keyword" } } }
No special handling is required for arrays.
Read now
Unlock full access