Skip to content

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

Closed
@gpetrou

Description

@gpetrou

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):

Metadata

Metadata

Assignees

No one assigned

    Labels

    8.xRelates to a 8.x client version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions