Hello, I am trying to get a query where I can make a nested should without using nested fields.
Example:
GET index1/_search
{
"query": {
"bool": {
"should": [
{"term": {"name": "mike"}},
{"term": {"surname": "robison"}},
{"bool": {
"should": [
{"term": {"id": 1}},
{"term": {"country": "Italy"}}
]
}
}
]
}
}
}
With this query what I want is to search for documents with name mike or robison, from its results only return those with "id": 1 or "Italy".
It is giving me all the results as if it were, "mike" or "robison" or "id": 1 or "Italy".
The only solution I can think of is to separate the queries to remove a level of should.