infinilabs / analysis-ik

🚌 The IK Analysis plugin integrates Lucene IK analyzer into Elasticsearch and OpenSearch, support customized dictionary.
Apache License 2.0
16.49k stars 3.27k forks source link

7.0远程词库不生效 #687

Open 20958 opened 5 years ago

20958 commented 5 years ago

analysis-ik v7.0.0远程分词不生效,静态文件的分词正常

[2019-06-12T16:45:06,016][INFO ][o.w.a.d.Monitor ] [188-node] try load config from /usr/local/elasticsearch-7.0.0/config/analysis-ik/IKAnalyzer.cfg.xml [2019-06-12T16:45:06,018][INFO ][o.w.a.d.Monitor ] [188-node] try load config from /usr/local/elasticsearch-7.0.0/plugins/elasticsearch-analysis-ik-7.0.0/config/IKAnalyzer.cfg.xml [2019-06-12T16:45:06,149][INFO ][o.w.a.d.Monitor ] [188-node] [Dict Loading] /usr/local/elasticsearch-7.0.0/plugins/elasticsearch-analysis-ik-7.0.0/config/custom/sougou.dic [2019-06-12T16:45:06,454][INFO ][o.w.a.d.Monitor ] [188-node] [Dict Loading] /usr/local/elasticsearch-7.0.0/plugins/elasticsearch-analysis-ik-7.0.0/config/custom/mydict.dic [2019-06-12T16:45:06,454][INFO ][o.w.a.d.Monitor ] [188-node] [Dict Loading] /usr/local/elasticsearch-7.0.0/plugins/elasticsearch-analysis-ik-7.0.0/config/custom/spec.dic [2019-06-12T16:45:06,455][INFO ][o.w.a.d.Monitor ] [188-node] [Dict Loading] /usr/local/elasticsearch-7.0.0/plugins/elasticsearch-analysis-ik-7.0.0/config/custom/single_word_low_freq.dic [2019-06-12T16:45:06,456][INFO ][o.w.a.d.Monitor ] [188-node] [Dict Loading] /usr/local/elasticsearch-7.0.0/plugins/elasticsearch-analysis-ik-7.0.0/config/custom/single_word_full.dic [2019-06-12T16:45:06,460][INFO ][o.w.a.d.Monitor ] [188-node] [Dict Loading] http://ncdn00.sxxxxxx.com/qccr/g00/mallprod/hotDict.txt [2019-06-12T16:45:06,468][INFO ][o.w.a.d.Monitor ] [188-node] [Dict Loading] /usr/local/elasticsearch-7.0.0/plugins/elasticsearch-analysis-ik-7.0.0/config/custom/ext_stopword.dic [2019-06-12T16:45:06,469][INFO ][o.w.a.d.Monitor ] [188-node] 重新加载词典完毕...

feige317 commented 5 years ago

我已經通過這個issue解決方案處理ok,地址: https://github.com/medcl/elasticsearch-analysis-ik/issues/689 ,可以通過設定asp.net程式中web.config的配置: `

<urlCompression doStaticCompression="false" doDynamicCompression="false" />

</system.webServer>`

eivoePh commented 5 years ago

Docker ElasticSearch 7.1 SpringBoot 2.1.4 JDK 1.8 由 Controller 生成词典 并由ES7.1 ik加载词典,已成功


SpringBoot 需要使用@RestController

并最好分别创建 method = RequestMethod.HEAD method = RequestMethod.GET 的controler

ES每次调用两次remote_dict_url 第一次调用 HEAD 然后调用 GET

从数据库生成dict时最好放至GET请求中,HEAD调用时就不要用了.

注意README.md中提示的,设置下头 Last-Modified 和 ETag

Good luck

zw201913 commented 4 years ago

Docker ElasticSearch 7.1 SpringBoot 2.1.4 JDK 1.8 由 Controller 生成词典 并由ES7.1 ik加载词典,已成功

SpringBoot 需要使用@RestController

并最好分别创建 method = RequestMethod.HEAD method = RequestMethod.GET 的controler

ES每次调用两次remote_dict_url 第一次调用 HEAD 然后调用 GET

从数据库生成dict时最好放至GET请求中,HEAD调用时就不要用了.

注意README.md中提示的,设置下头 Last-Modified 和 ETag

Good luck

大佬,有demo示例嘛?我这边是es一直没有发送请求过来。