Skip to content

Instantly share code, notes, and snippets.

@timwaters
Created December 19, 2012 12:48
Show Gist options
  • Save timwaters/4336435 to your computer and use it in GitHub Desktop.
Save timwaters/4336435 to your computer and use it in GitHub Desktop.
elasticsearch combining AND and OR - possible?
// (name.second == ba || name.second == po) && postdate ...
filter': {
'and': [
{
'or':[
{
"prefix" : { "name.second" : "ba" }
},
{
"prefix" : { "name.second" : "po" }
}
]
},
{
"range" : {
"postDate" : {
"from" : "2010-03-01",
"to" : "2010-04-01"
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment