Improve SearchStatsTests

Added refresh to guarantee that at least something will be fetched on a fast computer.
This commit is contained in:
Igor Motov 2013-01-31 20:57:38 -05:00
parent ca635deb36
commit 45b2bff8da
1 changed files with 6 additions and 1 deletions

View File

@ -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();
}