senacor / elasticsearch-evolution

A library to migrate elasticsearch mappings. Inspired by flyway.
Apache License 2.0
76 stars 14 forks source link

Plans to support OpenSearch RestClient? #198

Open sameer-b opened 1 year ago

sameer-b commented 1 year ago

Hello, Thanks for your hard work on this library! I'm trying to use it with OpenSearch, for now the ElasticSearch RestClient should work fine. But I'm curious if you have any plans to support the OpenSearch RestClient?

S1riU5 commented 1 year ago

Hey @sameer-b,

not sure if there is any plan to incorporate the OpenSearch rest client directly, but maybe it makes sense to offer an api to provide a custom client and configure the client inside your application. I can create a PR with an initial idea as a basis for discussions. @xtermi2 feel free to decline it if it does not fit into the overall goals.

sameer-b commented 1 year ago

@S1riU5 That would be ideal! Since we are moving to opensearch from elasticsearch our goal is to avoid any ES dependency. I'm guessing this will be a common pattern we will see. If the library is flexible to accept either, it will be great! thank you!

xtermi2 commented 1 year ago

@S1riU5 hey you are stil alive. Nice to hear from you 😀

I see 2 possible solutions:

  1. Build an abstraction over the ES rest client and implement in 2 modules a Elasticsearch and OpenSearch Adapter. 1.1 There is also an option to implement an adapter to use any other HTTP client like ApacheHTTP or OKHttp client.
  2. Migrate from ES Rest Client to ApacheHTTP client or OKHttp client.

At the moment I would tend to option 2.

What do you think?

S1riU5 commented 1 year ago

@xtermi2 Yes I am :-) also nice to hear from you. Initially, I was in favor of option 1, but solution 2 should also do the trick and should be backward compatible..... I'll implement version 2, to get rid of the Elasticsearch dependency, and look afterward into solution 1. Thanks for your input!

iceman91176 commented 1 month ago

Hey - we would also be interested in this. We would like to use OpenSearch Restclient in our applikcation with spring-data-opensearch (https://github.com/opensearch-project/spring-data-opensearch). Using the opensearch-client seems to be the recommended way, but means to exclude the Rest-Client (so using elaticsearch-evolution is not possible)