Below code returned a timeout in client (Elasticsearch Client) when number of records are higher.
CompletableFuture future = new C