Elasticsearch中文分词

分词api:

  指定分词器进行分词

    POST /_analyze

{
    "analyzer": "standard",
    "text": "hello world"
}

    

   指定索引分词

    POST /fan/_analyze

{
    "analyzer": "standard",
    "field": "hobby",
    "text": "听音乐"
}

    

 中文分词:

  IK分词器 Elasticsearch插件地址:https://github.com/medcl/elasticsearch-analysis-ik

  安装方法:将下载到的elasticsearch-analysis-ik-6.5.4.zip解压到 elasticsearch/plugins/ik 目录下即可。
    unzip elasticsearch-analysis-ik-6.5.4.zip

    重启服务即可

    测试:POST /_analyze

{
    "analyzer": "ik_max_word",
    "text": "我是中国人"
}

 

posted @ 2020-03-25 22:26  糖不甜,盐不咸  阅读(160)  评论(0编辑  收藏  举报