Hi there,
I'm trying to build a plugin for Elasticsearch, but I have to tell the documentation is very thin .
Basically all we have is an example plugin in the ES core, but that doesn't say how to build, how to start from scratch, what are the best practices...
For example @dadoonet started an awesome tutorial about creating an Ingest plugin, but it's about Maven. As far as I understand, Gradle is the new standard in ES, so I tried to stick with it.
As I do not know the modern Java ecosystem, I had a really hard time figuring out how to make everything works. You can see my code here: https://github.com/jolicode/emoji-search/tree/esplugin/esplugin (it's in a branch ),
Anyway, here are my questions:
What are the release guidelines?
I read somewhere that since 5.0, plugin authors must release a new version of their plugins every-time Elasticsearch bump a version, is that correct? Even if nothing changes in the plugin?
How to declare conflicts?
My plugin require the latest ICU (58.1) and I have no idea what will happens if an user try to enable both my plugin (ICU 58.1) and the official analysis-icu plugin (ICU 54.1). Maybe I can declare that my plugin should not be enabled alongside analysis-icu? Or will it works ok to have two modules loading their own versions of ICU?
And is it possible to just extend the core analysis-icu plugin? That way my plugin could just add new tokenizer on top of it?
How to test a new tokenizer?
My test class is pretty simple, at the beginning I was trying to setup the same tests than the icu_tokenizer, but I never managed to get createTestAnalysis
method to works, as seen here: https://github.com/elastic/elasticsearch/blob/master/plugins/analysis-icu/src/test/java/org/elasticsearch/index/analysis/IcuTokenizerFactoryTests.java#L103
Is there a magic I didn't see to import this method in the tests?
Any idea to make this code less ugly?
If you check out the code you will see that I'm loading ICU RuleBasedBreakIterator, I get the default rules, and I edit them with a String.replace
...
I looked at the code, but didn't find a better way to have the default rules + my edits in place
That's it,
thanks for your time! I will probably write a blog post about this whole process as it's a first for me and some steps are really not obvious
Cheers