Span containing query

Returns matches which enclose another span query. The span containing query maps to Lucene SpanContainingQuery. Here is an example:

  1. GET /_search
  2. {
  3. "query": {
  4. "span_containing": {
  5. "little": {
  6. "span_term": { "field1": "foo" }
  7. },
  8. "big": {
  9. "span_near": {
  10. "clauses": [
  11. { "span_term": { "field1": "bar" } },
  12. { "span_term": { "field1": "baz" } }
  13. ],
  14. "slop": 5,
  15. "in_order": true
  16. }
  17. }
  18. }
  19. }
  20. }

The big and little clauses can be any span type query. Matching spans from big that contain matches from little are returned.