Elasticsearch .NET 7.1.0 issue

I have updated my project into last elasticsearch version. But after this, when I trying to get data from my elastic, I have next exception. My nugets: Elasticsearch.Net v7.1.0, NEST 7.1.0 Before update, when I using 6.7.0 elastic, I haven't got this issue.

  1. When I trying to get 900 elements, it works good.
  2. When I trying to get more than 1000, have this exception.
  3. I have set "max_result_window" : 500000

Exception has occurred: CLR/Elasticsearch.Net.UnexpectedElasticsearchClientException An exception of type 'Elasticsearch.Net.UnexpectedElasticsearchClientException' occurred in System.Private.CoreLib.dll but was not handled in user code: 'expected:'Number Token', actual:'null', at offset:169' Inner exceptions found, see $exception in variables window for more details. Innermost exception Elasticsearch.Net.Utf8Json.JsonParsingException : expected:'Number Token', actual:'null', at offset:169

Any ideas?

Elasticsearch.Net and NEST 7.1.0 are only compatible with Elasticsearch 7.x, so if you're using Elasticsearch 6.x, you should use the latest Elasticsearch.Net and NEST 6.x, which at this time is 6.8.1.

The issue is that somewhere in the response, a value is expected to be a numeric value, but is in fact null. The serializer in 7.x is much faster than in 6.x, however it is stricter. If you can provide further details about versions used and the actual JSON response, I may be able to help further.

1 Like

I have updated my project to the last version of Elasticsearch .net(7.x) and NEST(7.x).
If I try to get from elastci 100 elements, it works good. The same from Elastic dev tool. My query works from Elastic Dev tool with 10000 elements, but it doesn't works from my application.
My response is error, which I added.

What version of Elasticsearch are you targeting?

Im using Elasticsearch.NET 7.0.1

Is that Elasticsearch Server, or the .NET Client? What Elasticsearch Server are you using?

Im using 7.1.1 server version

I trying with take = 100, my query works good. If I set = 1000, that exception.

Please provide

  1. the C# POCOs that represent the documents in Elasticsearch
  2. the response that throws the exception, with any necessary redactions

The exception does indicate what offset in the response has an issue

I have found issue!I have 2 fields with int type. And in 6.x version, this fields was 0 by default. But for now new version can't parse it, only if fields nullable. Thanks for help!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.