span-containing-query.asciidoc 863 B

1234567891011121314151617181920212223242526272829
  1. [[query-dsl-span-containing-query]]
  2. === Span Containing Query
  3. Returns matches which enclose another span query. The span containing
  4. query maps to Lucene `SpanContainingQuery`. Here is an example:
  5. [source,js]
  6. --------------------------------------------------
  7. {
  8. "span_containing" : {
  9. "little" : {
  10. "span_term" : { "field1" : "foo" }
  11. },
  12. "big" : {
  13. "span_near" : {
  14. "clauses" : [
  15. { "span_term" : { "field1" : "bar" } },
  16. { "span_term" : { "field1" : "baz" } }
  17. ],
  18. "slop" : 5,
  19. "in_order" : true
  20. }
  21. }
  22. }
  23. }
  24. --------------------------------------------------
  25. The `big` and `little` clauses can be any span type query. Matching
  26. spans from `big` that contain matches from `little` are returned.