Skip to content

Commit

Permalink
report details if shard response has failed shards
Browse files Browse the repository at this point in the history
  • Loading branch information
s1monw committed Jun 5, 2013
1 parent aa1a52d commit 59eed46
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.nullValue;


import java.io.IOException;
import java.util.ArrayList;
Expand Down Expand Up @@ -790,16 +792,14 @@ public void testIgnoreUnmapped() throws Exception {
.field("i_value", -1)
.field("d_value", -1.1)
.endObject()).execute().actionGet();

client().admin().cluster().prepareHealth().setWaitForEvents(Priority.LANGUID).setWaitForYellowStatus().execute().actionGet();

ensureYellow();
logger.info("--> sort with an unmapped field, verify it fails");
try {
client().prepareSearch()
SearchResponse result = client().prepareSearch()
.setQuery(matchAllQuery())
.addSort(SortBuilders.fieldSort("kkk"))
.execute().actionGet();
assert false;
assertThat("Expected exception but returned with", result, nullValue());
} catch (SearchPhaseExecutionException e) {

}
Expand All @@ -808,8 +808,7 @@ public void testIgnoreUnmapped() throws Exception {
.setQuery(matchAllQuery())
.addSort(SortBuilders.fieldSort("kkk").ignoreUnmapped(true))
.execute().actionGet();

assertThat(searchResponse.getFailedShards(), equalTo(0));
assertNoFailures(searchResponse);
}

@Test
Expand Down

0 comments on commit 59eed46

Please sign in to comment.