What does the JSON mapping look like if I have a field that is of type: keyword array.
If I wanted multiple keywords associated with a JSON document, how would I create the mapping for the index's field?
Something like:
"my_index" : {
"mappings" : {
"item": {
"properties" : {
"NickNames" : { "type" : "keyword array"}
}
}
}
}
Thanks!
1 Like
bram
(Bram)
March 13, 2019, 8:27pm
2
You can just use keyword.
In Elasticsearch every field is already an array, see the docs here:
Array support does not require a dedicated type
And you can set a single value or multiple values when indexing the documents:
{"nickNames": "foo"}
{"nickNames: ["foo"]}
{"nickNames: ["foo", "bar"]}
system
(system)
Closed
April 10, 2019, 8:27pm
3
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.