mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 10:25:15 +00:00
wait for yellow status before searching
This commit is contained in:
parent
6585b09de6
commit
1fd5a48409
@ -323,6 +323,9 @@ public class SimpleQueryTests extends AbstractNodesTests {
|
|||||||
client.admin().indices().prepareDelete().execute().actionGet();
|
client.admin().indices().prepareDelete().execute().actionGet();
|
||||||
|
|
||||||
client.prepareIndex("test", "type1", "1").setSource("field1", "value1").execute().actionGet();
|
client.prepareIndex("test", "type1", "1").setSource("field1", "value1").execute().actionGet();
|
||||||
|
|
||||||
|
client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet();
|
||||||
|
|
||||||
client.admin().indices().prepareRefresh().execute().actionGet();
|
client.admin().indices().prepareRefresh().execute().actionGet();
|
||||||
|
|
||||||
SearchResponse searchResponse = client.prepareSearch("test").setQuery(constantScoreQuery(termsFilter("field1", "value1").cacheKey("test1"))).execute().actionGet();
|
SearchResponse searchResponse = client.prepareSearch("test").setQuery(constantScoreQuery(termsFilter("field1", "value1").cacheKey("test1"))).execute().actionGet();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user