How can I generate Query in elastic search for multiple boolean queries How can I generate Query in elastic search for multiple boolean queries elasticsearch elasticsearch

How can I generate Query in elastic search for multiple boolean queries


To be able to query Array inner object you should map your processedData as a Nested type, arrays of objects do not work as you would expect because you cannot query each object independently of the other objects in the array. If you need to be able to do this then you should use the nested data type instead of the object data type. After changing your mapping you can make a nested query with a bool query like this:

{  "query": {    "nested": {      "path": "processedData",      "query": {        "bool": {          "must": [            {              "match": {                "key": "n"              }            },            {              "match": {                "string_value": "xyz"              }            }          ]        }      }    }  }}

For more information you can check here: https://www.elastic.co/guide/en/elasticsearch/reference/master/array.html