Skip to content
Snippets Groups Projects
Commit d88c2e19 authored by Mantas Marcinkevičius's avatar Mantas Marcinkevičius Committed by Simonas Šerlinskas
Browse files

added documentation for span first query (#221)

parent f8ced7fb
No related branches found
No related tags found
No related merge requests found
Documentation in progress...
\ No newline at end of file
# Span First Query
> More info about Span First query is in the [official elasticsearch docs][1]
Matches spans near the beginning of a field. The span first query maps to Lucene SpanFirstQuery. Here is an example:
```JSON
{
"query": {
"span_first" : {
"match" : {
"span_term" : { "user" : "kimchy" }
},
"end" : 3
}
}
}
```
And now the query via DSL:
```php
$search = new Search();
$query = new SpanFirstQuery(new SpanTermQuery('user', 'kimchy'), 3);
$search->addQuery($query);
$search->toArray();
```
[1]: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-span-first-query.html
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment