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

Explain API does not support POST #2710

Closed
polyfractal opened this issue Feb 28, 2013 · 2 comments
Closed

Explain API does not support POST #2710

polyfractal opened this issue Feb 28, 2013 · 2 comments

Comments

@polyfractal
Copy link
Contributor

It looks like the Explain API does not support POST requests, which means that certain clients will be unable to utilize it since they don't support GET with request bodies (notably javascript clients).

Any chance of adding POST support to Explain like we have for the other GET methods?

Demonstration, on 0.20.5:

$ curl -XGET localhost:9200/test/benchmark/Yju6VrbaTUauZVMXhU5IBw/_explain?pretty -d '{
  "query":{
    "match":{
      "field1":"pattern"
    }
  }
}'

{
  "ok" : true,
  "_index" : "test",
  "_type" : "benchmark",
  "_id" : "Yju6VrbaTUauZVMXhU5IBw",
  "matched" : true,
  "explanation" : {
    "value" : 0.33165708,
    "description" : "weight(field1:pattern in 26), product of:",
    "details" : [ {
      "value" : 0.99999994,
      "description" : "queryWeight(field1:pattern), product of:",
      "details" : [ {
        "value" : 3.5376759,
        "description" : "idf(docFreq=263631, maxDocs=3335007)"
      }, {
        "value" : 0.28267145,
        "description" : "queryNorm"
      } ]
    }, {
      "value" : 0.3316571,
      "description" : "fieldWeight(field1:pattern in 26), product of:",
      "details" : [ {
        "value" : 1.0,
        "description" : "tf(termFreq(field1:pattern)=1)"
      }, {
        "value" : 3.5376759,
        "description" : "idf(docFreq=263631, maxDocs=3335007)"
      }, {
        "value" : 0.09375,
        "description" : "fieldNorm(field=field1, doc=26)"
      } ]
    } ]
  }



$ curl -XPOST localhost:9200/test/benchmark/Yju6VrbaTUauZVMXhU5IBw/_explain?pretty -d '{
  "query":{
    "match":{
      "field1":"pattern"
    }
  }
}'

No handler found for uri [/test/benchmark/Yju6VrbaTUauZVMXhU5IBw/_explain?pretty] and method [POST]
@martijnvg
Copy link
Member

Yes, it makes sense to add this.

@s1monw s1monw closed this as completed in b4b3e35 Feb 28, 2013
@polyfractal
Copy link
Contributor Author

Great, thanks!

s1monw added a commit that referenced this issue Mar 3, 2013
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
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