I am trying to OR together two clauses in a single query but I am seeing some strange behavior and am looking for guidance
Given and index index1 with two documents -
{"column1": "A"} with _id=1
{"column1": "B"} with _id=2
When run a POST index1/_search with following body -
{"query": {
"bool": {
"minimum_should_match": 1,
"should": [
{
"bool": {
"must": [
{"term": {"_id": "1"}},
{"term": {"column1": "A"}}
]
}
},
{
"bool": {
"must": [
{"term": {"_id": "2"}},
{"term": {"column1": "B"}}
]
}
}
]
}
}}
I get no results. What I was expecting was both documents to be returned. If I remove one of the column1 term matches, I will get the other document. if I remove both column1 term matches I get both documents?
What am I doing wrong?