mappings used
PUT kpal
{
"mappings": {
"_doc": {
"properties": {
"user": {
"type": "nested"
}
}
}
}
}
PUT kpal/_doc/1
{
"group" : "fans",
"user" : [
{
"first" : "John",
"last" : "Smith"
},
{
"first" : "Alice",
"last" : "White"
}
]
}
PUT kpal/_doc/2
{
"group" : "fans",
"user" : [
{
"first" : "John",
"last" : "Smith"
}
]
}
PUT kpal/_doc/3
{
"group" : "fans",
"user" : [
{
"first" : "John",
"last" : "Smith"
},
{
"first" : "Alice",
"last" : "White"
},
{
"first" : "Akbar",
"last" : "Jyothi"
}
]
}
In my kibana dashboard version 6.6.0
Now i want to create a new field using script field called "firstname"
my script field:
doc["user.first].value[1]
getting shards are failed
also tried
doc['user.first'][0] ,
params['_source']['user.first'][0] but same error
reference used:
-
here can we treat user.first behaves like array for each document ?
-
how can i access array of objects in the documents of an index ?
-
In saved search its showing objects in arrays are not well suported,how to resolve this issue ?