Skip to content

Using REST API compatibility #2978

@philmcmahon

Description

@philmcmahon

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions