span-containing-query.asciidoc 877 B

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