elasticsearch-analysis-jieba开源项目

我要开发同款
匿名用户2013年08月29日
115阅读

技术信息

开源地址
https://github.com/huaban/elasticsearch-analysis-jieba
授权协议
Apache

作品详情

结巴分词插件(forelasticsearch),目前支持0.90.*以上版本

----------------------------------------------------|JiebaChieseAalysisPlugi|ElasticSearch|----------------------------------------------------|0.0.1-SNAPSHOT(master)|0.90.*|----------------------------------------------------

支持两种分词模式(seg_mode):

idex索引模式,搜索引擎建立索引阶段使用该模式search搜索模式,搜索时采用该种模式分词使用说明

创建mappig

#!/bi/bashcurl-XDELETE'0:9200/test/';echocurl-XPUT'0:9200/test/'-d'{"idex":{"umber_of_shards":1,"umber_of_replicas":0,"aalysis":{"aalyzer":{"jieba_search":{"type":"jieba","seg_mode":"search","stop":true},"jieba_idex":{"type":"jieba","seg_mode":"idex","stop":true}}}}}';echo

test

#idexmodecurl'0:9200/test/_aalyze?aalyzer=jieba_idex'-d'中华人民共和国';echo

结果:

{"tokes":[{"toke":"中华","start_offset":0,"ed_offset":2,"type":"word","positio":1},{"toke":"华人","start_offset":1,"ed_offset":3,"type":"word","positio":2},{"toke":"人民","start_offset":2,"ed_offset":4,"type":"word","positio":3},{"toke":"共和","start_offset":4,"ed_offset":6,"type":"word","positio":4},{"toke":"共和国","start_offset":4,"ed_offset":7,"type":"word","positio":5},{"toke":"中华人民共和国","start_offset":0,"ed_offset":7,"type":"word","positio":6}]}#searchmodecurl'0:9200/test/_aalyze?aalyzer=jieba_search'-d'中华人民共和国';echo

结果:

{"tokes":[{"toke":"中华人民共和国","start_offset":0,"ed_offset":7,"type":"word","positio":1}]}

功能介绍

结巴分词插件(for elasticsearch),目前支持0.90.*以上版本 ----------------------------------------------------
| J...

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论