Skip to content

"[query_string] query does not support [fields]" error #8036

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

Closed
gpetrou opened this issue Feb 11, 2024 · 8 comments
Closed

"[query_string] query does not support [fields]" error #8036

gpetrou opened this issue Feb 11, 2024 · 8 comments
Labels
8.x Relates to a 8.x client version

Comments

@gpetrou
Copy link
Contributor

gpetrou commented Feb 11, 2024

Elastic.Clients.Elasticsearch version: 8.12.0

Elasticsearch version: 8.2.2

.NET runtime version: net8.0

Operating system version: Windows 11

Description of the problem including expected versus actual behavior:
Using Fields property of QueryStringQuery does not work anymore. There is a "[query_string] query does not support [fields]" error.

Steps to reproduce:

Elastic.Clients.Elasticsearch.QueryDsl.QueryStringQuery queryStringQuery = new()
{
    Fields = new[] { "test" }
};

SearchRequest<JsonObject> elasticSearchRequest = new("IndexName")
{
    Query = queryStringQuery
};

Elastic.Clients.Elasticsearch.SearchResponse<JsonObject> expected = await _elasticsearchClient.SearchAsync<JsonObject>(elasticSearchRequest);

Expected behavior
The code does not result in an error.

Provide ConnectionSettings (if relevant):

Provide DebugInformation (if relevant):

@gpetrou gpetrou added the 8.x Relates to a 8.x client version label Feb 11, 2024
@CodeDan90
Copy link

Currently having the same problem with version 8.12.0, when you only use one field the error occurs but if you add more than one field the query works.

@gpetrou
Copy link
Contributor Author

gpetrou commented Feb 15, 2024

@stevejgordon perhaps #8018 broke this? In that PR, I don't see any tests. Are there tests in another repository that verified this change?

@stevejgordon
Copy link
Contributor

@gpetrou Yes, unfortunately, that change which fixes Fields usage elsewhere has caused this issue. @flobernd, it looks like this will need to be addressed in the specification, as it seems there are different behaviours at play in ES for single-field entries. We may need to model both scenarios.

@gpetrou
Copy link
Contributor Author

gpetrou commented Feb 22, 2024

@flobernd @stevejgordon is there a plan to fix this bug? Should we expect a hotfix?

@flobernd
Copy link
Member

flobernd commented Feb 22, 2024

@gpetrou Yes. In the meantime please downgrade to the last version, if possible.

@gpetrou
Copy link
Contributor Author

gpetrou commented Mar 22, 2024

Yes. In the meantime please downgrade to the last version, if possible.

We were never able to upgrade due to this issue. Is this going to be addressed in the upcoming release?

@flobernd
Copy link
Member

Yes. This will be fixed in 8.12.1 by reverting the PR that broke it.

In one of the 8.13.x patch releases I will reintroduce the (stored_fields) fix in a way that does not affect the QueryStringQuery.

@flobernd
Copy link
Member

Fixed in 8.12.1

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

No branches or pull requests

4 participants