{"action":"created","issue":{"url":"https://api.github.com/repos/NLPchina/ansj_seg/issues/531","repository_url":"https://api.github.com/repos/NLPchina/ansj_seg","labels_url":"https://api.github.com/repos/NLPchina/ansj_seg/issues/531/labels{/name}","comments_url":"https://api.github.com/repos/NLPchina/ansj_seg/issues/531/comments","events_url":"https://api.github.com/repos/NLPchina/ansj_seg/issues/531/events","html_url":"https://github.com/NLPchina/ansj_seg/issues/531","id":248249173,"number":531,"title":"ansj插件在es5.2.2和5.4.0中使用有问题","user":{"login":"Garry1205","id":30773687,"avatar_url":"https://avatars0.githubusercontent.com/u/30773687?v=4","gravatar_id":"","url":"https://api.github.com/users/Garry1205","html_url":"https://github.com/Garry1205","followers_url":"https://api.github.com/users/Garry1205/followers","following_url":"https://api.github.com/users/Garry1205/following{/other_user}","gists_url":"https://api.github.com/users/Garry1205/gists{/gist_id}","starred_url":"https://api.github.com/users/Garry1205/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Garry1205/subscriptions","organizations_url":"https://api.github.com/users/Garry1205/orgs","repos_url":"https://api.github.com/users/Garry1205/repos","events_url":"https://api.github.com/users/Garry1205/events{/privacy}","received_events_url":"https://api.github.com/users/Garry1205/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-08-06T14:04:42Z","updated_at":"2017-08-07T02:19:31Z","closed_at":null,"body":"以前用过es1.6开发项目，中文分词插件就是使用ansj，那个版本完全没有问题。\r\n最近要升级es版本，发现无论在es5.2.2还是在es5.4.0，ansj好像都有些问题。\r\n5.2的问题是，自定义词库不生效，我把自定义词库删除，新建一个dic，里面只新建一个词，“中国人民大学'\\t'ntu'\\t'132”，然后分词的时候仍然会被分成“中国”，“人民”，“大学”。自定义词典需要特别的配置吗。\r\n5.4自定义词库是生效的，但是一些特别高频的词，就会被干掉了，比如我对“学习”分词，分词结果为空。不干掉高频词是需要额外配置吗。\r\n无论是在es5.2.2还是在es5.4.0，我的配置文件都是一样的，如下：\r\n\r\n\r\nansj:\r\n  #默认参数配置\r\n  isNameRecognition: true #开启姓名识别\r\n  isNumRecognition: true #开启数字识别\r\n  isQuantifierRecognition: true #是否数字和量词合并\r\n  isRealName: false; #是否保留真实词语,建议保留false\r\n  #用户自定词典配置\r\n  dic: file:///usr/local/elasticsearch-5.4.0/plugins/elasticsearch-analysis-ansj/config/default.dic\r\n #也可以写成 file://default.dic , 如果未配置dic,则此词典默认加载\r\n #过滤词典配置\r\n  stop: file:///usr/local/elasticsearch-5.4.0/plugins/elasticsearch-analysis-ansj/config/stop.dic #都支持\r\n\r\n配置文件里非注释内容只有这些，而且我确定路径没有写错。\r\n\r\n\r\n验证url是：\r\nes5.2.2:\r\nhttp://10.97.14.141:9200/test/_analyze?analyzer=index_ansj&text=中国人民大学\r\n结果：\r\n{\"tokens\":[{\"token\":\"中国\",\"start_offset\":0,\"end_offset\":2,\"type\":\"ns\",\"position\":1},{\"token\":\"人民\",\"start_offset\":2,\"end_offset\":4,\"type\":\"n\",\"position\":4},{\"token\":\"大学\",\"start_offset\":4,\"end_offset\":6,\"type\":\"n\",\"position\":8}]}\r\n\r\nes5.4.0\r\nhttp://10.97.14.141:9200/test/_analyze?analyzer=index_ansj&text=学习\r\n结果：\r\n{\"tokens\":[]}\r\n\r\n请问这样的问题可能的原因是什么？\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/NLPchina/ansj_seg/issues/comments/320552785","html_url":"https://github.com/NLPchina/ansj_seg/issues/531#issuecomment-320552785","issue_url":"https://api.github.com/repos/NLPchina/ansj_seg/issues/531","id":320552785,"user":{"login":"Garry1205","id":30773687,"avatar_url":"https://avatars0.githubusercontent.com/u/30773687?v=4","gravatar_id":"","url":"https://api.github.com/users/Garry1205","html_url":"https://github.com/Garry1205","followers_url":"https://api.github.com/users/Garry1205/followers","following_url":"https://api.github.com/users/Garry1205/following{/other_user}","gists_url":"https://api.github.com/users/Garry1205/gists{/gist_id}","starred_url":"https://api.github.com/users/Garry1205/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Garry1205/subscriptions","organizations_url":"https://api.github.com/users/Garry1205/orgs","repos_url":"https://api.github.com/users/Garry1205/repos","events_url":"https://api.github.com/users/Garry1205/events{/privacy}","received_events_url":"https://api.github.com/users/Garry1205/received_events","type":"User","site_admin":false},"created_at":"2017-08-07T02:19:31Z","updated_at":"2017-08-07T02:19:31Z","body":"我在es5.4.0上使用ansj，对“中国人民大学”分词也没有问题，但是对“学习”分词没有结果。\r\n您可以帮忙试下对“学习”分词有没有问题吗？"}}
{"actor":{"display_login":"Garry1205"}}