span-near-query.asciidoc 848 B

1234567891011121314151617181920212223242526
  1. [[query-dsl-span-near-query]]
  2. === Span Near Query
  3. Matches spans which are near one another. One can specify _slop_, the
  4. maximum number of intervening unmatched positions, as well as whether
  5. matches are required to be in-order. The span near query maps to Lucene
  6. `SpanNearQuery`. Here is an example:
  7. [source,js]
  8. --------------------------------------------------
  9. {
  10. "span_near" : {
  11. "clauses" : [
  12. { "span_term" : { "field" : "value1" } },
  13. { "span_term" : { "field" : "value2" } },
  14. { "span_term" : { "field" : "value3" } }
  15. ],
  16. "slop" : 12,
  17. "in_order" : false
  18. }
  19. }
  20. --------------------------------------------------
  21. The `clauses` element is a list of one or more other span type queries
  22. and the `slop` controls the maximum number of intervening unmatched
  23. positions permitted.