elasticsearch6.x设置分词mapping

{
  "mapping": {
    "fulltext": {
      "properties": {
        "article": {
          "content": {
            "type": "text",
            "analyzer": "ik_smart",
            "search_analyzer": "ik_smart",
            "copy_to": "input_all"
          }
        },
        "input_all": {
          "type": "text",
          "analyzer": "ik_smart",
          "search_analyzer": "ik_smart"
        }
      }
    }
  }
}

首先,指定content的分词器,然后copy_to到要自定义字段input_all,然后给input_all指定分词器,注意input_all字段一定要设置到propertyies下面。

猜你喜欢

转载自my.oschina.net/duanvincent/blog/1806414