| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 | [[java-span-queries]]=== Span queriesSpan queries are low-level positional queries which provide expert controlover the order and proximity of the specified terms. These are typically usedto implement very specific queries on legal documents or patents.Span queries cannot be mixed with non-span queries (with the exception of the `span_multi` query).The queries in this group are:<<java-query-dsl-span-term-query,`span_term` query>>::The equivalent of the <<java-query-dsl-term-query,`term` query>> but for use withother span queries.<<java-query-dsl-span-multi-term-query,`span_multi` query>>::Wraps a <<java-query-dsl-term-query,`term`>>, <<java-query-dsl-range-query,`range`>>,<<java-query-dsl-prefix-query,`prefix`>>, <<java-query-dsl-wildcard-query,`wildcard`>>,<<java-query-dsl-regexp-query,`regexp`>>, or <<java-query-dsl-fuzzy-query,`fuzzy`>> query.<<java-query-dsl-span-first-query,`span_first` query>>::Accepts another span query whose matches must appear within the first Npositions of the field.<<java-query-dsl-span-near-query,`span_near` query>>::Accepts multiple span queries whose matches must be within the specified distance of each other, and possibly in the same order.<<java-query-dsl-span-or-query,`span_or` query>>::Combines multiple span queries -- returns documents which match any of thespecified queries.<<java-query-dsl-span-not-query,`span_not` query>>::Wraps another span query, and excludes any documents which match that query.<<java-query-dsl-span-containing-query,`span_containing` query>>::Accepts a list of span queries, but only returns those spans which also match a second span query.<<java-query-dsl-span-within-query,`span_within` query>>::The result from a single span query is returned as long is its span fallswithin the spans returned by a list of other span queries.include::span-term-query.asciidoc[]include::span-multi-term-query.asciidoc[]include::span-first-query.asciidoc[]include::span-near-query.asciidoc[]include::span-or-query.asciidoc[]include::span-not-query.asciidoc[]include::span-containing-query.asciidoc[]include::span-within-query.asciidoc[]
 |