Skip to content

Cannot deserialize the current JSON object after upgrading to the new verson with es7.1.0 and nest 6.7.0 #3791

@WenRuonan

Description

@WenRuonan

Below code is fine when I use the old verson for es and nest, but after upgrading, it meets below error.
code:
var result = _client.Search(s => s.Index(indexTeamRead).Query(q => q.MatchAll()));
error:
Elasticsearch.Net.UnexpectedElasticsearchClientException:“Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Int64' because the type requires a JSON primitive value (e.g. string, number, boolean, null) to deserialize correctly.
To fix this error either change the JSON to a JSON primitive value (e.g. string, number, boolean, null) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.
Path 'hits.total.value', line 1, position 113.”

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions