Writing a plugin over Elasticsearch


(Abhilash Bolla) #1

Hi,

I been searching all over Google to get started with writing a plugin on Elasticsearch 5. I haven't been able to find material substantial material for the same. Please assist on the same.

Thanks


(Ivan Brusic) #2

The best approach is to look at other existing plugins. The github repo has
a few: https://github.com/elastic/elasticsearch/tree/master/plugins/examples

The example plugins are written for 6.x, but little has changed since 5.x.
At the Java code level, everything should be the same. Both version use the
new gradle build system, but there have been a few bug fixes throughout 5.x
into 6.x. I documented some of the changes in a minimal plugin:
https://github.com/brusic/plugin-with-fixture-skeleton One big issue with
the Elasticsearch examples is that it depends on the overall gradle build,
so there are important pieces missing from the build.gradle file. Look at
non-Elastic plugins, such as the one I referenced, for insights.

I will be giving a tutorial on writing plugins this week, but it will be
very far from you. :wink:

Cheers,

Ivan


(p.) #3

yes, Ivan gave you a good hint. Look at the other plugins
e.g. https://github.com/floragunncom/search-guard/tree/ves-5.5.2-16 this one is for 5.5.2


(Ivan Brusic) #4

While it is great to also have an example of a plugin built via maven, I
would highly encourage using the gradle plugin instead. Cuts down on the
amount of work tremendously. In Elasticsearch 6.3, the directory layout of
plugins will change, but if you use the gradle plugin, you will not have to
change your code at all since the plugin will take care of the layout.


(Abhilash Bolla) #5

@Ivan Is it possible to have a video recording of the talk you are gonna deliver at this meetup on writing plugins?


(Ivan Brusic) #6

Hi Abhilash,

It is up to the organizer and/or host to have the ability to record and
distribute video, which I do not know if they have. I will happily give
consent to release any video.

My personal speaking style is not to read directly from slides, but to have
them as reference points, which means the slides by themselves are not an
ideal presentation. Still I will share them for you. The talk will not be a
deep dive, but more of an overview alongside talking about some of the
issues I have come across. You are still probably better off reading code
and asking questions. :slight_smile: The gradle plugin plugin does help alleviate many
issues, but itself had some bugs in 5.x. I recommend using 5.4+ (sadly, I
no longer remember the issues pre 5.4).


(system) #7

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.