Query DSL
Elasticsearch provides a full Java query dsl in a similar manner to the
REST {ref}/query-dsl.html[Query DSL]. The factory for query
builders is QueryBuilders
. Once your query is ready, you can use the
Search API.
To use QueryBuilders
just import them in your class:
import static org.elasticsearch.index.query.QueryBuilders.*;
Note that you can easily print (aka debug) JSON generated queries using
toString()
method on QueryBuilder
object.
The QueryBuilder
can then be used with any API that accepts a query,
such as count
and search
.
Match All Query
See {ref}/query-dsl-match-all-query.html[Match All Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[match_all]
Full text queries
The high-level full text queries are usually used for running full text
queries on full text fields like the body of an email. They understand how the
field being queried is analyzed and will apply each field’s
analyzer
(or search_analyzer
) to the query string before executing.
The queries in this group are:
match
query-
The standard query for performing full text queries, including fuzzy matching and phrase or proximity queries.
multi_match
query-
The multi-field version of the
match
query. common_terms
query-
A more specialized query which gives more preference to uncommon words.
query_string
query-
Supports the compact Lucene query string syntax, allowing you to specify AND|OR|NOT conditions and multi-field search within a single query string. For expert users only.
simple_query_string
-
A simpler, more robust version of the
query_string
syntax suitable for exposing directly to users.
Match Query
See {ref}/query-dsl-match-query.html[Match Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[match]
-
field
-
text
Multi Match Query
See {ref}/query-dsl-multi-match-query.html[Multi Match Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[multi_match]
-
text
-
fields
Common Terms Query
See {ref}/query-dsl-common-terms-query.html[Common Terms Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[common_terms]
-
field
-
value
Query String Query
See {ref}/query-dsl-query-string-query.html[Query String Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[query_string]
Simple Query String Query
See {ref}/query-dsl-simple-query-string-query.html[Simple Query String Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[simple_query_string]
Term level queries
While the full text queries will analyze the query string before executing, the term-level queries operate on the exact terms that are stored in the inverted index.
These queries are usually used for structured data like numbers, dates, and enums, rather than full text fields. Alternatively, they allow you to craft low-level queries, foregoing the analysis process.
The queries in this group are:
term
query-
Find documents which contain the exact term specified in the field specified.
terms
query-
Find documents which contain any of the exact terms specified in the field specified.
range
query-
Find documents where the field specified contains values (dates, numbers, or strings) in the range specified.
exists
query-
Find documents where the field specified contains any non-null value.
prefix
query-
Find documents where the field specified contains terms which being with the exact prefix specified.
wildcard
query-
Find documents where the field specified contains terms which match the pattern specified, where the pattern supports single character wildcards (
?
) and multi-character wildcards (*
) regexp
query-
Find documents where the field specified contains terms which match the regular expression specified.
fuzzy
query-
Find documents where the field specified contains terms which are fuzzily similar to the specified term. Fuzziness is measured as a Levenshtein edit distance of 1 or 2.
type
query-
Find documents of the specified type.
ids
query-
Find documents with the specified type and IDs.
Term Query
See {ref}/query-dsl-term-query.html[Term Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[term]
-
field
-
text
Terms Query
See {ref}/query-dsl-terms-query.html[Terms Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[terms]
-
field
-
values
Range Query
See {ref}/query-dsl-range-query.html[Range Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[range]
-
field
-
from
-
to
-
include lower value means that
from
isgt
whenfalse
orgte
whentrue
-
include upper value means that
to
islt
whenfalse
orlte
whentrue
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[range_simplified]
-
field
-
set
from
to 10 andincludeLower
totrue
-
set
to
to 20 andincludeUpper
tofalse
Exists Query
See {ref}/query-dsl-exists-query.html[Exists Query].
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[exists]
-
field
Prefix Query
See {ref}/query-dsl-prefix-query.html[Prefix Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[prefix]
-
field
-
prefix
Wildcard Query
See {ref}/query-dsl-wildcard-query.html[Wildcard Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[wildcard]
-
field
-
wildcard expression
Regexp Query
See {ref}/query-dsl-regexp-query.html[Regexp Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[regexp]
-
field
-
regexp
Fuzzy Query
See {ref}/query-dsl-fuzzy-query.html[Fuzzy Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[fuzzy]
-
field
-
text
Type Query
See {ref}/query-dsl-type-query.html[Type Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[type]
-
type
Ids Query
See {ref}/query-dsl-ids-query.html[Ids Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[ids]
-
type is optional
Compound queries
Compound queries wrap other compound or leaf queries, either to combine their results and scores, to change their behaviour, or to switch from query to filter context.
The queries in this group are:
constant_score
query-
A query which wraps another query, but executes it in filter context. All matching documents are given the same
`constant'' `_score
. bool
query-
The default query for combining multiple leaf or compound query clauses, as
must
,should
,must_not
, orfilter
clauses. Themust
andshould
clauses have their scores combined — the more matching clauses, the better — while themust_not
andfilter
clauses are executed in filter context. dis_max
query-
A query which accepts multiple queries, and returns any documents which match any of the query clauses. While the
bool
query combines the scores from all matching queries, thedis_max
query uses the score of the single best- matching query clause. function_score
query-
Modify the scores returned by the main query with functions to take into account factors like popularity, recency, distance, or custom algorithms implemented with scripting.
boosting
query-
Return documents which match a
positive
query, but reduce the score of documents which also match anegative
query.
Constant Score Query
See {ref}/query-dsl-constant-score-query.html[Constant Score Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[constant_score]
-
your query
-
query score ==== Bool Query
See {ref}/query-dsl-bool-query.html[Bool Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[bool]
-
must query
-
must not query
-
should query
-
a query that must appear in the matching documents but doesn’t contribute to scoring. ==== Dis Max Query
See {ref}/query-dsl-dis-max-query.html[Dis Max Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[dis_max]
-
add your queries
-
add your queries
-
boost factor
-
tie breaker ==== Function Score Query
See {ref}/query-dsl-function-score-query.html[Function Score Query].
To use ScoreFunctionBuilders
just import them in your class:
import static org.elasticsearch.index.query.functionscore.ScoreFunctionBuilders.*;
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[function_score]
-
Add a first function based on a query
-
And randomize the score based on a given seed
-
Add another function based on the age field ==== Boosting Query
See {ref}/query-dsl-boosting-query.html[Boosting Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[boosting]
-
query that will promote documents
-
query that will demote documents
-
negative boost
Joining queries
Performing full SQL-style joins in a distributed system like Elasticsearch is prohibitively expensive. Instead, Elasticsearch offers two forms of join which are designed to scale horizontally.
nested
query-
Documents may contains fields of type
nested
. These fields are used to index arrays of objects, where each object can be queried (with thenested
query) as an independent document. has_child
andhas_parent
queries-
A parent-child relationship can exist between two document types within a single index. The
has_child
query returns parent documents whose child documents match the specified query, while thehas_parent
query returns child documents whose parent document matches the specified query.
Nested Query
See {ref}/query-dsl-nested-query.html[Nested Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[nested]
-
path to nested document
-
your query. Any fields referenced inside the query must use the complete path (fully qualified).
-
score mode could be
ScoreMode.Max
,ScoreMode.Min
,ScoreMode.Total
,ScoreMode.Avg
orScoreMode.None
Has Child Query
See {ref}/query-dsl-has-child-query.html[Has Child Query]
When using the has_child
query it is important to use the PreBuiltTransportClient
instead of the regular client:
Settings settings = Settings.builder().put("cluster.name", "elasticsearch").build();
TransportClient client = new PreBuiltTransportClient(settings);
client.addTransportAddress(new TransportAddress(new InetSocketAddress(InetAddresses.forString("127.0.0.1"), 9300)));
Otherwise the parent-join module doesn’t get loaded and the has_child
query can’t be used from the transport client.
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[has_child]
-
child type to query against
-
query
-
score mode can be
ScoreMode.Avg
,ScoreMode.Max
,ScoreMode.Min
,ScoreMode.None
orScoreMode.Total
Has Parent Query
See {ref}/query-dsl-has-parent-query.html[Has Parent]
When using the has_parent
query it is important to use the PreBuiltTransportClient
instead of the regular client:
Settings settings = Settings.builder().put("cluster.name", "elasticsearch").build();
TransportClient client = new PreBuiltTransportClient(settings);
client.addTransportAddress(new TransportAddress(new InetSocketAddress(InetAddresses.forString("127.0.0.1"), 9300)));
Otherwise the parent-join module doesn’t get loaded and the has_parent
query can’t be used from the transport client.
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[has_parent]
-
parent type to query against
-
query
-
whether the score from the parent hit should propagate to the child hit
Geo queries
Elasticsearch supports two types of geo data:
geo_point
fields which support lat/lon pairs, and
geo_shape
fields, which support points, lines, circles, polygons, multi-polygons etc.
The queries in this group are:
geo_shape
query-
Find document with geo-shapes which either intersect, are contained by, or do not intersect with the specified geo-shape.
geo_bounding_box
query-
Finds documents with geo-points that fall into the specified rectangle.
geo_distance
query-
Finds document with geo-points within the specified distance of a central point.
geo_polygon
query-
Find documents with geo-points within the specified polygon.
GeoShape Query
See {ref}/query-dsl-geo-shape-query.html[Geo Shape Query]
Note: the geo_shape
type uses Spatial4J
and JTS
, both of which are
optional dependencies. Consequently you must add Spatial4J
and JTS
to your classpath in order to use this type:
<dependency>
<groupId>org.locationtech.spatial4j</groupId>
<artifactId>spatial4j</artifactId>
<version>0.7</version> (1)
</dependency>
<dependency>
<groupId>org.locationtech.jts</groupId>
<artifactId>jts-core</artifactId>
<version>1.15.0</version> (2)
<exclusions>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
</exclusions>
</dependency>
-
check for updates in Maven Central
-
check for updates in Maven Central
// Import ShapeRelation and ShapeBuilder
import org.elasticsearch.common.geo.ShapeRelation;
import org.elasticsearch.common.geo.builders.ShapeBuilder;
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[geo_shape]
-
field
-
shape
-
relation can be
ShapeRelation.CONTAINS
,ShapeRelation.WITHIN
,ShapeRelation.INTERSECTS
orShapeRelation.DISJOINT
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[indexed_geo_shape]
-
field
-
The ID of the document that containing the pre-indexed shape.
-
Index type where the pre-indexed shape is.
-
relation
-
Name of the index where the pre-indexed shape is. Defaults to 'shapes'.
-
The field specified as path containing the pre-indexed shape. Defaults to 'shape'.
Geo Bounding Box Query
See {ref}/query-dsl-geo-bounding-box-query.html[Geo Bounding Box Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[geo_bounding_box]
-
field
-
bounding box top left point
-
bounding box bottom right point
Geo Distance Query
See {ref}/query-dsl-geo-distance-query.html[Geo Distance Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[geo_distance]
-
field
-
center point
-
distance from center point
Geo Polygon Query
See {ref}/query-dsl-geo-polygon-query.html[Geo Polygon Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[geo_polygon]
-
add your polygon of points a document should fall within
-
initialise the query with field and points
Specialized queries
This group contains queries which do not fit into the other groups:
more_like_this
query-
This query finds documents which are similar to the specified text, document, or collection of documents.
script
query-
This query allows a script to act as a filter. Also see the
function_score
query. percolate
query-
This query finds percolator queries based on documents.
wrapper
query-
A query that accepts other queries as json or yaml string.
More Like This Query
See {ref}/query-dsl-mlt-query.html[More Like This Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[more_like_this]
-
fields
-
text
-
ignore threshold
-
max num of Terms in generated queries
Script Query
See {ref}/query-dsl-script-query.html[Script Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[script_inline]
-
inlined script
If you have stored on each data node a script named myscript.painless
with:
doc['num1'].value > params.param1
You can use it then with:
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[script_file]
-
Script type: either
ScriptType.FILE
,ScriptType.INLINE
orScriptType.INDEXED
-
Scripting engine
-
Script name
-
Parameters as a
Map<String, Object>
Percolate Query
See: * {ref}/query-dsl-percolate-query.html[Percolate Query]
Settings settings = Settings.builder().put("cluster.name", "elasticsearch").build();
TransportClient client = new PreBuiltTransportClient(settings);
client.addTransportAddress(new TransportAddress(new InetSocketAddress(InetAddresses.forString("127.0.0.1"), 9300)));
Before the percolate
query can be used an percolator
mapping should be added and
a document containing a percolator query should be indexed:
// create an index with a percolator field with the name 'query':
client.admin().indices().prepareCreate("myIndexName")
.addMapping("_doc", "query", "type=percolator", "content", "type=text")
.get();
//This is the query we're registering in the percolator
QueryBuilder qb = termQuery("content", "amazing");
//Index the query = register it in the percolator
client.prepareIndex("myIndexName", "_doc", "myDesignatedQueryName")
.setSource(jsonBuilder()
.startObject()
.field("query", qb) // Register the query
.endObject())
.setRefreshPolicy(RefreshPolicy.IMMEDIATE) // Needed when the query shall be available immediately
.get();
This indexes the above term query under the name myDesignatedQueryName.
In order to check a document against the registered queries, use this code:
//Build a document to check against the percolator
XContentBuilder docBuilder = XContentFactory.jsonBuilder().startObject();
docBuilder.field("content", "This is amazing!");
docBuilder.endObject(); //End of the JSON root object
PercolateQueryBuilder percolateQuery = new PercolateQueryBuilder("query", "_doc", BytesReference.bytes(docBuilder));
// Percolate, by executing the percolator query in the query dsl:
SearchResponse response = client().prepareSearch("myIndexName")
.setQuery(percolateQuery))
.get();
//Iterate over the results
for(SearchHit hit : response.getHits()) {
// Percolator queries as hit
}
Wrapper Query
See {ref}/query-dsl-wrapper-query.html[Wrapper Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[wrapper]
-
query defined as query builder
Span queries
Span queries are low-level positional queries which provide expert control over the order and proximity of the specified terms. These are typically used to 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:
span_term
query-
The equivalent of the
term
query but for use with other span queries. span_multi
query-
Wraps a
term
,range
,prefix
,wildcard
,regexp
, orfuzzy
query. span_first
query-
Accepts another span query whose matches must appear within the first N positions of the field.
span_near
query-
Accepts multiple span queries whose matches must be within the specified distance of each other, and possibly in the same order.
span_or
query-
Combines multiple span queries — returns documents which match any of the specified queries.
span_not
query-
Wraps another span query, and excludes any documents which match that query.
span_containing
query-
Accepts a list of span queries, but only returns those spans which also match a second span query.
span_within
query-
The result from a single span query is returned as long is its span falls within the spans returned by a list of other span queries.
Span Term Query
See {ref}/query-dsl-span-term-query.html[Span Term Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[span_term]
-
field
-
value
Span Multi Term Query
See {ref}/query-dsl-span-multi-term-query.html[Span Multi Term Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[span_multi]
-
Can be any builder extending the
MultiTermQueryBuilder
class. For example:FuzzyQueryBuilder
,PrefixQueryBuilder
,RangeQueryBuilder
,RegexpQueryBuilder
orWildcardQueryBuilder
.
Span First Query
See {ref}/query-dsl-span-first-query.html[Span First Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[span_first]
-
query
-
max end position
Span Near Query
See {ref}/query-dsl-span-near-query.html[Span Near Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[span_near]
-
span term queries
-
slop factor: the maximum number of intervening unmatched positions
-
whether matches are required to be in-order
Span Or Query
See {ref}/query-dsl-span-or-query.html[Span Or Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[span_or]
-
span term queries
Span Not Query
See {ref}/query-dsl-span-not-query.html[Span Not Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[span_not]
-
span query whose matches are filtered
-
span query whose matches must not overlap those returned
Span Containing Query
See {ref}/query-dsl-span-containing-query.html[Span Containing Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[span_containing]
-
big
part -
little
part
Span Within Query
See {ref}/query-dsl-span-within-query.html[Span Within Query]
include-tagged::/fresh_work/warex/file_cache/linux/www/elasticsearch-6.8.23-src.tar.gz/elasticsearch-6.8.23/docs/java-api/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java[span_within]
-
big
part -
little
part