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

mget REST API should support source parameter #4893

Closed
wants to merge 2 commits into from

Conversation

dadoonet
Copy link
Member

As stated in documentation, we should support ?source= parameter in mget REST operations.

This is how to reproduce it:

curl -XDELETE "http://localhost:9200/test"

curl -XPOST "http://localhost:9200/test/type/1?refresh" -d'{
    "foo": "bar"
}'

# This one works
curl -XPOST "http://localhost:9200/test/type/_mget" -d'{
    "ids": ["1"]
}'

# This one gives: {"error":"Failed to derive xcontent from org.elasticsearch.common.bytes.BytesArray@0"}
curl -XGET "http://localhost:9200/test/type/_mget?source=%7B%22ids%22%3A%20%5B%221%22%5D%7D"

Closes #4892.

As stated in documentation, we should support `?source=` parameter in mget REST operations.

This is how to reproduce it:

```sh
curl -XDELETE "http://localhost:9200/test"

curl -XPOST "http://localhost:9200/test/type/1?refresh" -d'{
    "foo": "bar"
}'

# This one works
curl -XPOST "http://localhost:9200/test/type/_mget" -d'{
    "ids": ["1"]
}'

# This one gives: {"error":"Failed to derive xcontent from org.elasticsearch.common.bytes.BytesArray@0"}
curl -XGET "http://localhost:9200/test/type/_mget?source=%7B%22ids%22%3A%20%5B%221%22%5D%7D"
```

Closes elastic#4892.
@s1monw
Copy link
Contributor

s1monw commented Jan 27, 2014

@dadoonet can we have a REST spec / test for this as well? Would be great!

otherwise looks great

@s1monw
Copy link
Contributor

s1monw commented Jan 27, 2014

awesome LGTM lets fix that on all applicable branches

@@ -48,7 +52,7 @@
},
"body": {
"description" : "Document identifiers; can be either `docs` (containing full document information) or `ids` (when index and type is provided in the URL.",
"required" : true
"required" : false

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should still be true. The "body" can be provided to ES in different ways, one of which is the source parameter.

@dadoonet
Copy link
Member Author

Fixed in 0.90, 1.0, 1.x and master branch (2.0)

@dadoonet dadoonet closed this Jan 27, 2014
@dadoonet dadoonet deleted the issue/4892-multigetsource branch January 27, 2014 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mget REST API should support source parameter
3 participants