From a37669f1b61001ebb6f52709b984b0d1f9428854 Mon Sep 17 00:00:00 2001 From: Damien RENIER <153135842+damien-renier-elastic@users.noreply.github.com> Date: Tue, 17 Dec 2024 11:07:04 +0100 Subject: [PATCH 1/2] Update match-phrase-query.asciidoc Added Parameters for consistency --- docs/reference/query-dsl/match-phrase-query.asciidoc | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/reference/query-dsl/match-phrase-query.asciidoc b/docs/reference/query-dsl/match-phrase-query.asciidoc index f6b0fa19001f6..68ab8e7bc79cd 100644 --- a/docs/reference/query-dsl/match-phrase-query.asciidoc +++ b/docs/reference/query-dsl/match-phrase-query.asciidoc @@ -19,9 +19,6 @@ GET /_search } -------------------------------------------------- -A phrase query matches terms up to a configurable `slop` -(which defaults to 0) in any order. Transposed terms have a slop of 2. - The `analyzer` can be set to control which analyzer will perform the analysis process on the text. It defaults to the field explicit mapping definition, or the default search analyzer, for example: From c08edc4b8c8bd373fe8b0a6412efbd38594869ae Mon Sep 17 00:00:00 2001 From: Damien RENIER <153135842+damien-renier-elastic@users.noreply.github.com> Date: Tue, 28 Jan 2025 10:43:24 +0000 Subject: [PATCH 2/2] Update match-phrase-query.asciidoc --- .../query-dsl/match-phrase-query.asciidoc | 41 ++++++++++++++++++- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/docs/reference/query-dsl/match-phrase-query.asciidoc b/docs/reference/query-dsl/match-phrase-query.asciidoc index 68ab8e7bc79cd..88046bc009e7d 100644 --- a/docs/reference/query-dsl/match-phrase-query.asciidoc +++ b/docs/reference/query-dsl/match-phrase-query.asciidoc @@ -19,6 +19,45 @@ GET /_search } -------------------------------------------------- +[[match-phrase-field-params]] +==== Parameters for `` +`query`:: ++ +-- +(Required) Text, number, boolean value or date you wish to find in the provided +``. +-- + +`analyzer`:: +(Optional, string) <> used to convert the text in the `query` +value into tokens. Defaults to the <> mapped for the ``. If no analyzer is mapped, the index's +default analyzer is used. + +`slop`:: +(Optional, integer) Maximum number of positions allowed between matching tokens. +Defaults to `0`. Transposed terms have a slop of `2`. + +`zero_terms_query`:: ++ +-- +(Optional, string) Indicates whether no documents are returned if the `analyzer` +removes all tokens, such as when using a `stop` filter. Valid values are: + + `none` (Default):: +No documents are returned if the `analyzer` removes all tokens. + + `all`:: +Returns all documents, similar to a <> +query. +-- + +A phrase query matches terms up to a configurable `slop` +(which defaults to 0) in any order. Transposed terms have a slop of 2. + +[[query-dsl-match-query-phrase-analyzer]] +===== Analyzer in the match phrase query + The `analyzer` can be set to control which analyzer will perform the analysis process on the text. It defaults to the field explicit mapping definition, or the default search analyzer, for example: @@ -37,5 +76,3 @@ GET /_search } } -------------------------------------------------- - -This query also accepts `zero_terms_query`, as explained in <>.