[[query-dsl-match-query-phrase]] === Match phrase query ++++ Match phrase ++++ The `match_phrase` query analyzes the text and creates a `phrase` query out of the analyzed text. For example: [source,console] -------------------------------------------------- GET /_search { "query": { "match_phrase": { "message": "this is a test" } } } -------------------------------------------------- [[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: [source,console] -------------------------------------------------- GET /_search { "query": { "match_phrase": { "message": { "query": "this is a test", "analyzer": "my_analyzer" } } } } --------------------------------------------------