diff --git a/docs/reference/query-dsl.asciidoc b/docs/reference/query-dsl.asciidoc index 8d9c803b6159a..74d22d6de411e 100644 --- a/docs/reference/query-dsl.asciidoc +++ b/docs/reference/query-dsl.asciidoc @@ -29,22 +29,22 @@ Query clauses behave differently depending on whether they are used in include::query-dsl/query_filter_context.asciidoc[] -include::query-dsl/match-all-query.asciidoc[] +include::query-dsl/compound-queries.asciidoc[] include::query-dsl/full-text-queries.asciidoc[] -include::query-dsl/term-level-queries.asciidoc[] - -include::query-dsl/compound-queries.asciidoc[] +include::query-dsl/geo-queries.asciidoc[] include::query-dsl/joining-queries.asciidoc[] -include::query-dsl/geo-queries.asciidoc[] +include::query-dsl/match-all-query.asciidoc[] + +include::query-dsl/span-queries.asciidoc[] include::query-dsl/special-queries.asciidoc[] -include::query-dsl/span-queries.asciidoc[] +include::query-dsl/term-level-queries.asciidoc[] include::query-dsl/minimum-should-match.asciidoc[] -include::query-dsl/multi-term-rewrite.asciidoc[] +include::query-dsl/multi-term-rewrite.asciidoc[] \ No newline at end of file diff --git a/docs/reference/query-dsl/bool-query.asciidoc b/docs/reference/query-dsl/bool-query.asciidoc index 49dc4e2364efb..4a9a3a557e944 100644 --- a/docs/reference/query-dsl/bool-query.asciidoc +++ b/docs/reference/query-dsl/bool-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-bool-query]] -=== Bool Query +=== Boolean query +++++ +Boolean +++++ A query that matches documents matching boolean combinations of other queries. The bool query maps to Lucene `BooleanQuery`. It is built using diff --git a/docs/reference/query-dsl/boosting-query.asciidoc b/docs/reference/query-dsl/boosting-query.asciidoc index c57235e71606d..07a0d00cc6475 100644 --- a/docs/reference/query-dsl/boosting-query.asciidoc +++ b/docs/reference/query-dsl/boosting-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-boosting-query]] -=== Boosting Query +=== Boosting query +++++ +Boosting +++++ Returns documents matching a `positive` query while reducing the <> of documents that also match a diff --git a/docs/reference/query-dsl/compound-queries.asciidoc b/docs/reference/query-dsl/compound-queries.asciidoc index bee5787df1d28..d156950e35579 100644 --- a/docs/reference/query-dsl/compound-queries.asciidoc +++ b/docs/reference/query-dsl/compound-queries.asciidoc @@ -7,39 +7,34 @@ filter context. The queries in this group are: -<>:: - -A query which wraps another query, but executes it in filter context. All -matching documents are given the same ``constant'' `_score`. - <>:: - 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. -<>:: +<>:: +Return documents which match a `positive` query, but reduce the score of +documents which also match a `negative` query. +<>:: +A query which wraps another query, but executes it in filter context. All +matching documents are given the same ``constant'' `_score`. + +<>:: 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. <>:: - 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. -<>:: - -Return documents which match a `positive` query, but reduce the score of -documents which also match a `negative` query. - -include::constant-score-query.asciidoc[] include::bool-query.asciidoc[] -include::dis-max-query.asciidoc[] -include::function-score-query.asciidoc[] include::boosting-query.asciidoc[] +include::constant-score-query.asciidoc[] +include::dis-max-query.asciidoc[] +include::function-score-query.asciidoc[] \ No newline at end of file diff --git a/docs/reference/query-dsl/constant-score-query.asciidoc b/docs/reference/query-dsl/constant-score-query.asciidoc index bfcece8d62e2f..034c5167d60d4 100644 --- a/docs/reference/query-dsl/constant-score-query.asciidoc +++ b/docs/reference/query-dsl/constant-score-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-constant-score-query]] -=== Constant Score Query +=== Constant score query +++++ +Constant score +++++ Wraps a <> and returns every matching document with a <> equal to the `boost` diff --git a/docs/reference/query-dsl/dis-max-query.asciidoc b/docs/reference/query-dsl/dis-max-query.asciidoc index 9a0f1fb7b039c..771969678b899 100644 --- a/docs/reference/query-dsl/dis-max-query.asciidoc +++ b/docs/reference/query-dsl/dis-max-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-dis-max-query]] -=== Disjunction Max Query +=== Disjunction max query +++++ +Disjunction max +++++ Returns documents matching one or more wrapped queries, called query clauses or clauses. diff --git a/docs/reference/query-dsl/distance-feature-query.asciidoc b/docs/reference/query-dsl/distance-feature-query.asciidoc index 513449e04c627..6ad441af61004 100644 --- a/docs/reference/query-dsl/distance-feature-query.asciidoc +++ b/docs/reference/query-dsl/distance-feature-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-distance-feature-query]] -=== Distance Feature Query +=== Distance feature query +++++ +Distance feature +++++ The `distance_feature` query is a specialized query that only works on <>, <> or <> diff --git a/docs/reference/query-dsl/exists-query.asciidoc b/docs/reference/query-dsl/exists-query.asciidoc index f35e97db8ec18..db44a6f40b7d7 100644 --- a/docs/reference/query-dsl/exists-query.asciidoc +++ b/docs/reference/query-dsl/exists-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-exists-query]] -=== Exists Query +=== Exists query +++++ +Exists +++++ Returns documents that contain an indexed value for a field. diff --git a/docs/reference/query-dsl/full-text-queries.asciidoc b/docs/reference/query-dsl/full-text-queries.asciidoc index 8fc53bc7e9b8a..e649fbae6f270 100644 --- a/docs/reference/query-dsl/full-text-queries.asciidoc +++ b/docs/reference/query-dsl/full-text-queries.asciidoc @@ -7,56 +7,49 @@ the field during indexing. The queries in this group are: +<>:: +A full text query that allows fine-grained control of the ordering and +proximity of matching terms. + <>:: +The standard query for performing full text queries, including fuzzy matching +and phrase or proximity queries. - The standard query for performing full text queries, including fuzzy matching - and phrase or proximity queries. +<>:: +Creates a `bool` query that matches each term as a `term` query, except for +the last term, which is matched as a `prefix` query <>:: - - Like the `match` query but used for matching exact phrases or word proximity matches. +Like the `match` query but used for matching exact phrases or word proximity matches. <>:: - - Like the `match_phrase` query, but does a wildcard search on the final word. - -<>:: - - Creates a `bool` query that matches each term as a `term` query, except for - the last term, which is matched as a `prefix` query - +Like the `match_phrase` query, but does a wildcard search on the final word. + <>:: - - The multi-field version of the `match` query. +The multi-field version of the `match` query. <>:: - - Supports the compact Lucene <>, - allowing you to specify AND|OR|NOT conditions and multi-field search - within a single query string. For expert users only. +Supports the compact Lucene <>, +allowing you to specify AND|OR|NOT conditions and multi-field search +within a single query string. For expert users only. <>:: +A simpler, more robust version of the `query_string` syntax suitable +for exposing directly to users. - A simpler, more robust version of the `query_string` syntax suitable - for exposing directly to users. - -<>:: - A full text query that allows fine-grained control of the ordering and - proximity of matching terms +include::intervals-query.asciidoc[] include::match-query.asciidoc[] +include::match-bool-prefix-query.asciidoc[] + include::match-phrase-query.asciidoc[] include::match-phrase-prefix-query.asciidoc[] -include::match-bool-prefix-query.asciidoc[] - include::multi-match-query.asciidoc[] include::query-string-query.asciidoc[] -include::simple-query-string-query.asciidoc[] - -include::intervals-query.asciidoc[] +include::simple-query-string-query.asciidoc[] \ No newline at end of file diff --git a/docs/reference/query-dsl/function-score-query.asciidoc b/docs/reference/query-dsl/function-score-query.asciidoc index 60b87baf3d758..d5f20a57dc228 100644 --- a/docs/reference/query-dsl/function-score-query.asciidoc +++ b/docs/reference/query-dsl/function-score-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-function-score-query]] -=== Function Score Query +=== Function score query +++++ +Function score +++++ The `function_score` allows you to modify the score of documents that are retrieved by a query. This can be useful if, for example, a score diff --git a/docs/reference/query-dsl/fuzzy-query.asciidoc b/docs/reference/query-dsl/fuzzy-query.asciidoc index 4be546916240f..ecf43f90a1a6a 100644 --- a/docs/reference/query-dsl/fuzzy-query.asciidoc +++ b/docs/reference/query-dsl/fuzzy-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-fuzzy-query]] -=== Fuzzy Query +=== Fuzzy query +++++ +Fuzzy +++++ The fuzzy query uses similarity based on Levenshtein edit distance. diff --git a/docs/reference/query-dsl/geo-bounding-box-query.asciidoc b/docs/reference/query-dsl/geo-bounding-box-query.asciidoc index 1a088a350145f..b0523e09a3a65 100644 --- a/docs/reference/query-dsl/geo-bounding-box-query.asciidoc +++ b/docs/reference/query-dsl/geo-bounding-box-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-geo-bounding-box-query]] -=== Geo Bounding Box Query +=== Geo-bounding box query +++++ +Geo-bounding box +++++ A query allowing to filter hits based on a point location using a bounding box. Assuming the following indexed document: diff --git a/docs/reference/query-dsl/geo-distance-query.asciidoc b/docs/reference/query-dsl/geo-distance-query.asciidoc index da7b0ecfd81e5..7a7f749687ee6 100644 --- a/docs/reference/query-dsl/geo-distance-query.asciidoc +++ b/docs/reference/query-dsl/geo-distance-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-geo-distance-query]] -=== Geo Distance Query +=== Geo-distance query +++++ +Geo-distance +++++ Filters documents that include only hits that exists within a specific distance from a geo point. Assuming the following mapping and indexed diff --git a/docs/reference/query-dsl/geo-polygon-query.asciidoc b/docs/reference/query-dsl/geo-polygon-query.asciidoc index c33b227824bdf..062e44cf03d0c 100644 --- a/docs/reference/query-dsl/geo-polygon-query.asciidoc +++ b/docs/reference/query-dsl/geo-polygon-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-geo-polygon-query]] -=== Geo Polygon Query +=== Geo-polygon query +++++ +Geo-polygon +++++ A query returning hits that only fall within a polygon of points. Here is an example: diff --git a/docs/reference/query-dsl/geo-queries.asciidoc b/docs/reference/query-dsl/geo-queries.asciidoc index 5220b00101e98..b3cc9112576cc 100644 --- a/docs/reference/query-dsl/geo-queries.asciidoc +++ b/docs/reference/query-dsl/geo-queries.asciidoc @@ -8,29 +8,24 @@ lines, circles, polygons, multi-polygons, etc. The queries in this group are: -<> query:: - - Finds documents with geo-shapes which either intersect, are contained by, or - do not intersect with the specified geo-shape. - <> query:: - - Finds documents with geo-points that fall into the specified rectangle. +Finds documents with geo-points that fall into the specified rectangle. <> query:: - - Finds documents with geo-points within the specified distance of a central - point. +Finds documents with geo-points within the specified distance of a central point. <> query:: +Find documents with geo-points within the specified polygon. - Find documents with geo-points within the specified polygon. - +<> query:: +Finds documents with geo-shapes which either intersect, are contained by, or do not intersect with the specified +geo-shape. -include::geo-shape-query.asciidoc[] include::geo-bounding-box-query.asciidoc[] include::geo-distance-query.asciidoc[] include::geo-polygon-query.asciidoc[] + +include::geo-shape-query.asciidoc[] diff --git a/docs/reference/query-dsl/geo-shape-query.asciidoc b/docs/reference/query-dsl/geo-shape-query.asciidoc index 424968090d6ab..79395f24e3ce9 100644 --- a/docs/reference/query-dsl/geo-shape-query.asciidoc +++ b/docs/reference/query-dsl/geo-shape-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-geo-shape-query]] -=== GeoShape Query +=== Geo-shape query +++++ +Geo-shape +++++ Filter documents indexed using the `geo_shape` type. diff --git a/docs/reference/query-dsl/has-child-query.asciidoc b/docs/reference/query-dsl/has-child-query.asciidoc index b75c06c99c566..890ecf8631321 100644 --- a/docs/reference/query-dsl/has-child-query.asciidoc +++ b/docs/reference/query-dsl/has-child-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-has-child-query]] -=== Has Child Query +=== Has child query +++++ +Has child +++++ The `has_child` filter accepts a query and the child type to run against, and results in parent documents that have child docs matching the query. Here is diff --git a/docs/reference/query-dsl/has-parent-query.asciidoc b/docs/reference/query-dsl/has-parent-query.asciidoc index 4065a9d99fe2e..60bd906117c42 100644 --- a/docs/reference/query-dsl/has-parent-query.asciidoc +++ b/docs/reference/query-dsl/has-parent-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-has-parent-query]] -=== Has Parent Query +=== Has parent query +++++ +Has parent +++++ The `has_parent` query accepts a query and a parent type. The query is executed in the parent document space, which is specified by the parent diff --git a/docs/reference/query-dsl/ids-query.asciidoc b/docs/reference/query-dsl/ids-query.asciidoc index 43de8cb7332d3..afbd663506147 100644 --- a/docs/reference/query-dsl/ids-query.asciidoc +++ b/docs/reference/query-dsl/ids-query.asciidoc @@ -1,5 +1,9 @@ [[query-dsl-ids-query]] -=== Ids Query +=== IDs +++++ +IDs +++++ + Returns documents based on their IDs. This query uses document IDs stored in the <> field. diff --git a/docs/reference/query-dsl/intervals-query.asciidoc b/docs/reference/query-dsl/intervals-query.asciidoc index 7353ca137f3e1..6581f3eff3a29 100644 --- a/docs/reference/query-dsl/intervals-query.asciidoc +++ b/docs/reference/query-dsl/intervals-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-intervals-query]] === Intervals query +++++ +Intervals +++++ An `intervals` query allows fine-grained control over the order and proximity of matching terms. Matching rules are constructed from a small set of definitions, diff --git a/docs/reference/query-dsl/joining-queries.asciidoc b/docs/reference/query-dsl/joining-queries.asciidoc index e40b8655066e5..69fcca8690079 100644 --- a/docs/reference/query-dsl/joining-queries.asciidoc +++ b/docs/reference/query-dsl/joining-queries.asciidoc @@ -6,13 +6,11 @@ prohibitively expensive. Instead, Elasticsearch offers two forms of join which are designed to scale horizontally. <>:: - Documents may contain fields of type <>. These fields are used to index arrays of objects, where each object can be queried (with the `nested` query) as an independent document. <> and <> queries:: - A <> can exist between documents within a single index. The `has_child` query returns parent documents whose child documents match the specified query, while the diff --git a/docs/reference/query-dsl/match-all-query.asciidoc b/docs/reference/query-dsl/match-all-query.asciidoc index 6e44882867624..31d4f64aef3b2 100644 --- a/docs/reference/query-dsl/match-all-query.asciidoc +++ b/docs/reference/query-dsl/match-all-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-match-all-query]] -== Match All Query +== Match all query +++++ +Match all +++++ The most simple query, which matches all documents, giving them all a `_score` of `1.0`. diff --git a/docs/reference/query-dsl/match-bool-prefix-query.asciidoc b/docs/reference/query-dsl/match-bool-prefix-query.asciidoc index 623f2423d8055..36699bed81ad3 100644 --- a/docs/reference/query-dsl/match-bool-prefix-query.asciidoc +++ b/docs/reference/query-dsl/match-bool-prefix-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-match-bool-prefix-query]] -=== Match Bool Prefix Query +=== Match boolean prefix query +++++ +Match boolean prefix +++++ A `match_bool_prefix` query analyzes its input and constructs a <> from the terms. Each term except the last diff --git a/docs/reference/query-dsl/match-phrase-prefix-query.asciidoc b/docs/reference/query-dsl/match-phrase-prefix-query.asciidoc index 304eaf9a5b4f0..f4eb386186ea4 100644 --- a/docs/reference/query-dsl/match-phrase-prefix-query.asciidoc +++ b/docs/reference/query-dsl/match-phrase-prefix-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-match-query-phrase-prefix]] -=== Match Phrase Prefix Query +=== Match phrase prefix query +++++ +Match phrase prefix +++++ The `match_phrase_prefix` is the same as `match_phrase`, except that it allows for prefix matches on the last term in the text. For example: diff --git a/docs/reference/query-dsl/match-phrase-query.asciidoc b/docs/reference/query-dsl/match-phrase-query.asciidoc index 1f4b19eedc132..ed847c419af60 100644 --- a/docs/reference/query-dsl/match-phrase-query.asciidoc +++ b/docs/reference/query-dsl/match-phrase-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-match-query-phrase]] -=== Match Phrase Query +=== Match phrase query +++++ +Match phrase +++++ The `match_phrase` query analyzes the text and creates a `phrase` query out of the analyzed text. For example: diff --git a/docs/reference/query-dsl/match-query.asciidoc b/docs/reference/query-dsl/match-query.asciidoc index 4fcb40a76ec9c..68886d4736067 100644 --- a/docs/reference/query-dsl/match-query.asciidoc +++ b/docs/reference/query-dsl/match-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-match-query]] -=== Match Query +=== Match query +++++ +Match +++++ `match` queries accept text/numerics/dates, analyzes diff --git a/docs/reference/query-dsl/minimum-should-match.asciidoc b/docs/reference/query-dsl/minimum-should-match.asciidoc index d6395da95e498..e0610ca42407e 100644 --- a/docs/reference/query-dsl/minimum-should-match.asciidoc +++ b/docs/reference/query-dsl/minimum-should-match.asciidoc @@ -1,5 +1,5 @@ [[query-dsl-minimum-should-match]] -== Minimum Should Match +== `minimum_should_match` parameter The `minimum_should_match` parameter possible values: diff --git a/docs/reference/query-dsl/mlt-query.asciidoc b/docs/reference/query-dsl/mlt-query.asciidoc index e59cd24292d48..1d9de562083a8 100644 --- a/docs/reference/query-dsl/mlt-query.asciidoc +++ b/docs/reference/query-dsl/mlt-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-mlt-query]] -=== More Like This Query +=== More like this query +++++ +More like this +++++ The More Like This Query finds documents that are "like" a given set of documents. In order to do so, MLT selects a set of representative terms diff --git a/docs/reference/query-dsl/multi-match-query.asciidoc b/docs/reference/query-dsl/multi-match-query.asciidoc index e7bcd799df702..7708a6e4e1d24 100644 --- a/docs/reference/query-dsl/multi-match-query.asciidoc +++ b/docs/reference/query-dsl/multi-match-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-multi-match-query]] -=== Multi Match Query +=== Multi-match query +++++ +Multi-match +++++ The `multi_match` query builds on the <> to allow multi-field queries: diff --git a/docs/reference/query-dsl/multi-term-rewrite.asciidoc b/docs/reference/query-dsl/multi-term-rewrite.asciidoc index 391b42ea00791..dbac78b5c3038 100644 --- a/docs/reference/query-dsl/multi-term-rewrite.asciidoc +++ b/docs/reference/query-dsl/multi-term-rewrite.asciidoc @@ -1,5 +1,5 @@ [[query-dsl-multi-term-rewrite]] -== `rewrite` Parameter +== `rewrite` parameter WARNING: This parameter is for expert users only. Changing the value of this parameter can impact search performance and relevance. diff --git a/docs/reference/query-dsl/nested-query.asciidoc b/docs/reference/query-dsl/nested-query.asciidoc index c58d68b73cff1..852cc7806aaf0 100644 --- a/docs/reference/query-dsl/nested-query.asciidoc +++ b/docs/reference/query-dsl/nested-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-nested-query]] -=== Nested Query +=== Nested query +++++ +Nested +++++ Nested query allows to query nested objects / docs (see <>). The diff --git a/docs/reference/query-dsl/parent-id-query.asciidoc b/docs/reference/query-dsl/parent-id-query.asciidoc index aa2074e7d1b7e..89fa4135133a0 100644 --- a/docs/reference/query-dsl/parent-id-query.asciidoc +++ b/docs/reference/query-dsl/parent-id-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-parent-id-query]] -=== Parent Id Query +=== Parent ID query +++++ +Parent ID +++++ The `parent_id` query can be used to find child documents which belong to a particular parent. Given the following mapping definition: diff --git a/docs/reference/query-dsl/percolate-query.asciidoc b/docs/reference/query-dsl/percolate-query.asciidoc index 6444bdb743e65..314c30bfc1a9b 100644 --- a/docs/reference/query-dsl/percolate-query.asciidoc +++ b/docs/reference/query-dsl/percolate-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-percolate-query]] -=== Percolate Query +=== Percolate query +++++ +Percolate +++++ The `percolate` query can be used to match queries stored in an index. The `percolate` query itself diff --git a/docs/reference/query-dsl/prefix-query.asciidoc b/docs/reference/query-dsl/prefix-query.asciidoc index 54d69583e990c..a41abc35b5343 100644 --- a/docs/reference/query-dsl/prefix-query.asciidoc +++ b/docs/reference/query-dsl/prefix-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-prefix-query]] -=== Prefix Query +=== Prefix query +++++ +Prefix +++++ Matches documents that have fields containing terms with a specified prefix (*not analyzed*). The prefix query maps to Lucene `PrefixQuery`. diff --git a/docs/reference/query-dsl/query-string-query.asciidoc b/docs/reference/query-dsl/query-string-query.asciidoc index c293bf5457b9c..967dd906eec3f 100644 --- a/docs/reference/query-dsl/query-string-query.asciidoc +++ b/docs/reference/query-dsl/query-string-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-query-string-query]] -=== Query String Query +=== Query string query +++++ +Query string +++++ A query that uses a query parser in order to parse its content. Here is an example: diff --git a/docs/reference/query-dsl/range-query.asciidoc b/docs/reference/query-dsl/range-query.asciidoc index 27db882fe1dd3..0cbc1895cd7f7 100644 --- a/docs/reference/query-dsl/range-query.asciidoc +++ b/docs/reference/query-dsl/range-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-range-query]] -=== Range Query +=== Range query +++++ +Range +++++ Returns documents that contain terms within a provided range. diff --git a/docs/reference/query-dsl/rank-feature-query.asciidoc b/docs/reference/query-dsl/rank-feature-query.asciidoc index fe23c5f3ec26f..18e4562a90adb 100644 --- a/docs/reference/query-dsl/rank-feature-query.asciidoc +++ b/docs/reference/query-dsl/rank-feature-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-rank-feature-query]] -=== Rank Feature Query +=== Rank feature query +++++ +Rank feature +++++ The `rank_feature` query is a specialized query that only works on <> fields and <> fields. diff --git a/docs/reference/query-dsl/regexp-query.asciidoc b/docs/reference/query-dsl/regexp-query.asciidoc index b50b2ca8f5055..1df4107f6ef7f 100644 --- a/docs/reference/query-dsl/regexp-query.asciidoc +++ b/docs/reference/query-dsl/regexp-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-regexp-query]] -=== Regexp Query +=== Regexp query +++++ +Regexp +++++ The `regexp` query allows you to use regular expression term queries. See <> for details of the supported regular expression language. diff --git a/docs/reference/query-dsl/script-query.asciidoc b/docs/reference/query-dsl/script-query.asciidoc index 917991e3211c6..e8c8f3b7cc1ae 100644 --- a/docs/reference/query-dsl/script-query.asciidoc +++ b/docs/reference/query-dsl/script-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-script-query]] -=== Script Query +=== Script query +++++ +Script +++++ A query allowing to define <> as queries. They are typically used in a filter diff --git a/docs/reference/query-dsl/script-score-query.asciidoc b/docs/reference/query-dsl/script-score-query.asciidoc index 401d323f6fff4..1c5447463c406 100644 --- a/docs/reference/query-dsl/script-score-query.asciidoc +++ b/docs/reference/query-dsl/script-score-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-script-score-query]] -=== Script Score Query +=== Script score query +++++ +Script score +++++ The `script_score` allows you to modify the score of documents that are retrieved by a query. This can be useful if, for example, a score diff --git a/docs/reference/query-dsl/simple-query-string-query.asciidoc b/docs/reference/query-dsl/simple-query-string-query.asciidoc index 113db56072df6..cb8e302e259be 100644 --- a/docs/reference/query-dsl/simple-query-string-query.asciidoc +++ b/docs/reference/query-dsl/simple-query-string-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-simple-query-string-query]] -=== Simple Query String Query +=== Simple query string query +++++ +Simple query string +++++ A query that uses the SimpleQueryParser to parse its context. Unlike the regular `query_string` query, the `simple_query_string` query will never diff --git a/docs/reference/query-dsl/span-containing-query.asciidoc b/docs/reference/query-dsl/span-containing-query.asciidoc index 638c699923305..7b5fb0ba7aeae 100644 --- a/docs/reference/query-dsl/span-containing-query.asciidoc +++ b/docs/reference/query-dsl/span-containing-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-span-containing-query]] -=== Span Containing Query +=== Span containing query +++++ +Span containing +++++ Returns matches which enclose another span query. The span containing query maps to Lucene `SpanContainingQuery`. Here is an example: diff --git a/docs/reference/query-dsl/span-field-masking-query.asciidoc b/docs/reference/query-dsl/span-field-masking-query.asciidoc index d9e96635a29c4..67ef67e595187 100644 --- a/docs/reference/query-dsl/span-field-masking-query.asciidoc +++ b/docs/reference/query-dsl/span-field-masking-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-span-field-masking-query]] -=== Span Field Masking Query +=== Span field masking query +++++ +Span field masking +++++ Wrapper to allow span queries to participate in composite single-field span queries by 'lying' about their search field. The span field masking query maps to Lucene's `SpanFieldMaskingQuery` diff --git a/docs/reference/query-dsl/span-first-query.asciidoc b/docs/reference/query-dsl/span-first-query.asciidoc index dba7932661deb..a5d23071f796a 100644 --- a/docs/reference/query-dsl/span-first-query.asciidoc +++ b/docs/reference/query-dsl/span-first-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-span-first-query]] -=== Span First Query +=== Span first query +++++ +Span first +++++ Matches spans near the beginning of a field. The span first query maps to Lucene `SpanFirstQuery`. Here is an example: diff --git a/docs/reference/query-dsl/span-multi-term-query.asciidoc b/docs/reference/query-dsl/span-multi-term-query.asciidoc index f79283b7fa4f9..c645d45e237dd 100644 --- a/docs/reference/query-dsl/span-multi-term-query.asciidoc +++ b/docs/reference/query-dsl/span-multi-term-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-span-multi-term-query]] -=== Span Multi Term Query +=== Span multi-term query +++++ +Span multi-term +++++ The `span_multi` query allows you to wrap a `multi term query` (one of wildcard, fuzzy, prefix, range or regexp query) as a `span query`, so diff --git a/docs/reference/query-dsl/span-near-query.asciidoc b/docs/reference/query-dsl/span-near-query.asciidoc index e69be783e3d60..acb94a318815b 100644 --- a/docs/reference/query-dsl/span-near-query.asciidoc +++ b/docs/reference/query-dsl/span-near-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-span-near-query]] -=== Span Near Query +=== Span near query +++++ +Span near +++++ Matches spans which are near one another. One can specify _slop_, the maximum number of intervening unmatched positions, as well as whether diff --git a/docs/reference/query-dsl/span-not-query.asciidoc b/docs/reference/query-dsl/span-not-query.asciidoc index 29a803a74767b..561f4eb1eb1ed 100644 --- a/docs/reference/query-dsl/span-not-query.asciidoc +++ b/docs/reference/query-dsl/span-not-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-span-not-query]] -=== Span Not Query +=== Span not query +++++ +Span not +++++ Removes matches which overlap with another span query or which are within x tokens before (controlled by the parameter `pre`) or y tokens diff --git a/docs/reference/query-dsl/span-or-query.asciidoc b/docs/reference/query-dsl/span-or-query.asciidoc index 470935d6f5c4a..e1c0c9263a80f 100644 --- a/docs/reference/query-dsl/span-or-query.asciidoc +++ b/docs/reference/query-dsl/span-or-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-span-or-query]] -=== Span Or Query +=== Span or query +++++ +Span or +++++ Matches the union of its span clauses. The span or query maps to Lucene `SpanOrQuery`. Here is an example: diff --git a/docs/reference/query-dsl/span-queries.asciidoc b/docs/reference/query-dsl/span-queries.asciidoc index 7dc65433432ec..cc14b0ee4935a 100644 --- a/docs/reference/query-dsl/span-queries.asciidoc +++ b/docs/reference/query-dsl/span-queries.asciidoc @@ -15,62 +15,55 @@ Span queries cannot be mixed with non-span queries (with the exception of the `s The queries in this group are: -<>:: +<>:: +Accepts a list of span queries, but only returns those spans which also match a second span query. -The equivalent of the <> but for use with -other span queries. +<>:: +Allows queries like `span-near` or `span-or` across different fields. -<>:: +<>:: +Accepts another span query whose matches must appear within the first N +positions of the field. +<>:: Wraps a <>, <>, <>, <>, <>, or <> query. -<>:: - -Accepts another span query whose matches must appear within the first N -positions of the field. - <>:: - Accepts multiple span queries whose matches must be within the specified distance of each other, and possibly in the same order. -<>:: +<>:: +Wraps another span query, and excludes any documents which match that query. +<>:: Combines multiple span queries -- returns documents which match any of the specified queries. -<>:: - -Wraps another span query, and excludes any documents which match that query. - -<>:: +<>:: -Accepts a list of span queries, but only returns those spans which also match a second span query. +The equivalent of the <> but for use with +other span queries. <>:: - 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. -<>:: - -Allows queries like `span-near` or `span-or` across different fields. -include::span-term-query.asciidoc[] +include::span-containing-query.asciidoc[] -include::span-multi-term-query.asciidoc[] +include::span-field-masking-query.asciidoc[] include::span-first-query.asciidoc[] -include::span-near-query.asciidoc[] +include::span-multi-term-query.asciidoc[] -include::span-or-query.asciidoc[] +include::span-near-query.asciidoc[] include::span-not-query.asciidoc[] -include::span-containing-query.asciidoc[] +include::span-or-query.asciidoc[] -include::span-within-query.asciidoc[] +include::span-term-query.asciidoc[] -include::span-field-masking-query.asciidoc[] +include::span-within-query.asciidoc[] \ No newline at end of file diff --git a/docs/reference/query-dsl/span-term-query.asciidoc b/docs/reference/query-dsl/span-term-query.asciidoc index 1b12a3c35f796..ba31b471ef2ae 100644 --- a/docs/reference/query-dsl/span-term-query.asciidoc +++ b/docs/reference/query-dsl/span-term-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-span-term-query]] -=== Span Term Query +=== Span term query +++++ +Span term +++++ Matches spans containing a term. The span term query maps to Lucene `SpanTermQuery`. Here is an example: diff --git a/docs/reference/query-dsl/span-within-query.asciidoc b/docs/reference/query-dsl/span-within-query.asciidoc index b70835c4134b4..f344f32b21854 100644 --- a/docs/reference/query-dsl/span-within-query.asciidoc +++ b/docs/reference/query-dsl/span-within-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-span-within-query]] -=== Span Within Query +=== Span within query +++++ +Span within +++++ Returns matches which are enclosed inside another span query. The span within query maps to Lucene `SpanWithinQuery`. Here is an example: diff --git a/docs/reference/query-dsl/special-queries.asciidoc b/docs/reference/query-dsl/special-queries.asciidoc index b7275ac2cee3f..c2e95a4d818cf 100644 --- a/docs/reference/query-dsl/special-queries.asciidoc +++ b/docs/reference/query-dsl/special-queries.asciidoc @@ -4,50 +4,44 @@ This group contains queries which do not fit into the other groups: -<>:: +<>:: +A query that computes scores based on the dynamically computed distances +between the origin and documents' date, date_nanos and geo_point fields. +It is able to efficiently skip non-competitive hits. +<>:: This query finds documents which are similar to the specified text, document, or collection of documents. -<>:: - -This query allows a script to act as a filter. Also see the -<>. - -<>:: - -A query that allows to modify the score of a sub-query with a script. - <>:: - This query finds queries that are stored as documents that match with the specified document. <>:: - A query that computes scores based on the values of numeric features and is able to efficiently skip non-competitive hits. -<>:: +<>:: +This query allows a script to act as a filter. Also see the +<>. -A query that computes scores based on the dynamically computed distances -between the origin and documents' date, date_nanos and geo_point fields. -It is able to efficiently skip non-competitive hits. +<>:: +A query that allows to modify the score of a sub-query with a script. <>:: - A query that accepts other queries as json or yaml string. -include::mlt-query.asciidoc[] -include::script-query.asciidoc[] +include::distance-feature-query.asciidoc[] -include::script-score-query.asciidoc[] +include::mlt-query.asciidoc[] include::percolate-query.asciidoc[] include::rank-feature-query.asciidoc[] -include::distance-feature-query.asciidoc[] +include::script-query.asciidoc[] + +include::script-score-query.asciidoc[] -include::wrapper-query.asciidoc[] +include::wrapper-query.asciidoc[] \ No newline at end of file diff --git a/docs/reference/query-dsl/term-level-queries.asciidoc b/docs/reference/query-dsl/term-level-queries.asciidoc index 5941aea76c2fa..fd3f570916270 100644 --- a/docs/reference/query-dsl/term-level-queries.asciidoc +++ b/docs/reference/query-dsl/term-level-queries.asciidoc @@ -20,58 +20,58 @@ Term-level queries still normalize search terms for `keyword` fields with the [[term-level-query-types]] === Types of term-level queries -<>:: -Returns documents that contain an exact term in a provided field. - -<>:: -Returns documents that contain one or more exact terms in a provided field. - -<>:: -Returns documents that contain a minimum number of exact terms in a provided -field. You can define the minimum number of matching terms using a field or -script. - -<>:: -Returns documents that contain terms within a provided range. - <>:: Returns documents that contain any indexed value for a field. +<>:: +Returns documents that contain terms similar to the search term. {es} measures +similarity, or fuzziness, using a +http://en.wikipedia.org/wiki/Levenshtein_distance[Levenshtein edit distance]. + +<>:: +Returns documents based on their <>. + <>:: Returns documents that contain a specific prefix in a provided field. -<>:: -Returns documents that contain terms matching a wildcard pattern. +<>:: +Returns documents that contain terms within a provided range. <>:: Returns documents that contain terms matching a https://en.wikipedia.org/wiki/Regular_expression[regular expression]. -<>:: -Returns documents that contain terms similar to the search term. {es} measures -similarity, or fuzziness, using a -http://en.wikipedia.org/wiki/Levenshtein_distance[Levenshtein edit distance]. +<>:: +Returns documents that contain an exact term in a provided field. -<>:: -Returns documents based on their <>. +<>:: +Returns documents that contain one or more exact terms in a provided field. +<>:: +Returns documents that contain a minimum number of exact terms in a provided +field. You can define the minimum number of matching terms using a field or +script. -include::term-query.asciidoc[] +<>:: +Returns documents that contain terms matching a wildcard pattern. -include::terms-query.asciidoc[] -include::terms-set-query.asciidoc[] +include::exists-query.asciidoc[] -include::range-query.asciidoc[] +include::fuzzy-query.asciidoc[] -include::exists-query.asciidoc[] +include::ids-query.asciidoc[] include::prefix-query.asciidoc[] -include::wildcard-query.asciidoc[] +include::range-query.asciidoc[] include::regexp-query.asciidoc[] -include::fuzzy-query.asciidoc[] +include::term-query.asciidoc[] -include::ids-query.asciidoc[] +include::terms-query.asciidoc[] + +include::terms-set-query.asciidoc[] + +include::wildcard-query.asciidoc[] \ No newline at end of file diff --git a/docs/reference/query-dsl/term-query.asciidoc b/docs/reference/query-dsl/term-query.asciidoc index 25da70d0cf1e1..bb87d9a905d48 100644 --- a/docs/reference/query-dsl/term-query.asciidoc +++ b/docs/reference/query-dsl/term-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-term-query]] -=== Term Query +=== Term query +++++ +Term +++++ Returns documents that contain an *exact* term in a provided field. diff --git a/docs/reference/query-dsl/terms-query.asciidoc b/docs/reference/query-dsl/terms-query.asciidoc index 53ae0163f804f..9e5aa00da61c8 100644 --- a/docs/reference/query-dsl/terms-query.asciidoc +++ b/docs/reference/query-dsl/terms-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-terms-query]] -=== Terms Query +=== Terms query +++++ +Terms +++++ Returns documents that contain one or more *exact* terms in a provided field. diff --git a/docs/reference/query-dsl/terms-set-query.asciidoc b/docs/reference/query-dsl/terms-set-query.asciidoc index 0f097e494bfda..0dba96241f82a 100644 --- a/docs/reference/query-dsl/terms-set-query.asciidoc +++ b/docs/reference/query-dsl/terms-set-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-terms-set-query]] -=== Terms Set Query +=== Terms set query +++++ +Terms set +++++ Returns documents that contain a minimum number of *exact* terms in a provided field. diff --git a/docs/reference/query-dsl/wildcard-query.asciidoc b/docs/reference/query-dsl/wildcard-query.asciidoc index b2e8eb0adf772..5b455ec5f529d 100644 --- a/docs/reference/query-dsl/wildcard-query.asciidoc +++ b/docs/reference/query-dsl/wildcard-query.asciidoc @@ -1,5 +1,9 @@ [[query-dsl-wildcard-query]] -=== Wildcard Query +=== Wildcard query +++++ +Wildcard +++++ + Returns documents that contain terms matching a wildcard pattern. A wildcard operator is a placeholder that matches one or more characters. For diff --git a/docs/reference/query-dsl/wrapper-query.asciidoc b/docs/reference/query-dsl/wrapper-query.asciidoc index 4ffef5bfc6bcc..010e086056d8f 100644 --- a/docs/reference/query-dsl/wrapper-query.asciidoc +++ b/docs/reference/query-dsl/wrapper-query.asciidoc @@ -1,5 +1,8 @@ [[query-dsl-wrapper-query]] -=== Wrapper Query +=== Wrapper query +++++ +Wrapper +++++ A query that accepts any other query as base64 encoded string.