顺序匹配

match_phrase

  1. GET /my_index/my_type/_search
  2. {
  3. "query": {
  4. "match_phrase": {
  5. "title": {
  6. "query": "quick fox",
  7. "slop": 1
  8. }
  9. }
  10. }
  11. }

match_phrase_prefix

  1. {
  2. "match_phrase_prefix" : {
  3. "brand" : "johnnie walker bl"
  4. }
  5. }

slop: 查询词条相隔多远时仍然能将文档视为匹配 。

  1. {
  2. "match_phrase_prefix" : {
  3. "brand" : {
  4. "query": "walker johnnie bl",
  5. "slop": 10
  6. }
  7. }
  8. }
文档更新时间: 2019-01-18 12:17