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 aborting request if index missing #3267

Closed
clintongormley opened this Issue Jun 30, 2013 · 0 comments

Comments

Projects
None yet
2 participants
@clintongormley
Copy link
Member

clintongormley commented Jun 30, 2013

mget returns an error for each doc if the type or id is not found, but throws a top-level error if the index is not found. This seems inconsistent:

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

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

# {
#    "docs" : [
#       {
#          "_index" : "test_1",
#          "_id" : "2",
#          "_type" : "test",
#          "exists" : false
#       },
#       {
#          "_index" : "test_1",
#          "_id" : "1",
#          "_type" : "none",
#          "exists" : false
#       },
#       {
#          "_source" : {
#             "foo" : "bar"
#          },
#          "_index" : "test_1",
#          "_id" : "1",
#          "_type" : "test",
#          "exists" : true,
#          "_version" : 1
#       }
#    ]
# }

curl -XGET 'localhost:9200/_mget?pretty=1'  -d '
{
   "docs" : [
      {
         "_index" : "test_1",
         "_id" : "2",
         "_type" : "test"
      },
      {
         "_index" : "test_2",
         "_id" : "1",
         "_type" : "test"
      },
      {
         "_index" : "test_1",
         "_id" : "1",
         "_type" : "none"
      },
      {
         "_index" : "test_1",
         "_id" : "1",
         "_type" : "test"
      }
   ]
}
'

# {
#    "status" : 404,
#    "error" : "IndexMissingException[[test_2] missing]"
# }

@ghost ghost assigned spinscale Jul 1, 2013

@spinscale spinscale closed this in 7790d2b Jul 1, 2013

spinscale added a commit that referenced this issue Jul 1, 2013

Stop aborting of multiget requests in case of missing index
The MultiGet API stops with a IndexMissingException, if only one of all
requests tries to access a non existing index. This patch creates a
failure for this item without failing the whole request.

Closes #3267

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015

Stop aborting of multiget requests in case of missing index
The MultiGet API stops with a IndexMissingException, if only one of all
requests tries to access a non existing index. This patch creates a
failure for this item without failing the whole request.

Closes elastic#3267
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.