jprante / elasticsearch-plugin-bundle

A bundle of useful Elasticsearch plugins
GNU Affero General Public License v3.0
110 stars 17 forks source link

_langdetect REST Endpoint #36

Open marbleman opened 7 years ago

marbleman commented 7 years ago

Hi Jörg,

after a long time staying with ES2.3 we decided to move on to ES5.3 now. All the plugins work fine, except the _langdetect REST endpoint and I figured that even the parts of documentation I added to your langdetect Repo quite a while ago seem to be obsolete now:

GET _langdetect
{
   "text": "das ist ein test"
}

gives me

{
   "error": {
      "root_cause": [
         {
            "type": "json_generation_exception",
            "reason": "Can not write a field name, expecting a value"
         }
      ],
      "type": "json_generation_exception",
      "reason": "Can not write a field name, expecting a value"
   },
   "status": 500
}

whereas curl -XPOST 'localhost:9200/_langdetect?pretty' -d 'This is a test'

returns

{"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}

Unfortunately our code relies pretty much on the REST endpoint for checking the language before a document is indexed.

The Handler for _langdetect still exists and is accessible. So what am I missing? Can you give me a hint, please?

marbleman commented 7 years ago

no comments at all?

edudev commented 6 years ago

I've opened a new issue and described the problem and provided a fix for ES 5.3: https://github.com/jprante/elasticsearch-plugin-bundle/issues/37