Skip to content

Instantly share code, notes, and snippets.

@mattweber
Created February 22, 2012 21:36
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 mattweber/1887539 to your computer and use it in GitHub Desktop.
Save mattweber/1887539 to your computer and use it in GitHub Desktop.
NOT WITHIN queries in ElasticSearch
## For comment on
## http://www.romseysoftware.co.uk/2012/02/20/not-within-queries-lucene
##
{
"query":{
"span_not":{
"include": {
"span_term": {"FIELD":"fish"}
},
"exclude": {
"span_near": {
"clauses": [
{"span_term": {"FIELD":"fish"}},
{"span_term": {"FIELD":"chips"}}
],
"slop": 2,
"in_order": true
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment