From 11f1a7b47817b55e76fcce72371f787186ba2db0 Mon Sep 17 00:00:00 2001 From: Rahul Lokurte <81438015+rahulmlokurte@users.noreply.github.com> Date: Sat, 3 Apr 2021 00:13:51 +0530 Subject: [PATCH] Types are in the process of being removed. RestClientConfig should use only index as the types are being deprecated. --- src/main/asciidoc/reference/elasticsearch-clients.adoc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/asciidoc/reference/elasticsearch-clients.adoc b/src/main/asciidoc/reference/elasticsearch-clients.adoc index 62f5a23f8..974bbf3cd 100644 --- a/src/main/asciidoc/reference/elasticsearch-clients.adoc +++ b/src/main/asciidoc/reference/elasticsearch-clients.adoc @@ -85,11 +85,12 @@ public class RestClientConfig extends AbstractElasticsearchConfiguration { // ... -IndexRequest request = new IndexRequest("spring-data", "elasticsearch", randomID()) +IndexRequest request = new IndexRequest("spring-data") + .id(randomID()) .source(singletonMap("feature", "high-level-rest-client")) .setRefreshPolicy(IMMEDIATE); -IndexResponse response = highLevelClient.index(request); +IndexResponse response = highLevelClient.index(request,RequestOptions.DEFAULT); ---- <1> Use the builder to provide cluster addresses, set default `HttpHeaders` or enable SSL. <2> Create the RestHighLevelClient.