mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-30 10:23:41 -04:00
[TEST] Profile flag needs to be set, ensure searches go against primary only for consistency
This commit is contained in:
parent
4d602d8ad1
commit
9b29d6823a
1 changed files with 4 additions and 4 deletions
|
@ -125,13 +125,15 @@ public class QueryProfilerIT extends ESIntegTestCase {
|
||||||
.setProfile(false)
|
.setProfile(false)
|
||||||
.addSort("_score", SortOrder.DESC)
|
.addSort("_score", SortOrder.DESC)
|
||||||
.addSort("_uid", SortOrder.ASC)
|
.addSort("_uid", SortOrder.ASC)
|
||||||
|
.setPreference("_primary")
|
||||||
.setSearchType(SearchType.QUERY_THEN_FETCH);
|
.setSearchType(SearchType.QUERY_THEN_FETCH);
|
||||||
|
|
||||||
SearchRequestBuilder profile = client().prepareSearch("test")
|
SearchRequestBuilder profile = client().prepareSearch("test")
|
||||||
.setQuery(q)
|
.setQuery(q)
|
||||||
.setProfile(false)
|
.setProfile(true)
|
||||||
.addSort("_score", SortOrder.DESC)
|
.addSort("_score", SortOrder.DESC)
|
||||||
.addSort("_uid", SortOrder.ASC)
|
.addSort("_uid", SortOrder.ASC)
|
||||||
|
.setPreference("_primary")
|
||||||
.setSearchType(SearchType.QUERY_THEN_FETCH);
|
.setSearchType(SearchType.QUERY_THEN_FETCH);
|
||||||
|
|
||||||
MultiSearchResponse.Item[] responses = client().prepareMultiSearch()
|
MultiSearchResponse.Item[] responses = client().prepareMultiSearch()
|
||||||
|
@ -160,9 +162,7 @@ public class QueryProfilerIT extends ESIntegTestCase {
|
||||||
|
|
||||||
for (int j = 0; j < vanillaHits.length; j++) {
|
for (int j = 0; j < vanillaHits.length; j++) {
|
||||||
assertThat("Profile hit #" + j + " has a different ID from Vanilla",
|
assertThat("Profile hit #" + j + " has a different ID from Vanilla",
|
||||||
vanillaHits[j].getId(), equalTo(profileHits[j].getId()));
|
vanillaHits[j].getId(), equalTo(profileHits[j].getId()));
|
||||||
//assertTrue("Profile hit #" + j + "'s score [" + profileHits[j].getScore() + "] is not close to Vanilla [" + vanillaHits[j].getScore() + "]",
|
|
||||||
// nearlyEqual(vanillaHits[j].getScore(), profileHits[j].getScore(), 0.001));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue