span-not-query.asciidoc 705 B

123456789101112131415161718192021222324
  1. [[query-dsl-span-not-query]]
  2. === Span Not Query
  3. Removes matches which overlap with another span query. The span not
  4. query maps to Lucene `SpanNotQuery`. Here is an example:
  5. [source,js]
  6. --------------------------------------------------
  7. {
  8. "span_not" : {
  9. "include" : {
  10. "span_term" : { "field1" : "value1" }
  11. },
  12. "exclude" : {
  13. "span_term" : { "field2" : "value2" }
  14. }
  15. }
  16. }
  17. --------------------------------------------------
  18. The `include` and `exclude` clauses can be any span type query. The
  19. `include` clause is the span query whose matches are filtered, and the
  20. `exclude` clause is the span query whose matches must not overlap those
  21. returned.