summaryrefslogtreecommitdiff
path: root/docs/reference/query-dsl/queries/span-first-query.asciidoc
diff options
context:
space:
mode:
Diffstat (limited to 'docs/reference/query-dsl/queries/span-first-query.asciidoc')
-rw-r--r--docs/reference/query-dsl/queries/span-first-query.asciidoc20
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/reference/query-dsl/queries/span-first-query.asciidoc b/docs/reference/query-dsl/queries/span-first-query.asciidoc
new file mode 100644
index 0000000..74fe7ff
--- /dev/null
+++ b/docs/reference/query-dsl/queries/span-first-query.asciidoc
@@ -0,0 +1,20 @@
+[[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]
+--------------------------------------------------
+{
+ "span_first" : {
+ "match" : {
+ "span_term" : { "user" : "kimchy" }
+ },
+ "end" : 3
+ }
+}
+--------------------------------------------------
+
+The `match` clause can be any other span type query. The `end` controls
+the maximum end position permitted in a match.