When ES uses the completion type to make automatic suggestions, it is recommended to open one more subfield

When ES uses completion suggest to make automatic suggestions, it is recommended to open one more subfield, as in the following example, if you want to make automatic suggestions based on the title field, then the type of the field must be changed to completion, but it is recommended not to change the type of the original field and open more A subfield title.suggest, the type is set to completion, and then the following suggestions operate on the title.suggest field. Refer to the mapping as follows:

    "title": {
    
    
        "type": "text",
        "analyzer": "ik_max_word",
        "fields": {
    
    
          "suggest": {
    
    
            "type": "completion",
            "analyzer": "ik_max_word"
          }
        }
      }

Guess you like

Origin blog.csdn.net/weixin_38106322/article/details/111568740