How can i make that query? is that a nested query?

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

  1. First you have create a nested field:

    PUT /my_index/_mapping
     {
        "properties": {
          "objs": {
            "type": "nested" 
          }
        }
      }
  1. Then you add an object normally as if you didn´t had this mapping

  2. 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" }} 
          ]
        }
      }
    }
  }
}
3 Likes