Skip to content
This repository was archived by the owner on Dec 18, 2021. It is now read-only.

Seems like landdetect 5.3 does not work or documentation has incorrect examples #59

Closed
lexand opened this issue Apr 1, 2017 · 6 comments

Comments

@lexand
Copy link

lexand commented Apr 1, 2017

My config
ES:

$ curl -XGET http://127.0.0.1:9200
{
  "name" : "D8Tv5qq",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "56FxolywSQW5Xx4WzxI0mg",
  "version" : {
    "number" : "5.3.0",
    "build_hash" : "3adb13b",
    "build_date" : "2017-03-23T03:31:50.652Z",
    "build_snapshot" : false,
    "lucene_version" : "6.4.1"
  },
  "tagline" : "You Know, for Search"
}

Kibana 5.3
and plugins

GET _cat/plugins
D8Tv5qq analysis-icu        5.3.0
D8Tv5qq analysis-morphology 5.3.0
D8Tv5qq langdetect          5.3.0.0

my tryes

  • from Kibana
GET or POST _langdetect 
{
  "text": "das ist ein test"
}

{
  "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
}
  • from cURL
$ curl -XPOST http://127.0.0.1:9200/_langdetect -d '{"text":"some text"}'
{"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}

$ curl -XGET http://127.0.0.1:9200/_langdetect -d '{"text":"some text"}'
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"No endpoint or operation is available at [_langdetect]"}],"type":"illegal_argument_exception","reason":"No endpoint or operation is available at [_langdetect]"},"status":400}

$ curl -XGET http://127.0.0.1:9200/_langdetect -d 'some text'
{"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}

$curl -XPOST http://127.0.0.1:9200/_langdetect -d 'some text'
{"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}

so maybe I'm doing somewhat wrong ?
Please help.

regards
Alex

@jprante
Copy link
Owner

jprante commented Apr 1, 2017

Thanks for the report.

There is a REST endpoint problem. I will look into it.

@jprante
Copy link
Owner

jprante commented Apr 1, 2017

I think version 5.3.0.1 will fix the issue.

@lexand
Copy link
Author

lexand commented Apr 3, 2017

Thanks

all works fine

@lexand lexand closed this as completed Apr 3, 2017
@esen
Copy link

esen commented May 3, 2017

The same is happening with version 5.3.2.0

@jprante
Copy link
Owner

jprante commented May 3, 2017

The command

curl -XPOST http://127.0.0.1:9200/_langdetect -d '{"text":"this is a short text"}'

works with 5.3.2.0

@esen
Copy link

esen commented May 4, 2017

Oh, I'm sorry. Thanks, it works that way.

The following doesn't work:

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

which is on in Readme file
https://github.com/jprante/elasticsearch-langdetect#language-detection-rest-api-example

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants