jprante / elasticsearch-plugin-bundle

A bundle of useful Elasticsearch plugins

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

_langdetect REST Endpoint

marbleman opened this issue · comments

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?

no comments at all?

I've opened a new issue and described the problem and provided a fix for ES 5.3: #37