ElasticSearch中如何让term支持匹配文本类型?

需要在mapping中为文本字段加一个keyword类型的fields,比如:

POST /viw_my_book/viw_my_book/_mapping
{
  "properties": {
      "name": {
          "type": "text",
          "analyzer": "analyzer_user",
          "search_analyzer": "analyzer_user",
          "fields": {
            "raw": {
              "type":  "keyword"
            }
          }
    }
  }
}

猜你喜欢

转载自www.cnblogs.com/ilovejesus/p/12574681.html