GetMappings API using Java High Level Rest Client not working

Hi,

I am not able to execute the GetMappings request using the Java High Level Rest Client.

I am getting an error
Exception in thread "main" ElasticsearchStatusException[Elasticsearch exception [type=illegal_argument_exception, reason=request [my-index/_mapping] contains unrecognized parameter: [master_timeout]]]

GetMappingsRequest request = new GetMappingsRequest();
request.indices("my-index");

GetMappingsResponse getMappingsResponse = esClient.indices().getMapping(request, RequestOptions.DEFAULT);

I am using Amazon Elasticsearch v6 . My es java rest client version is 6.4.0

1 Like

Hi Rimal,

Is the Elastic Version of the Amazon Instance also a 6.4.0?
I had this Exception thrown when I accidentally started my Application with a ES 6.2.4 Node. The GetMappingsRequest works fine with 6.4.0.

No. The amazon es version is 6.3

But with elasticsearch-rest-high-level-client 6.3 version, I cannot find a way to execute a get mapping request.

Found a put mapping request here: https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.3/java-rest-high-put-mapping.html

But could not find how to execute a get mapping request .

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.