OpenSearch/docs/reference/query-dsl/span-first-query.asciidoc
Isabel Drost-Fromm e486560ea8 Add Autosense annotation for query dsl testing
this adds the autosense annotation to a couple of query dsl
docs files and fixes the snippets to work in the tests along
the way.
2016-05-10 11:54:48 +02:00

25 lines
582 B
Plaintext

[[query-dsl-span-first-query]]
=== Span First Query
Matches spans near the beginning of a field. The span first query maps
to Lucene `SpanFirstQuery`. Here is an example:
[source,js]
--------------------------------------------------
GET /_search
{
"query": {
"span_first" : {
"match" : {
"span_term" : { "user" : "kimchy" }
},
"end" : 3
}
}
}
--------------------------------------------------
// AUTOSENSE
The `match` clause can be any other span type query. The `end` controls
the maximum end position permitted in a match.