Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analyze API returns in YAML format if analyzed string begins with --- #2624

Closed
lennartkoopmann opened this issue Feb 6, 2013 · 3 comments
Closed
Assignees

Comments

@lennartkoopmann
Copy link

$ curl -XGET 'http://127.0.0.1:9200/_analyze?analyzer=standard' -d 'this is a test'
{"tokens":[{"token":"test","start_offset":10,"end_offset":14,"type":"<ALPHANUM>","position":4}]}

$ curl -XGET 'http://127.0.0.1:9200/_analyze?analyzer=standard' -d '---this is a test'

---
tokens:
- token: "test"
  start_offset: 13
  end_offset: 17
  type: "<ALPHANUM>"
  position: 4

Version:

$ curl -XGET 'http://127.0.0.1:9200/'
{
  "ok" : true,
  "status" : 200,
  "name" : "Multiple Man",
  "version" : {
    "number" : "0.20.4",
    "snapshot_build" : false
  },
  "tagline" : "You Know, for Search"
}
@s1monw
Copy link
Contributor

s1monw commented Mar 1, 2013

what is the rational behind this? I think you should be free to pass anything to this api. I can see people passing lucene query syntax to it and expect json like "-foo:bar +bar:foo"

@ghost ghost assigned s1monw Mar 1, 2013
@kimchy
Copy link
Member

kimchy commented Mar 1, 2013

we autodetect the content type to return based on the format of the request body, --- is a representation of yaml, so we send it back in yaml. We should disable this behavior for the analyze APi, will fix it shortly.

@kimchy kimchy closed this as completed in 2eea992 Mar 1, 2013
@lennartkoopmann
Copy link
Author

Thanks!

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

No branches or pull requests

3 participants