开发者社区> 问答> 正文

分词器咋设置?

这个是es的概念,但我在官方文档里没找到 image.png

image.png

本问题来自阿里云开发者社区的【11大垂直技术领域开发者社群】。https://developer.aliyun.com/article/706511 点击链接欢迎加入感兴趣的技术领域群。

展开
收起
初商 2019-09-12 10:38:52 1212 0
1 条回答
写回答
取消 提交回答
  • 推荐回答

    1、什么是分词器

    分词器就是把一个文档切分成词语,也就是es中所做的normalization(提升recall召回率)

    recall,召回率:搜索的时候,增加能够搜索到的结果的数量。

    经过分词器分词之后,es才能建立倒排索引

    2、内置分词器的介绍

    es内置种分词器,他们分别是、standard analyzer、simple analyzer、whitespace analyzer、language analyzer。所以如果是中文还要程序员自动手动安装中文分词器

    假设有如下一段话:

    Set the shape to semi-transparent by calling set_trans(5)

    standard analyzer:结果是 set, the, shape, to, semi, transparent, by, calling, set_trans, 5(默认的是standard) simple analyzer:结果是 set, the, shape, to, semi, transparent, by, calling, set, trans whitespace analyzer:结果是 Set, the, shape, to, semi-transparent, by, calling, set_trans(5) language analyzer(特定的语言的分词器,比如说,english,英语分词器):结果是 set, shape, semi, transpar, call, set_tran, 5 3、其他说明

    Elasticsearch中,内置了很多分词器(analyzers),例如standard (标准分词器)、english(英文分词)和chinese (中文分词)。其中standard 就是无脑的一个一个词(汉字)切分,所以适用范围广,但是精准度低;english 对英文更加智能,可以识别单数负数,大小写,过滤stopwords(例如"the"这个词)等;chinese 效果很差,后面会演示。这次主要玩这几个内容:安装中文分词ik,对比不同分词器的效果,得出一个较佳的配置。关于Elasticsearch,两篇很有用的文章:Elasticsearch的安装,运行和基本配置 和 备份和恢复,需要的可以看下。

    2019-09-12 13:40:27
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载