Giter Site home page Giter Site logo

Comments (9)

 avatar commented on June 14, 2024

可能你配置的ansj插件没有生效

from elasticsearch-analysis-ansj.

adonis2014 avatar adonis2014 commented on June 14, 2024

@hrdxwandg 我也发现了这个问题。index_ansj 感觉包含了单字分词,和作者测试例子确实不一样,不知道什么问题。

{"tokens":[{"token":"六味地黄","start_offset":0,"end_offset":4,"type":"word","position":0},{"token":"六味","start_offset":0,"end_offset":2,"type":"word","position":1},{"token":"六","start_offset":0,"end_offset":1,"type":"word","position":2},{"token":"味","start_offset":1,"end_offset":2,"type":"word","position":3},{"token":"地黄丸","start_offset":2,"end_offset":5,"type":"word","position":4},{"token":"地黄","start_offset":2,"end_offset":4,"type":"word","position":5},{"token":"地","start_offset":2,"end_offset":3,"type":"word","position":6},{"token":"黄丸软","start_offset":3,"end_offset":6,"type":"word","position":7},{"token":"黄","start_offset":3,"end_offset":4,"type":"word","position":8},{"token":"丸","start_offset":4,"end_offset":5,"type":"word","position":9},{"token":"软胶囊","start_offset":5,"end_offset":8,"type":"word","position":10},{"token":"软胶","start_offset":5,"end_offset":7,"type":"word","position":11},{"token":"软","start_offset":5,"end_offset":6,"type":"word","position":12},{"token":"胶囊","start_offset":6,"end_offset":8,"type":"word","position":13},{"token":"胶","start_offset":6,"end_offset":7,"type":"word","position":14},{"token":"囊","start_offset":7,"end_offset":8,"type":"word","position":15}]}

from elasticsearch-analysis-ansj.

ansjsun avatar ansjsun commented on June 14, 2024

from elasticsearch-analysis-ansj.

adonis2014 avatar adonis2014 commented on June 14, 2024

谢谢ansjsun回复。将配置修改成
image
enabled_stop_filter: false
enable_skip_user_define: true
就可以了。

from elasticsearch-analysis-ansj.

hrdxwandg avatar hrdxwandg commented on June 14, 2024

@adonis2014
你的这个方法对“六味地黄丸软胶囊” OK。
但是如果对“中华人民共和国”进行分词,只能分出“中华人民共和国”和“人民共和国”两个了。

index_ansj的粒度应该是合适范围内尽量小。

from elasticsearch-analysis-ansj.

ansjsun avatar ansjsun commented on June 14, 2024

@hrdxwandg enable_skip_user_define: true
这个去掉...

from elasticsearch-analysis-ansj.

hrdxwandg avatar hrdxwandg commented on June 14, 2024

@ansjsun 去掉enable_skip_user_define: true也不行。

from elasticsearch-analysis-ansj.

tanyf003 avatar tanyf003 commented on June 14, 2024

5.0.2 版本 同样的问题, 也不行,该怎么配置呢

from elasticsearch-analysis-ansj.

ansjsun avatar ansjsun commented on June 14, 2024

吧用户自定义词典的单字去掉..应该在default.dic里面...

去掉单字.

from elasticsearch-analysis-ansj.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.