Very simple!
You are to created a nested type of mapping for "objs" field.
You can check more info here: https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html
- First you have create a nested field:
PUT /my_index/_mapping
{
"properties": {
"objs": {
"type": "nested"
}
}
}
-
Then you add an object normally as if you didn´t had this mapping
-
Now you just make a query of nested type:
GET my_index/_search
{
"query": {
"nested": {
"path": "objs",
"query": {
"bool": {
"must": [
{ "match": { "objs.name": "car" }},
{ "match": { "objs.price": "6000" }}
]
}
}
}
}
}