Assert on failures in QueryRescorerTests
This commit is contained in:
parent
6b52391dbd
commit
ce891e93b6
|
@ -162,6 +162,8 @@ public class QueryRescorerTests extends AbstractIntegrationTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final void assertEquivalent(SearchResponse plain, SearchResponse rescored) {
|
private static final void assertEquivalent(SearchResponse plain, SearchResponse rescored) {
|
||||||
|
assertNoFailures(plain);
|
||||||
|
assertNoFailures(rescored);
|
||||||
SearchHits leftHits = plain.getHits();
|
SearchHits leftHits = plain.getHits();
|
||||||
SearchHits rightHits = rescored.getHits();
|
SearchHits rightHits = rescored.getHits();
|
||||||
assertThat(leftHits.getTotalHits(), equalTo(rightHits.getTotalHits()));
|
assertThat(leftHits.getTotalHits(), equalTo(rightHits.getTotalHits()));
|
||||||
|
@ -199,7 +201,7 @@ public class QueryRescorerTests extends AbstractIntegrationTest {
|
||||||
.field("analyzer", "whitespace").field("type", "string").endObject().endObject().endObject().endObject())
|
.field("analyzer", "whitespace").field("type", "string").endObject().endObject().endObject().endObject())
|
||||||
.setSettings(ImmutableSettings.settingsBuilder()).execute().actionGet();
|
.setSettings(ImmutableSettings.settingsBuilder()).execute().actionGet();
|
||||||
ensureGreen();
|
ensureGreen();
|
||||||
int numDocs = 1000;
|
int numDocs = atLeast(100);
|
||||||
|
|
||||||
for (int i = 0; i < numDocs; i++) {
|
for (int i = 0; i < numDocs; i++) {
|
||||||
client().prepareIndex("test", "type1", String.valueOf(i)).setSource("field1", English.intToEnglish(i)).execute().actionGet();
|
client().prepareIndex("test", "type1", String.valueOf(i)).setSource("field1", English.intToEnglish(i)).execute().actionGet();
|
||||||
|
@ -209,8 +211,9 @@ public class QueryRescorerTests extends AbstractIntegrationTest {
|
||||||
optimize(); // make sure we don't have a background merge running
|
optimize(); // make sure we don't have a background merge running
|
||||||
refresh();
|
refresh();
|
||||||
ensureGreen();
|
ensureGreen();
|
||||||
for (int i = 0; i < numDocs; i++) {
|
final int iters = atLeast(50);
|
||||||
String intToEnglish = English.intToEnglish(i);
|
for (int i = 0; i < iters; i++) {
|
||||||
|
String intToEnglish = English.intToEnglish(between(0, numDocs-1));
|
||||||
String query = intToEnglish.split(" ")[0];
|
String query = intToEnglish.split(" ")[0];
|
||||||
SearchResponse rescored = client()
|
SearchResponse rescored = client()
|
||||||
.prepareSearch()
|
.prepareSearch()
|
||||||
|
|
Loading…
Reference in New Issue