I am trying to connect to one of the on-prem ES system in my application. Previously it was a different cluster. Recently, our ES team migrated it to a different cluster with basic auth enabled. I have written the below code for initializing HLRC.
final BasicCredentialsProvider basicCredentialsProvider = new BasicCredentialsProvider();
basicCredentialsProvider
.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials("Username", "Password"));
RestClientBuilder builder = RestClient.builder(
new HttpHost(elasticSearchType.getHost(), 9200, "https"))
.setHttpClientConfigCallback(new RestClientBuilder.HttpClientConfigCallback() {
@Override
public HttpAsyncClientBuilder customizeHttpClient(
HttpAsyncClientBuilder httpClientBuilder) {
return httpClientBuilder
.setDefaultCredentialsProvider(basicCredentialsProvider);
}
});
return new RestHighLevelClient(builder);
I am getting the below error
reason=request [/index/_search] contains unrecognized parameters: [batched_reduce_size], [ccs_minimize_roundtrips], [ignore_throttled], [max_concurrent_shard_requests], [typed_keys]]
Could you please suggest what I need to do to connect with the on-prem ES?
Please use the same dependency as the es version. Enter http://127.0.0.1:9200/ in the browser to see the es version.