HI
Elasticsearch 6.2
High level client
//opening
I have the following error with this error :
Error : Exception in thread "main" java.lang.NoSuchFieldError: FAIL_ON_SYMBOL_HASH_OVERFLOW
//tag::migration-request-ctor
IndexRequest request = new IndexRequest("index", "doc", "id"); // <1>
request.source("{\"field\":\"value\"}", XContentType.JSON);
//end::migration-request-ctor
//tag::migration-request-ctor-execution
IndexResponse response = client.index(request);
//this code for opening the host :
RestClientBuilder builder = RestClient.builder(new HttpHost("localhost", 9200, "http"));
Header[] defaultHeaders = new Header[]{new BasicHeader("header", "value")};
builder.setDefaultHeaders(defaultHeaders);
RestClient lowLevelRestClient = RestClient.builder(
new HttpHost("localhost", 9200, "http")).build();;
client =new RestHighLevelClient(lowLevelRestClient);