{"repo":"NLPchina/elasticsearch-analysis-ansj","free":true,"listed":false,"github":"https://github.com/NLPchina/elasticsearch-analysis-ansj","clone":"git clone https://github.com/NLPchina/elasticsearch-analysis-ansj.git","description":null,"language":"Java","stars":646,"topics":["ansj","elasticsearch","ansj-elasticsearch"],"license":"Apache-2.0","category":"data-pipelines","readme_excerpt":"elasticsearch-analysis-ansj: elasticsearch 的中文分词插件 前言 elasticsearch-analysis-ansj 是一个基于 ansj 分词算法 的 elasticsearch 的中文分词插件。 编译 编译成功后，将会生成打包好的插件压缩包： target/releases/elasticsearch-analysis-ansj- -release.zip 。 安装 安装命令 在 es 安装目录下执行下面的命令安装插件： 安装完成后，会生成一个默认的配置文件： /config/elasticsearch-analysis-ansj/ansj.cfg.yml ，根据需要修改此文件即可。 测试 安装完成后，启动 es 集群。通过以下方式测试是否安装正确： 方法一： 通过 kibana 执行 GET / cat/ansj?text=中国&type=index ansj 命令，测试 index ansj 分词器，返回内容如下： 方法二： 通过 kibana 执行 GET / cat/ansj/config 命令，获取配置文件内容如下： 使用 + 第一步：创建索引 说明： + test index : 用于测试的索引名称； + test field : 用于测试的字段； + 指定字段的索引分词器为： index ansj ； + 指定字段的搜索分词器为： query ansj ； 测试索引配置是否正确： + 第二步：添加数据 + 第三步：执行搜索 注意： + 上述操作语句都是在 kibana 的 dev tools 里执行的； + 上述操作语句仅在 es 8.x 版本上测试过，其它版本请根据实际情况调整。 插件功能 安装插件后，在 es 集群中会增加以下功能： 三个 analyzer: + index ansj (建议索引使用) + query ansj (建议搜索使用) + dic ansj 三个 tokenizer： + index ansj (建议索引使用) + query ansj (建议搜索使用) + dic ansj http 接口： + / cat/ansj: 执行分词 + / cat/ansj/config: 显示全部配置 + / ansj/flush/config: 刷新全部配置 + / ansj/flush/dic: 更新全部词典。包括用户自定义词典,停用词典,同义词典,歧义词典,crf 配置文件 配置文件格式 配置文件示例 使用本地文件词库 使用 HTTP 协议加载词库 插件版本与 ES 版本的对应关系 plugin elasticsearch --------- -----: 1.0.0 0.90.2 1.x 1.x 2.1.1 2.1.1 2.3.1 2.3.1 2.3.2 2.3.2 2.3.3 2.3.3 2.3.4 2.3.4 2.3.5 2.3.5 2.4.0 2.4.0 2.4.1 2.4.1 2.4.2 2.4.2 2.4.3 2.4.3 2.4.4 2.4.4 2.4.5 2.4.5 2.4.6 2.4.6 5.0.0 5.0.0 5.0.1 5.0.1 5.0.2 5.0.2 5.1.1 5.1.1 5.1.2 5.1.2 5.2.0 5.2.0 5.2.1 5.2.1 5.2.2 5.2.2 5.3.0 5.3.0 5.3.1 5.3.1 5.3.2 5.3.2 5.3.3 5.3.3 5.4.0 5.4.0 5.4.1 5.4.1 5.4.2 5.4.2 5.4","default_branch":null,"files":null,"tree":[],"storefront":"/r/NLPchina","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/NLPchina/elasticsearch-analysis-ansj/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}