jprante / elasticsearch-plugin-bundle

A bundle of useful Elasticsearch plugins

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

langdetect REST endpoint & test fixes for 5.3.3

edudev opened this issue · comments

I've forked this project and fixed some issues: https://github.com/edudev/elasticsearch-plugin-bundle/tree/5.3

The fixes are as follows:

  • FstDecompounder::createGlueMorphemes made changes to the passed parameter, which may be FstDecompounder::morphemes. This results in the morphemes sometimes being [e, n, ne, re, s, se, sn, sne] and sometimes being [e, en, ens, er, es, n, ns, s]. Making changes to a passed parameter is mostly not a good idea so my change simply works with a copy of this glue string array;
  • The documentation for the langdetect REST API was incorrect. The API was changed when the plugin was updated to 5.3.0, but no changes were made to the docs;
  • With the update to 5.3.0 the ActionResponse::toXContent method was updated accordingly, but the changes were not reflected in LangdetectResponse::toXContent;
  • With the update to 5.3.0 endpoints for /_isbn/{value} and /_langdetect/{profile} were added, but they simply can't be reached. If a request is made to one of them, Elasticsearch simple treats _isbn or _langdetect as an index;
  • I've added tests for the above bugfixes - the tests pass with my changes but fail without them;

I've applied the above fixes for Elasticsearch 5.3.3, but don't have the resources (time) to apply these bugfixes to the other versions, nor do I know if other versions are affected by these bugs.
I can't submit a pull request as there is no branch for version 5.3.X of the plugin. My changes are on top of tag 5.3.1.0.

P.S. I'd be glad to make a pull request if @jprante can make a 5.3 branch of tag 5.3.1.0.