Multi indices search with nested fields Multi indices search with nested fields elasticsearch elasticsearch

Multi indices search with nested fields


I think you need to use the indices query and to use a different query for each index. Something like this:

GET /questions,articles/_search{  "query": {    "bool": {      "must": [        {          "bool": {            "should": [              {                "indices": {                  "indices": [                    "questions"                  ],                  "query": {                    "nested": {                      "path": "answer",                      "query": {                        "term": {                          "text": "bla"                        }                      }                    }                  }                }              },              {                "match_all": {}              }            ]          }        },        {          "term": {            "some_common_field": {              "value": "whatever"            }          }        }      ]    }  }}