Skip to content

Instantly share code, notes, and snippets.

@wjlroe
Last active August 14, 2022 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wjlroe/6938210 to your computer and use it in GitHub Desktop.
Save wjlroe/6938210 to your computer and use it in GitHub Desktop.
An (contrived) example of how you can combine a query (a prefix query in this case) with more than one filter
{
"query": {
"filtered": {
"query": {
"prefix": {"name": "Ms."}
},
"filter": {
"and": [
{"exists": { "field": "favourite_opera" }},
{"range": {"last_opera_attended": {"gte": 1357020000}}}
]
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment