Run refresh before executing non realtime get

This commit is contained in:
Martijn van Groningen 2013-08-01 15:12:15 +02:00
parent a95ce1987e
commit 300db594aa
1 changed files with 4 additions and 0 deletions

View File

@ -145,6 +145,10 @@ public class SimpleTTLTests extends AbstractNodesTests {
assertThat(getResponse.isExists(), equalTo(false));
getResponse = client().prepareGet("test", "type1", "with_routing").setRouting("routing").setFields("_ttl").setRealtime(true).execute().actionGet();
assertThat(getResponse.isExists(), equalTo(false));
// Need to run a refresh, in order for the non realtime get to work.
client().admin().indices().prepareRefresh("test").execute().actionGet();
// non realtime get (stored) check
getResponse = client().prepareGet("test", "type1", "1").setFields("_ttl").setRealtime(false).execute().actionGet();
assertThat(getResponse.isExists(), equalTo(false));