Skip to content

Cannot use RawJsonQuery #8195

Open
Open
@gpetrou

Description

@gpetrou

Elastic.Clients.Elasticsearch version: 8.13.10

Elasticsearch version: 8.13.2

.NET runtime version: 8.0

Operating system version:

Description of the problem including expected versus actual behavior:
Try to execute the following code:

Elastic.Clients.Elasticsearch.QueryDsl.RawJsonQuery rawQuery = new("{\"term\": { \"fieldname\": \"value\"  }}");

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

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

It results in:

{
  "query": {
    "raw_json": {"term": { "fieldname": "value"  }}
  }
}

Therefore there is a parsing_exception.

Steps to reproduce:
1.
2.
3.

Expected behavior
A clear and concise description of what you expected to happen.

Provide ConnectionSettings (if relevant):

Provide DebugInformation (if relevant):

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions