Elasticsearch 5如何开始编写本机Java插件 [英] Elasticsearch 5 how to start writing a native Java plugin

查看:144
本文介绍了Elasticsearch 5如何开始编写本机Java插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试编写一个Elasticsearch插件(主要用于测试目的),我正在努力解决文档简单地声明:

I am currently trying to write an Elasticsearch plugin (mainly for testing purposes), and I am struggling with the documentation which simply states:


这些例子提供了简单的骨头需要开始。有关如何编写插件的更多信息,我们建议您查看本文档中列出的插件以获取灵感。

These examples provide the bare bones needed to get started. For more information about how to write a plugin, we recommend looking at the plugins listed in this documentation for inspiration.

所以基本上,经过找到一些教程(除了maven部分之外哪种方式不同意),请参阅 http://david.pilato.fr/blog/2016/07/27/creating-a-plugin-for-elasticsearch-5- dot-0-using-maven / http://jfarrell.github.io (他们不要继承相同的类)。

So basically, after finding a few tutorials (which kind of disagree with each other besides the maven part), see http://david.pilato.fr/blog/2016/07/27/creating-a-plugin-for-elasticsearch-5-dot-0-using-maven/ and http://jfarrell.github.io (they don't inherit the same classes).

我实际上被困在哪里开始,核心elasticsearch依赖项中有哪些组件可用,以及我应该如何加载我的插件。 (我知道我可以通过测试和复古工程来调查它,我只是想知道是否有人有关于该主题的好建议。)

I am actually stuck where to start, what components are available from the core elasticsearch dependency, and how should I load my plugin. (I know I can look into it by testing and retro engineering, I just wondered if anyone had good tips regarding the topic).

现在我的代码看起来像:

For now my code just looks like:

public class MyPlugin extends Plugin implements NativeScriptFactory{
  //overriden methods
}

我应该从哪里去?

非常感谢!

推荐答案

@asttouf

我最近写了一个EL插件2.3.x( https://github.com/betorcs/elastic-recurring-plugin)。很难找到一个文档,说明要编写它的步骤。我需要谷歌搜索一些参考资料。

I recently write a plugin to EL 2.3.x (https://github.com/betorcs/elastic-recurring-plugin). It was hard to find a documentation saying steps to follow to write it. I needed to google at lot to find some references.

我列出了一些我用作参考的项目,我希望他们可以帮助你。

I'm listing some projects I used as reference, i hope they can help you.

  • https://github.com/elastic/elasticsearch/tree/master/plugins/ingest-attachment
  • https://github.com/elastic/elasticsearch-mapper-attachments
  • https://www.elastic.co/blog/found-writing-a-plugin
  • http://www.flax.co.uk/blog/2016/01/27/fun-frustration-writing-plugin-elasticsearch-ontology-indexing/

EDI TED

更多参考资料:

  • https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-scripting-native.html
  • https://www.elastic.co/blog/writing-your-own-ingest-processor-for-elasticsearch

更新插件以支持ES 5.0,请查看 https://github.com/betorcs/elastic-recurring-plugin/tree/5.0

Plugin updated to support ES 5.0, check out https://github.com/betorcs/elastic-recurring-plugin/tree/5.0

这篇关于Elasticsearch 5如何开始编写本机Java插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆