span-first-query.asciidoc 539 B

1234567891011121314151617181920
  1. [[query-dsl-span-first-query]]
  2. === Span First Query
  3. Matches spans near the beginning of a field. The span first query maps
  4. to Lucene `SpanFirstQuery`. Here is an example:
  5. [source,js]
  6. --------------------------------------------------
  7. {
  8. "span_first" : {
  9. "match" : {
  10. "span_term" : { "user" : "kimchy" }
  11. },
  12. "end" : 3
  13. }
  14. }
  15. --------------------------------------------------
  16. The `match` clause can be any other span type query. The `end` controls
  17. the maximum end position permitted in a match.