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

Does olivere support "REST API compatibility" #1652

Open
jshenpdp opened this issue Sep 27, 2022 · 3 comments
Open

Does olivere support "REST API compatibility" #1652

jshenpdp opened this issue Sep 27, 2022 · 3 comments
Assignees
Labels
Milestone

Comments

@jshenpdp
Copy link

Does olivere support the concept of REST API compatibility?
Although it is a good practice not to make cross-communication between client and server which are of different versions, sometimes in practice, we encounter the need to use the same client to ping elasticsearch servers of different versions.

As mentioned in the page, in order to request REST API compatibility, the client needs to specify in the header about Accept and "Content-Types":

Accept: "application/vnd.elasticsearch+json;compatible-with=7"
Content-Type: "application/vnd.elasticsearch+json;compatible-with=7"

This is not a bug, but a question about current or potential future feature of the library. Does olivere already support this?

Which version of Elastic are you using?

[x] elastic.v7 (for Elasticsearch 7.x)
[x] elastic.v6 (for Elasticsearch 6.x)
[ ] elastic.v5 (for Elasticsearch 5.x)
[ ] elastic.v3 (for Elasticsearch 2.x)
[ ] elastic.v2 (for Elasticsearch 1.x)

Please describe the expected behavior

elastic v7 is able to make requests to both Elasticsearch 7 and 8 servers with the same endpoint, expecting the same behavior.

Please describe the actual behavior

NA, as this issue is a question rather than a bug.

Any steps to reproduce the behavior?

NA, as this issue is a question rather than a bug.

@olivere
Copy link
Owner

olivere commented Sep 27, 2022

Yeah, we might add this to the library. Notice however that with ES 8.x, you need to use the official Go client.

@olivere olivere self-assigned this Sep 27, 2022
@olivere olivere added this to the 7.0.33 milestone Sep 27, 2022
@bplies-ATX
Copy link

Been using this transitively via https://github.com/phillbaker/terraform-provider-elasticsearch Terraform provider. This has worked well up through Elastic 8.5.3. We just upgraded to 8.6.0 and things finally fell apart. @olivere how did you find out that there is a need to use the official Go client?

Elastic is trying to offer their own Terraform provider now so maybe we'll have to switch.

@1340691923
Copy link

@olivere Why do I use the official library when it's so difficult to use

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

No branches or pull requests

4 participants