I see that there is a lot of similarities among different ES Highlevel REST versions in terms the api signature and data models
https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-high.html. However they require use to have different version of jar file. Is there any open source and version independent library that I can use to complete hide the version dependent model from my code?
For example, I am looking for a generic interface that I can use directly in my code without pointing to any version specific jar file.
Interface ElasticSearchHighLevelClient{
BulkResponse bulk(BulkRequest request);
}
class ElasticSearchHighLevelClient6 implements ElasticSearchHighLevelClient{
BulkResponse bulk(BulkRequest request){
return ES 6 specific output;
}
}
class ElasticSearchHighLevelClient7 implements ElasticSearchHighLevelClient{
BulkResponse bulk(BulkRequest request){
return ES 7 specific output;
}
}
Is that a bad idea to create such abstraction? If yes why did not ES created such a library?