[TEST] fixed SimpleQueryTests#testMultiMatchQuery check for shard failures
It can happen that not all shards are ready, thus we won't have a total failure, but we do need to check that we have at least a failure. Checked also the message of the failure.
This commit is contained in:
parent
7703183cef
commit
5378fd7901
|
@ -728,12 +728,10 @@ public class SimpleQueryTests extends ElasticsearchIntegrationTest {
|
|||
refresh();
|
||||
|
||||
builder = multiMatchQuery("value1", "field1", "field2", "field4");
|
||||
try {
|
||||
client().prepareSearch().setQuery(builder).get();
|
||||
fail("Exception expected");
|
||||
} catch (SearchPhaseExecutionException e) {
|
||||
assertThat(e.shardFailures()[0].status(), equalTo(RestStatus.BAD_REQUEST));
|
||||
}
|
||||
|
||||
assertFailures(client().prepareSearch().setQuery(builder),
|
||||
RestStatus.BAD_REQUEST,
|
||||
containsString("NumberFormatException[For input string: \"value1\"]"));
|
||||
|
||||
builder.lenient(true);
|
||||
searchResponse = client().prepareSearch().setQuery(builder).get();
|
||||
|
|
Loading…
Reference in New Issue