[[java-query-dsl-span-first-query]]
==== Span First Query

See {ref}/query-dsl-span-first-query.html[Span First Query]

[source,java]
--------------------------------------------------
QueryBuilder qb = spanFirstQuery(
    spanTermQuery("user", "kimchy"),            <1>
    3                                           <2>
);
--------------------------------------------------
<1> query
<2> max end position

