mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-24 23:27:25 -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
25 lines
552 B
Text
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.
|