安装分词器,务必确保版本一致!

下载地址:https://github.com/medcl/elasticsearch-analysis-ik

为了保证一致,我特地将elasticsearch进行降级。

ik_smart

GET _analyze?pretty
{
"analyzer": "ik_smart",
"text": "中华人民共和国国歌"
}
{
"tokens": [
{
"token": "中华人民共和国",
"start_offset": 0,
"end_offset": 7,
"type": "CN_WORD",
"position": 0
},
{
"token": "国歌",
"start_offset": 7,
"end_offset": 9,
"type": "CN_WORD",
"position": 1
}
]
}

ik_max_word

GET _analyze?pretty
{
"analyzer": "ik_max_word",
"text": "中华人民共和国国歌"
}
{
"tokens": [
{
"token": "中华人民共和国",
"start_offset": 0,
"end_offset": 7,
"type": "CN_WORD",
"position": 0
},
{
"token": "中华人民",
"start_offset": 0,
"end_offset": 4,
"type": "CN_WORD",
"position": 1
},
{
"token": "中华",
"start_offset": 0,
"end_offset": 2,
"type": "CN_WORD",
"position": 2
},
{
"token": "华人",
"start_offset": 1,
"end_offset": 3,
"type": "CN_WORD",
"position": 3
},
{
"token": "人民共和国",
"start_offset": 2,
"end_offset": 7,
"type": "CN_WORD",
"position": 4
},
{
"token": "人民",
"start_offset": 2,
"end_offset": 4,
"type": "CN_WORD",
"position": 5
},
{
"token": "共和国",
"start_offset": 4,
"end_offset": 7,
"type": "CN_WORD",
"position": 6
},
{
"token": "共和",
"start_offset": 4,
"end_offset": 6,
"type": "CN_WORD",
"position": 7
},
{
"token": "国",
"start_offset": 6,
"end_offset": 7,
"type": "CN_CHAR",
"position": 8
},
{
"token": "国歌",
"start_offset": 7,
"end_offset": 9,
"type": "CN_WORD",
"position": 9
}
]
}

最新文章

  1. 基于zepto的移动端日期+时间选择插件
  2. 是不是content-type: text/html的数据包一到,浏览器就肯定刷新页面?
  3. 黑马程序员——JAVA基础之异常处理机制
  4. OpenWrt编译到底脚本
  5. Error Code: 1175
  6. libpq程序例子
  7. ajax、form提交乱码
  8. DEMO阶段已完成,今天,要深入钻
  9. SaberRD之交流分析
  10. java.util.ConcurrentModificationException异常排查
  11. 曾经进公司面试的C语言有关指针和数组的笔试题
  12. Spring Cloud中的负载均衡策略
  13. 性能调优9:根据WaitType诊断性能
  14. 《Nosql精粹》—— 读后总结
  15. brctl 命令详解
  16. ZBench: 服务器一键测试脚本 / 自带结果导出vps网络测试
  17. Python抓取远程文件获取真实文件名
  18. ARM汇编程序闪烁灯与其反汇编代码比较
  19. BZOJ 2002: [Hnoi2010]Bounce 弹飞绵羊 动态树
  20. Python高级教程-高阶函数

热门文章

  1. MapReduce程序——WordCount(Windows_Eclipse + Ubuntu14.04_Hadoop2.9.0)
  2. Ajax-08 跨域获取最新电视节目清单实例
  3. @ResponseBody与@RestController的作用与区别
  4. cassandra压力测试
  5. ARM汇编指令集4
  6. Maven项目中java类报错-Cannot resolve symbol
  7. [转载] ffmpeg Windows下采集摄像头一帧数据,并保存为bmp图片
  8. 狗狗有关的知识tips
  9. 拦截器springmvc防止表单重复提交【3】自己实际项目
  10. C语言内存对齐对则