Hi guys,
I'm a bit stuck on a problem I don't understand. I'm basically doing the following, using the Java Client API in ES 7.17:
RestClient restClient = RestClient.builder("...some url...")
.setHttpClientConfigCallback(httpClientBuilder -> httpClientBuilder
.useSystemProperties()
.build();
this.transport = new RestClientTransport(
restClient, new JacksonJsonpMapper());
this.client = new ElasticsearchClient(this.transport);
...
client.index(builder -> builder
.index(ElasticsearchClientManager.INDEX)
.document(ping)
);
...
SearchResponse<Ping> search = client.search(s -> s
.index(ElasticsearchClientManager.INDEX)
, Ping.class);
//Thread.sleep(10000L);
assertEquals(1, search.hits().hits().size());
As you can see I'm not using an Async Client. Yet the assertEquals fails (I get 0 hits). And that's true even if I uncomment the Thread.sleep()
line.
However, if I put a breakpoint in my IDE on the assertEquals line and go through it, it works.
Any clue for me?
Thanks!