The big difference between standard systems (SQL, but also many NoSQL technologies such as MongoDB, Riak, or CouchDB) and ElasticSearch is the number of facilities to express text queries.
The span query family is a group of queries that control a sequence of text tokens. They allow defining the following queries:
Exact phrase query
Exact fragment query (that is,
Take off
,give up
)Partial exact phrase with a
slop
parameter (other tokens between the searched terms, that is, "the man" with slop2
can also match "the strong man", "the old wise man", and so on)
For executing span queries, we need to perform the following steps:
The main element in span queries is the
span_term
parameter whose usage is similar to the term of standard query.One or more
span_term
parameters can be aggregated to formulate a span query.The
span_first
query defines a query in which thespan_term
parameter in the first token or near...