ElasticSearch match phrase Query
Jump to navigation
Jump to search
An ElasticSearch match_phrase Query is an ElasticSearch match query that is a match_phrase query (that analyzes the text and creates a phrase query out of the analyzed text).
- Example(s):
{"terms":{"tags":["blue","pill"],"minimum_should_match":1}}
{"query":{"bool":{"must":[{"terms":{"product.displayName":["sl3k4nr0","01"],"minimum_should_match":2}}],"must_not":[],"should":[]}},"from":0,"size":500,"sort":[],"facets":{}}
- Counter-Example(s):
- See: Lucene Query, SOLR Query.
References
2012
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-match-query.html#_phrase
- The match_phrase query analyzes the text and creates a phrase query out of the analyzed text. For example:
Since match_phrase is only a type of a match query, it can also be used in the following manner:{ "match_phrase" : { "message" : "this is a test" }}
A phrase query maintains order of the terms up to a configurable slop (which defaults to 0).{ "match" : { "message" : { "query" : "this is a test", "type" : "phrase" } }}
The analyzer can be set to control which analyzer will perform the analysis process on the text. It default to the field explicit mapping definition, or the default search analyzer,
- The match_phrase query analyzes the text and creates a phrase query out of the analyzed text. For example: