diff --git a/docs/reference/query-dsl.asciidoc b/docs/reference/query-dsl.asciidoc index 8d9c803b615..74d22d6de41 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/special-queries.asciidoc[] +include::query-dsl/match-all-query.asciidoc[] include::query-dsl/span-queries.asciidoc[] +include::query-dsl/special-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 49dc4e2364e..4a9a3a557e9 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 c57235e7160..07a0d00cc64 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 bee5787df1d..d156950e355 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 bfcece8d62e..034c5167d60 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 9a0f1fb7b03..771969678b8 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 513449e04c6..6ad441af610 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 f35e97db8ec..db44a6f40b7 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 0af99b61f19..dda1c1546d0 100644 --- a/docs/reference/query-dsl/full-text-queries.asciidoc +++ b/docs/reference/query-dsl/full-text-queries.asciidoc @@ -7,62 +7,55 @@ 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. - -<>:: - - 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. +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 - 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_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. <>:: A more specialized query which gives more preference to uncommon words. <>:: - - 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::common-terms-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 60b87baf3d7..d5f20a57dc2 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 4be54691624..ecf43f90a1a 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 1a088a35014..b0523e09a3a 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 da7b0ecfd81..7a7f749687e 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 c33b227824b..062e44cf03d 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 5220b00101e..b3cc9112576 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 424968090d6..79395f24e3c 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 b66ad4ea5fa..90e732a0796 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 +++++ Returns parent documents whose <> child documents match a provided query. You can create parent-child relationships between documents in diff --git a/docs/reference/query-dsl/has-parent-query.asciidoc b/docs/reference/query-dsl/has-parent-query.asciidoc index 4065a9d99fe..60bd906117c 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 43de8cb7332..afbd6635061 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 7353ca137f3..6581f3eff3a 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 e40b8655066..69fcca86900 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 6e448828676..31d4f64aef3 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 623f2423d80..36699bed81a 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 304eaf9a5b4..f4eb386186e 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 1f4b19eedc1..ed847c419af 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 23474811449..27dde4c2a91 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 d6395da95e4..e0610ca4240 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 e59cd24292d..1d9de562083 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 4e32670c3f7..13a238d9048 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 391b42ea007..dbac78b5c30 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 8ef8d32fec3..72048c9aee5 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 +++++ Wraps another query to search <> fields. diff --git a/docs/reference/query-dsl/parent-id-query.asciidoc b/docs/reference/query-dsl/parent-id-query.asciidoc index aa2074e7d1b..89fa4135133 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 6444bdb743e..314c30bfc1a 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 54d69583e99..a41abc35b53 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 c293bf5457b..967dd906eec 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 27db882fe1d..0cbc1895cd7 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 fe23c5f3ec2..18e4562a90a 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 b50b2ca8f50..1df4107f6ef 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 917991e3211..e8c8f3b7cc1 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 a0ec0836425..9f6db700e2b 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 113db56072d..cb8e302e259 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 638c6999233..7b5fb0ba7ae 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 d9e96635a29..67ef67e5951 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 dba7932661d..a5d23071f79 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 f79283b7fa4..c645d45e237 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 e69be783e3d..acb94a31881 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 29a803a7476..561f4eb1eb1 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 470935d6f5c..e1c0c9263a8 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 7dc65433432..cc14b0ee493 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. + +<>:: +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 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. + <>:: The equivalent of the <> but for use with other span queries. -<>:: - -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. - -<>:: - -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 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-multi-term-query.asciidoc[] - -include::span-first-query.asciidoc[] - -include::span-near-query.asciidoc[] - -include::span-or-query.asciidoc[] - -include::span-not-query.asciidoc[] include::span-containing-query.asciidoc[] -include::span-within-query.asciidoc[] - include::span-field-masking-query.asciidoc[] + +include::span-first-query.asciidoc[] + +include::span-multi-term-query.asciidoc[] + +include::span-near-query.asciidoc[] + +include::span-not-query.asciidoc[] + +include::span-or-query.asciidoc[] + +include::span-term-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 1b12a3c35f7..ba31b471ef2 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 b70835c4134..f344f32b218 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 b7275ac2cee..c2e95a4d818 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: -<>:: - -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. - <>:: - 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 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 allows to modify the score of a sub-query with a script. + +<>:: A query that accepts other queries as json or yaml string. + +include::distance-feature-query.asciidoc[] + include::mlt-query.asciidoc[] -include::script-query.asciidoc[] - -include::script-score-query.asciidoc[] - include::percolate-query.asciidoc[] include::rank-feature-query.asciidoc[] -include::distance-feature-query.asciidoc[] +include::script-query.asciidoc[] -include::wrapper-query.asciidoc[] +include::script-score-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 badfb85ac62..f2d45c097fc 100644 --- a/docs/reference/query-dsl/term-level-queries.asciidoc +++ b/docs/reference/query-dsl/term-level-queries.asciidoc @@ -20,6 +20,27 @@ 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 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 within a provided range. + +<>:: +Returns documents that contain terms matching a +https://en.wikipedia.org/wiki/Regular_expression[regular expression]. + <>:: Returns documents that contain an exact term in a provided field. @@ -31,34 +52,24 @@ 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 a specific prefix in a provided field. +<>:: +Returns documents of the specified type. <>:: Returns documents that contain terms matching a wildcard pattern. -<>:: -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]. +include::exists-query.asciidoc[] -<>:: +include::fuzzy-query.asciidoc[] -Returns documents of the specified type. +include::ids-query.asciidoc[] -<>:: -Returns documents based on their <>. +include::prefix-query.asciidoc[] +include::range-query.asciidoc[] + +include::regexp-query.asciidoc[] include::term-query.asciidoc[] @@ -66,18 +77,6 @@ include::terms-query.asciidoc[] include::terms-set-query.asciidoc[] -include::range-query.asciidoc[] - -include::exists-query.asciidoc[] - -include::prefix-query.asciidoc[] - -include::wildcard-query.asciidoc[] - -include::regexp-query.asciidoc[] - -include::fuzzy-query.asciidoc[] - include::type-query.asciidoc[] -include::ids-query.asciidoc[] +include::wildcard-query.asciidoc[] diff --git a/docs/reference/query-dsl/term-query.asciidoc b/docs/reference/query-dsl/term-query.asciidoc index 25da70d0cf1..bb87d9a905d 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 53ae0163f80..9e5aa00da61 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 0f097e494bf..0dba96241f8 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 b2e8eb0adf7..5b455ec5f52 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 4ffef5bfc6b..010e086056d 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.