Hi Team,
We do own 2 AWS Elasticsearch clusters, out of which one got upgraded to 7.1 version while the latter is still on 6.8 version. We did scala code changes to accommodate this upgradation(as our existing jobs were failing with unsupported version error with the new 7.x cluster). Post the code change, we were planning the code built using new maven dependency against the cluster running with 6.8 version. But the update jobs on index failed with the **"{"error":{"root_cause":[{"type":"invalid_type_name_exception","reason":"Document mapping type name can't start with '_', found: [_update]"}],"type":"invalid_type_name_exception","reason":"Document mapping type name can't start with '_', found: [_update]"},"status":400}"**
Maven Dependency
org.elasticsearch.client
elasticsearch-rest-high-level-client
7.5.1
The error is obvious as the POST calls made using 7.5.1 and 6.8 versions are quite different as follows:
W.r.t ES 7.5.1 => POST test/_update/1
W.r.t ES 6.8 => POST test/_doc/1/_update
ES 6.8 cluster is expecting _doc keyword in the URL which is not supported in 7.5.1. Is there any way we can reuse the code by switching the api version while making the call?