插件開發(fā)參考:
插件開發(fā)說明:https://www.elastic.co/blog/found-writing-a-plugin
這個說明是比較老的說明,我要開發(fā)的是elasticsearch 2.1.1版本的插件,因此參考2.1.1版本插件的開發(fā)方法
例如,可參考ik插件的v1.7.0版本,這個版本對應(yīng)的是elasticsearch 2.1.1版本:https://github.com/medcl/elasticsearch-analysis-ik.git
這里面主要參考其pom.xml結(jié)構(gòu),源代碼結(jié)構(gòu),類地繼承結(jié)構(gòu)等。
最終產(chǎn)生的項目:https://github.com/ggchangan/elasticsearch-example-plugin
git clone git@github.com:ggchangan/elasticsearch-example-plugin.git
插件安裝:
bin/plugin install file:///home/magneto/OpenSource/example-plugin/target/releases/example-plugin-1.0-SNAPSHOT.zip
插件運行:
curl localhost:9200/_hello
curl localhost:9200/_hello?who=Elasticsearch