elasticsearch-evolution icon indicating copy to clipboard operation
elasticsearch-evolution copied to clipboard

Plans to support OpenSearch RestClient?

Open sameer-b opened this issue 1 year ago • 5 comments

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?

sameer-b avatar Mar 28 '23 21:03 sameer-b

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.

S1riU5 avatar Mar 29 '23 10:03 S1riU5

@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!

sameer-b avatar Mar 30 '23 17:03 sameer-b

@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?

xtermi2 avatar Mar 30 '23 19:03 xtermi2

@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!

S1riU5 avatar Mar 30 '23 20:03 S1riU5