Created
August 7, 2012 23:22
-
-
Save lmader/3290485 to your computer and use it in GitHub Desktop.
shardFailures in SearchResponse showing from previous query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Steps to repro issue with the shardFailures array showing msgs from a previous (not current) query: | |
1) create something | |
curl -XPUT localhost:9200/acme/blog/1111 -d '{"message":"foo"}' | |
2) execute this query, it should succeed | |
curl -XGET localhost:9200/acme/blog/_search -d '{"query":{"field":{"message":"foo"}}}' | |
3) this is an invalid query and is expected to fail | |
curl -XGET localhost:9200/acme/blog/_search -d '{"foobar":{"message":"foo"}}' | |
4) now rerun the query from step 2. This query succeeds, and returns the hits, but also shows the shardFailures from the failed query in step 3 | |
curl -XGET localhost:9200/acme/blog/_search -d '{"query":{"field":{"message":"foo"}}}' | |
Here is the expected output from step 4) : | |
{"took":3,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0,"failures":[{"index":"acme","shard":1,"status":400,"reason":"SearchParseException[[acme][1]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\"foobar\":{\"message\":\"foo\"}}]]]; nested: SearchParseException[[acme][1]: from[-1],size[-1]: Parse Failure [No parser for element [foobar]]]; "},{"index":"acme","shard":0,"status":400,"reason":"SearchParseException[[acme][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\"foobar\":{\"message\":\"foo\"}}]]]; nested: SearchParseException[[acme][0]: from[-1],size[-1]: Parse Failure [No parser for element [foobar]]]; "},{"index":"acme","shard":4,"status":400,"reason":"SearchParseException[[acme][4]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\"foobar\":{\"message\":\"foo\"}}]]]; nested: SearchParseException[[acme][4]: from[-1],size[-1]: Parse Failure [No parser for element [foobar]]]; "}]},"hits":{"total":1,"max_score":1.6931472,"hits":[{"_index":"acme","_type":"blog","_id":"1111","_score":1.6931472, "_source" : {"message" : "foo" }}]}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment