Current version of ElasticSearch & Kibana 7.6.0
Hello folks! this is my template:
GET _template/my_template
"mappings" : {
"_meta" : { },
"_source" : { },
"properties" : {
"brands" : {
"type" : "nested",
"properties" : {
"assessment" : {
"type" : "float"
},
"quantity" : {
"type" : "integer"
},
"name" : {
"type" : "text"
},
"id" : {
"type" : "integer"
}
}
},
"taxonomies" : {
"type" : "nested",
"properties" : {
"path" : {
"type" : "text"
},
"assessment" : {
"type" : "float"
},
"quantity" : {
"type" : "integer"
},
"name" : {
"type" : "text"
},
"id" : {
"type" : "integer"
}
}
},
"categories" : {
"type" : "nested",
"properties" : {
"assessment" : {
"type" : "float"
},
"quantity" : {
"type" : "integer"
},
"name" : {
"type" : "text"
},
"id" : {
"type" : "integer"
}
}
},
"warehouse" : {
"type" : "object",
"properties" : {
"name" : {
"type" : "text"
},
"id" : {
"type" : "integer"
}
}
},
"assesment" : {
"type" : "float"
}
}
}
I tried to follow this guide Nested and this one Nested Query. I tried to use the same documents from example but nothing... It return all values. In my documents what I trying to get is all Brands with Id = 1, this is my query:
GET remake/_search
"_source": ["brands.name","brands.id"],
"query": {
"nested": {
"path": "brands",
"query": {
"bool": {
"must": [
{
"match": {
"brands.id": 1
}
}
]
}
}
}
}
}
This should return only brands with id = 1, but returns all values. Should I fix the template/mappings? Thanks!