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: the fields parameter should accept a string #3270

Closed
clintongormley opened this Issue Jun 30, 2013 · 1 comment

Comments

Projects
None yet
2 participants
@clintongormley
Member

clintongormley commented Jun 30, 2013

The fields parameter in the mget API only accepts an array of field names - it should accept a single string, like it does for the search API:

curl -XPUT 'localhost:9200/test_1/test/1?pretty=1'  -d '
{
   "foo" : "bar"
}
'

curl -XGET 'localhost:9200/_cluster/health?wait_for_status=yellow&pretty=1'

curl -XGET 'localhost:9200/test_1/test/_mget?pretty=1'  -d '
{
   "docs" : [
      {
         "fields" : "foo",
         "_id" : "1"
      },
      {
         "fields" : [
            "foo"
         ],
         "_id" : "1"
      }
   ]
}
'

# {
#    "docs" : [
#       {
#          "_source" : {
#             "foo" : "bar"
#          },
#          "_index" : "test_1",
#          "_id" : "1",
#          "_type" : "test",
#          "exists" : true,
#          "_version" : 1
#       },
#       {
#          "fields" : {
#             "foo" : "bar"
#          },
#          "_index" : "test_1",
#          "_id" : "1",
#          "_type" : "test",
#          "exists" : true,
#          "_version" : 1
#       }
#    ]
# }
@spinscale

This comment has been minimized.

Show comment
Hide comment
@spinscale

spinscale Jul 2, 2013

Member

Committed in master 9ce0156 and 0.90 branches 15c81cd

Member

spinscale commented Jul 2, 2013

Committed in master 9ce0156 and 0.90 branches 15c81cd

@spinscale spinscale closed this Jul 2, 2013

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