Improve SearchStatsTests
Added refresh to guarantee that at least something will be fetched on a fast computer.
This commit is contained in:
parent
ca635deb36
commit
45b2bff8da
|
@ -63,11 +63,16 @@ public class SearchStatsTests extends AbstractNodesTests {
|
|||
|
||||
for (int i = 0; i < 500; i++) {
|
||||
client.prepareIndex("test1", "type", Integer.toString(i)).setSource("field", "value").execute().actionGet();
|
||||
if (i == 10) {
|
||||
client.admin().indices().prepareRefresh("test1").execute().actionGet();
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < 500; i++) {
|
||||
client.prepareIndex("test2", "type", Integer.toString(i)).setSource("field", "value").execute().actionGet();
|
||||
if (i == 10) {
|
||||
client.admin().indices().prepareRefresh("test1").execute().actionGet();
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 200; i++) {
|
||||
client.prepareSearch().setQuery(QueryBuilders.termQuery("field", "value")).setStats("group1", "group2").execute().actionGet();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue