I am trying to make a query in elastic search that will do the following: I want it to check for a result that has (metropolitan_area of 16 AND starts_at of 05072013) OR (metropolitan_id of 16 AND starts_at "blank".
This is my current query, but I feel like it needs to be nested somehow and I am unsure how to do that.
{
"query" : {
"bool" : {
"must" : [
{
"term" : {"user" : "a"}
},
{
"term" :{"metropolitan_area" : "16"}
}
],
"must_not" : [],
"should" : []
}
},
"filter" : {
"or" : {
"filters" : [
{
"term" : {"user":"519"}
},
{
"term" : {"user":"6"}
},
{
"term" : {"user":"5"}
},
{
"term" : {"user":"36"}
},
{
"term" : {"starts_at":"05072013"}
},
{
"term" : {"starts_at":"blank"}
}
]
}
}
}