elasticsearch/docs/reference/query-dsl/span-first-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

25 lines
552 B
Text

[[query-dsl-span-first-query]]
=== Span first query
++++
<titleabbrev>Span first</titleabbrev>
++++
Matches spans near the beginning of a field. Here is an example:
[source,console]
--------------------------------------------------
GET /_search
{
"query": {
"span_first": {
"match": {
"span_term": { "user.id": "kimchy" }
},
"end": 3
}
}
}
--------------------------------------------------
The `match` clause can be any other span type query. The `end` controls
the maximum end position permitted in a match.