ElasticSearch fuzzy query (Chinese retrieval)

# "*" 表示匹配任意字符
GET /lib4/user/_search
{
  "query": {
    "wildcard": {"name": "赵*"}
  }
}

# "?" 表示匹配任意一个字符
GET /lib4/user/_search
{
  "query": {
    "wildcard": {"name": "li?i"}
  }
}

 fuzzy fuzzy queries

uzzy fuzzy query is equivalent term queries.

a, containing (the contains) operation, not equivalent (the equals) (determination).

b, do not know that there's word, so it will not go segmentation,

c, the so-called word document contains is the result of a word is included, not the entire document contains

d, because it is the word match results, so you want to convert uppercase to lowercase, uppercase is not match

value: keyword query
boost: the weight of the query, the default value is 1.0
min_similarity: minimum similarity matching set default value is 0.5, for a string of 0-1 (including 0 and 1); for values, the value may be greater than 1; for the date type value of 1d, 1m, etc., 1m a month on behalf of 1d represents one day
prefix_length: indicates distinguish common prefix length of terms, the default is 0
max_expansions: terms in the query can be extended The number, the default may be infinite
GET / lib4 / user / _search { "query": { "fuzzy": { "interests": " singing"}}}
the GET / Iib4 / User / _search { "Query": { "Fuzzy" : { "interests": { " value": " drink"}}}

GET /lib4/user/_search
{
  "query": {
    "fuzzy": {
      "interests": {"value": "喝酒"}
    }
  }
}

 

 

Published 298 original articles · won praise 107 · Views 140,000 +

Guess you like

Origin blog.csdn.net/ywl470812087/article/details/105010942