Skip to content

Query combination of filter and nested queries fails with "Accept version must be either version 8 or 7, but found 9. Accept=application/vnd.elasticsearch+json;compatible-with=9" #8512

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

Open
tudordumitriu opened this issue May 6, 2025 · 2 comments
Labels
9.x Relates to a 9.x client version Category: Question

Comments

@tudordumitriu
Copy link

Elastic.Clients.Elasticsearch version**: 9.0.1

Elasticsearch version: 8.16.0

.NET runtime version: 8.0.15

Operating system version: Windows 11
Description of the problem including expected versus actual behavior:
When trying to execute a query a little more complex we are getting
"Accept version must be either version 8 or 7, but found 9. Accept=application/vnd.elasticsearch+json;compatible-with=9"
If we try to execute it directly via Postman by taking from debug the request all works fine

Steps to reproduce:

  1. Build complex query
  2. Execute it against Elastic Search 8.16.0

Expected behavior
Successful execution of the query

Provide ConnectionSettings (if relevant):

Provide DebugInformation (if relevant):

@tudordumitriu tudordumitriu added Category: Bug 9.x Relates to a 9.x client version labels May 6, 2025
@tudordumitriu
Copy link
Author

Update:
The filter is actually a GeoDistanceQuery that we couldn't execute against a geo_point text because it was throwing various other errors in Elastic.Clients.Elasticsearch 8.x like "Unable to locate factory for multi-item union accepting a string value." so we decided to upgrade
We tried using DisableMetaHeader or setting GlobalHeaders to an empty collection but nothing worked

@flobernd
Copy link
Member

flobernd commented May 6, 2025

Hi @tudordumitriu ,

I should probably add 9.x to the compatibility matrix. The client uses a "server versioning" schema. This means that all 9.x client versions are not backwards compatible with 8.x clusters. You must use a 8.x client version when speaking to a 8.x cluster. The 8.x client however can talk to 9.x server (it's always forward compatible for 1 major version).

FYI: I have decided to backport all the improvements of 9.0 to the upcoming 8.19 release of the client.

Check this issue for a workaround (not recommended; not officially supported; no support will be provided in case of problems):
#8501

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
9.x Relates to a 9.x client version Category: Question
Projects
None yet
Development

No branches or pull requests

2 participants