Elasticsearch NEST - Documents values are NULL

I upgraded Elasticsearch from 6.8 to 7.6 and after the upgrade values returned in the documents are all NULL.
I do see the values coming in Debug information and total count is also correct but not sure why documents are NULL.

I tried suggestions mentioned in ElasticSearch NEST - all fields are NULL and https://stackoverflow.com/questions/58175271/elasticsearch-net-nest-all-result-hit-fields-are-null-but-results-are-there and still no luck.

I also tried adding property name and making them Pascal case and still no luck.

document is elasticsearch:

Indexing code:

any suggestions ? I don't want to rollback to previous version.

There looks to be a bug in handling properties with no setters; I've opened an issue to address.

In the meantime, if you add a setter for each property (don't need one for FullName) and

  1. use DefaultFieldNameInferrer(p => p) if the setter is public


  1. use PropertyNameAttribute or DataMemberAttribute if the setter is public or non-public

then models will be hydrated.

Thank you @forloop. adding setter to the property resolved the issue. (If I see you in next ES conference I will buy you a drink :laughing: )

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