"Fossies" - the Fresh Open Source Software Archive

Member "elasticsearch-6.8.23/docs/java-api/query-dsl.asciidoc" (29 Dec 2021, 1254 Bytes) of package /linux/www/elasticsearch-6.8.23-src.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format (assuming AsciiDoc format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

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]
  1. field

  2. 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]
  1. text

  2. 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]
  1. field

  2. 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]
  1. field

  2. 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]
  1. field

  2. 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]
  1. field

  2. from

  3. to

  4. include lower value means that from is gt when false or gte when true

  5. include upper value means that to is lt when false or lte when true

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]
  1. field

  2. set from to 10 and includeLower to true

  3. set to to 20 and includeUpper to false

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]
  1. 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]
  1. field

  2. 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]
  1. field

  2. 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]
  1. field

  2. 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]
  1. field

  2. 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]
  1. 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]
  1. 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, or filter clauses. The must and should clauses have their scores combined — the more matching clauses, the better — while the must_not and filter 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, the dis_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 a negative 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]
  1. your query

  2. 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]
  1. must query

  2. must not query

  3. should query

  4. 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]
  1. add your queries

  2. add your queries

  3. boost factor

  4. 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]
  1. Add a first function based on a query

  2. And randomize the score based on a given seed

  3. 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]
  1. query that will promote documents

  2. query that will demote documents

  3. 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 the nested query) as an independent document.

has_child and has_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 the has_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]
  1. path to nested document

  2. your query. Any fields referenced inside the query must use the complete path (fully qualified).

  3. score mode could be ScoreMode.Max, ScoreMode.Min, ScoreMode.Total, ScoreMode.Avg or ScoreMode.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]
  1. child type to query against

  2. query

  3. score mode can be ScoreMode.Avg, ScoreMode.Max, ScoreMode.Min, ScoreMode.None or ScoreMode.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]
  1. parent type to query against

  2. query

  3. 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>
  1. check for updates in Maven Central

  2. 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]
  1. field

  2. shape

  3. relation can be ShapeRelation.CONTAINS, ShapeRelation.WITHIN, ShapeRelation.INTERSECTS or ShapeRelation.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]
  1. field

  2. The ID of the document that containing the pre-indexed shape.

  3. Index type where the pre-indexed shape is.

  4. relation

  5. Name of the index where the pre-indexed shape is. Defaults to 'shapes'.

  6. 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]
  1. field

  2. bounding box top left point

  3. 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]
  1. field

  2. center point

  3. 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]
  1. add your polygon of points a document should fall within

  2. 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]
  1. fields

  2. text

  3. ignore threshold

  4. 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]
  1. 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]
  1. Script type: either ScriptType.FILE, ScriptType.INLINE or ScriptType.INDEXED

  2. Scripting engine

  3. Script name

  4. 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]
  1. 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, or fuzzy 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]
  1. field

  2. 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]
  1. Can be any builder extending the MultiTermQueryBuilder class. For example: FuzzyQueryBuilder, PrefixQueryBuilder, RangeQueryBuilder, RegexpQueryBuilder or WildcardQueryBuilder.

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]
  1. query

  2. 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]
  1. span term queries

  2. slop factor: the maximum number of intervening unmatched positions

  3. 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]
  1. 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]
  1. span query whose matches are filtered

  2. 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]
  1. big part

  2. 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]
  1. big part

  2. little part