elasticsearch/docs/reference/query-dsl/span-containing-query.asciidoc
Mayya Sharipova d6c53e03d2
Improve span queries documentation (#103490)
Improvement includes:
1. Remove reference to Lucene queries (this information is not necessary
for Elastic users, and can be outdated)
2. For `span_field_masking` include a node to use
"require_field_match" : false parameter for highlighters to work.

Closes #101804
2023-12-19 14:51:19 -05:00

34 lines
813 B
Text

[[query-dsl-span-containing-query]]
=== Span containing query
++++
<titleabbrev>Span containing</titleabbrev>
++++
Returns matches which enclose another span query. Here is an example:
[source,console]
--------------------------------------------------
GET /_search
{
"query": {
"span_containing": {
"little": {
"span_term": { "field1": "foo" }
},
"big": {
"span_near": {
"clauses": [
{ "span_term": { "field1": "bar" } },
{ "span_term": { "field1": "baz" } }
],
"slop": 5,
"in_order": true
}
}
}
}
}
--------------------------------------------------
The `big` and `little` clauses can be any span type query. Matching
spans from `big` that contain matches from `little` are returned.