Span first query

Matches spans near the beginning of a field. The span first query maps to Lucene SpanFirstQuery. Here is an example:

  1. GET /_search
  2. {
  3. "query": {
  4. "span_first": {
  5. "match": {
  6. "span_term": { "user.id": "kimchy" }
  7. },
  8. "end": 3
  9. }
  10. }
  11. }

The match clause can be any other span type query. The end controls the maximum end position permitted in a match.