match-phrase-query.asciidoc 940 B

123456789101112131415161718192021222324252627282930313233
  1. [[query-dsl-match-query-phrase]]
  2. === Match Phrase Query
  3. The `match_phrase` query analyzes the text and creates a `phrase` query
  4. out of the analyzed text. For example:
  5. [source,js]
  6. --------------------------------------------------
  7. {
  8. "match_phrase" : {
  9. "message" : "this is a test"
  10. }
  11. }
  12. --------------------------------------------------
  13. A phrase query matches terms up to a configurable `slop`
  14. (which defaults to 0) in any order. Transposed terms have a slop of 2.
  15. The `analyzer` can be set to control which analyzer will perform the
  16. analysis process on the text. It defaults to the field explicit mapping
  17. definition, or the default search analyzer, for example:
  18. [source,js]
  19. --------------------------------------------------
  20. {
  21. "match_phrase" : {
  22. "message" : {
  23. "query" : "this is a test",
  24. "analyzer" : "my_analyzer"
  25. }
  26. }
  27. }
  28. --------------------------------------------------