I have year, month, and date split into different fields. To search
documents for specific dates (I have to retrieve in 7-day batches), I am
trying to use multiple "AND" clauses in a filter.
- The problem is that the query works fine with two "and" clauses, but as
soon as I add the third - it stops working and says: nested:
QueryParsingException[[mjm] [filtered] query does not support [and]];
"query" : {
"filtered" : {
"query" : {
"match_all" : {}
},
"filter" : {
"and" : [
{"term" : { "date.year" : "2011" }},
{"term" : { "date.month" : "5" }},
{"term" : { "date.date" : "1" }}
],
"and" : [
{"term" : { "date.year" : "2011" }},
{"term" : { "date.month" : "5" }},
{"term" : { "date.date" : "2" }}
],
"and" : [
{"term" : { "date.year" : "2011" }},
{"term" : { "date.month" : "5" }},
{"term" : { "date.date" : "3" }}
]
}
}
}
- Is there a more efficient method to do the above search?
Thanks