elasticsearch-analysis-jieba

码农软件 · 软件分类 · 中文分词库 · 2019-08-29 06:41:22

软件介绍

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

----------------------------------------------------
| Jieba Chinese Analysis Plugin | ElasticSearch    |
----------------------------------------------------
| 0.0.1-SNAPSHOT (master)       | 0.90.*           |
----------------------------------------------------

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

  1. index 索引模式,搜索引擎建立索引阶段使用该模式
  2. search 搜索模式,搜索时采用该种模式分词

使用说明

创建mapping

#!/bin/bash curl -XDELETE '0:9200/test/';echo curl -XPUT '0:9200/test/' -d ' {  "index" : {  "number_of_shards": 1,  "number_of_replicas": 0,  "analysis" : {  "analyzer" : {  "jieba_search" : {  "type" : "jieba",  "seg_mode" : "search",  "stop" : true  },  "jieba_index" : {  "type" : "jieba",  "seg_mode" : "index",  "stop" : true  }  }  }  } }';echo 

test

# index mode curl '0:9200/test/_analyze?analyzer=jieba_index' -d '中华人民共和国';echo 

结果:

{ "tokens": [ { "token": "中华", "start_offset": 0, "end_offset": 2, "type": "word", "position": 1 }, { "token": "华人", "start_offset": 1, "end_offset": 3, "type": "word", "position": 2 }, { "token": "人民", "start_offset": 2, "end_offset": 4, "type": "word", "position": 3 }, { "token": "共和", "start_offset": 4, "end_offset": 6, "type": "word", "position": 4 }, { "token": "共和国", "start_offset": 4, "end_offset": 7, "type": "word", "position": 5 }, { "token": "中华人民共和国", "start_offset": 0, "end_offset": 7, "type": "word", "position": 6 } ] } 
# search mode curl '0:9200/test/_analyze?analyzer=jieba_search' -d '中华人民共和国';echo 

结果:

{ "tokens": [ { "token": "中华人民共和国", "start_offset": 0, "end_offset": 7, "type": "word", "position": 1 } ] } 

本文地址:https://www.codercto.com/soft/d/13399.html

轻公司

轻公司

李黎、杜晨 / 中信出版社 / 2009-7 / 39.00元

《轻公司》解读了在互联网和IT技术越来越充裕的环境里,传统的商业法则是如何被打破,而新的商业法则如何建立起来的过程。大量生动翔实的采访,为我们构筑了互联网和IT技术影响下的未来商业趋势。李黎和杜晨在《IT经理世界》上发表了一篇封面报道《轻公司》后,迅速在传统行业及互联网行业产生极大反响,无论是老牌的传统企业、创业公司、风险投资商,都视这篇文章为新商业宝典,甚至有业界人士评价,这篇文章拯救了中国的电......一起来看看 《轻公司》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

在线进制转换器
在线进制转换器

各进制数互转换器

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器