Skip to content

MultiGetAsync<TDocument> returns 400 statuscode - unexpected token [START_OBJECT] #6531

Closed
@DanielFruerlund

Description

@DanielFruerlund

Hi Team,

NEST/Elasticsearch.Net version: Elastic.Clients.Elasticsearch 8.0.0-beta.1

Elasticsearch version: 8.2.3

Description of the problem:

When invoking the MultiGetAsync a status 400 is returned from the api.

Passing in a MultiGetRequestDescriptor or a MultiGetRequest with an array of ids, results in a request body that looks as follows:
{"ids":{}}.
My method call:
image

This is also the case when specifying each document to return. Here the request body created is: {"docs":{"_id":""}} and my method call:
image

According to the documentation both "docs" and "ids" should be an array.

docscumentation of mget: https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-get.html:

Debug information:

Elastic.Transport.TransportException: Request failed to execute. Call: Status code 400 from: POST /_mget?pretty=true&error_trace=true. ServerError: Type: parsing_exception Reason: "unexpected token [START_OBJECT], expected [FIELD_NAME] or [START_ARRAY]"

Request:
{"ids":{}}

Response:
{
"error" : {
"root_cause" : [
{
"type" : "parsing_exception",
"reason" : "unexpected token [START_OBJECT], expected [FIELD_NAME] or [START_ARRAY]",
},
"status" : 400
}

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