Coder Social home page Coder Social logo

ky229 / elasticsearch-analysis-dynamic-synonym Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hailin0/elasticsearch-analysis-dynamic-synonym

0.0 0.0 0.0 1.1 MB

elasticsearch同义词热更新插件,支持本地文件更新,http远程文件更新,修复若干bug。

License: Apache License 2.0

Java 100.00%

elasticsearch-analysis-dynamic-synonym's Introduction

elasticsearch-analysis-dynamic-synonym

elasticsearch 5.x版本的同义词热更新插件,支持本地文件更新,http远程文件更新。

master分支为5.3.0,支持dynamic_synonym_graph(synonym_graph),有问题请提issues!

使用方法

1,部署插件:将doc/plugins/dynamic-synonym 目录放到 ${es-root}/plugins下
2,配置使用:
index:
  analysis:
	filter:
	  local_synonym: 
		  type: "dynamic_synonym"
		  synonyms_path: "analysis-dynamic-synonym/synonym.txt"
		  interval: 30
	  http_synonym: 
		  type: "dynamic_synonym"
		  synonyms_path: "http://127.0.0.1:8080/es-service-control/LoadWord/remote_ext_synonym.txt"
		  interval: 30
	analyzer:
	  ik_max_word_syno: 
		  type: custom
		  tokenizer: "ik_max_word"
		  filter: ["http_synonym"]
	  ik_smart_syno: 
		  type: custom
		  tokenizer: "ik_smart"
		  filter: ["http_synonym"]

说明

1,配置普通本地文件,设置相对目录下的文件,相对于${es-root}/config,
  更新依据为文件的最后修改时间(Modify time)变化。
  例子:synonyms_path: dynamic-synonym/synonym.txt  

2,配置远程文件,以http开头即可,更新依据为2个http响应头发生变化,
  一个是 Last-Modified,一个是 ETag,任意一个变化都会更新。
  例子:synonyms_path: http://127.0.0.1:8080/es-service-control/LoadWord/remote_ext_synonym.txt

3,设置更新时间频率:interval: 60   单位为秒,可以不写,默认值为60

4,必须编码都要求是UTF-8的文本文件

参考

es官网同义词配置页面地址点击

qq交流:568847614

elasticsearch-analysis-dynamic-synonym's People

Contributors

hailin0 avatar

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.