mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-25 07:37:19 -04:00
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
35 lines
808 B
Text
35 lines
808 B
Text
[[query-dsl-span-within-query]]
|
|
=== Span within query
|
|
++++
|
|
<titleabbrev>Span within</titleabbrev>
|
|
++++
|
|
|
|
Returns matches which are enclosed inside another span query.
|
|
Here is an example:
|
|
|
|
[source,console]
|
|
--------------------------------------------------
|
|
GET /_search
|
|
{
|
|
"query": {
|
|
"span_within": {
|
|
"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 `little` that are enclosed within `big` are returned.
|