I need help regarding elastic search mapping of nested json document. I search in web a lot but didnt find any good to the point info. Suppose I have this type of data..
{
"name" : "Zach",
"car" : [
{
"make" : "Saturn",
"model" : "SL"
},
{
"make" : "Subaru",
"model" : "Imprezza"
}
]
}
{
"name" : "Bob",
"car" : [
{
"make" : "Saturn",
"model" : "Imprezza"
}
]
}
where car can have any number of data objects inside. According to the elastic search doc I came to know that for nested json I have to specify the type as nested. But there has no information regarding how I will specify the mapping info of variables under that nested type.
Like in the example above I can write the mapping like this.
{
"person":{
"properties":{
"name" : {
"type" : "string"
},
"car":{
"type" : "nested"
}
}
}
}
but how to provide mapping info for car.make
& car.model
??
Will this work fine without any future problem?
{
"person": {
"properties": {
"name" : {
"type" : "string"
},
"car": {
"type" : "nested"
"properties": {
"make": {....},
"model": {....}
}
}
}
}
}