Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using REST API compatibility #2978

Open
philmcmahon opened this issue Dec 18, 2023 · 0 comments
Open

Using REST API compatibility #2978

philmcmahon opened this issue Dec 18, 2023 · 0 comments

Comments

@philmcmahon
Copy link

I am currently in the process of upgrading from elasticsearch 7.17 to 8.11. Ideally I would like to make use of Rest API compatibility so that I can upgrade the DB without having to change the elastic4s version.

I couldn't find any documentation on how to do this with elastic4s. According to the elastic docs it should just be a case of setting the Accept and Content-Type headers on requests. I had a go at that but was unsuccesful (I might have just done this in completely the wrong place)

    val client = RestClient.builder(hosts: _*).setDefaultHeaders(Array(
     new BasicHeader("Accept", "application/vnd.elasticsearch+json;compatible-with=7" ), 
     new BasicHeader("Content-Type", "application/vnd.elasticsearch+json;compatible-with=7")
)).build()

Is anyone able to advise on whether it is possible to use rest api compatibility with elastic4s?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant