I have the below POCO for ElasticSearch response
public PublicationInfo PublicationInfo { get; }
where the PublicationInfo is defined as below
public class PublicationInfo
{
public string Issn { get; }
public string Volume { get; }
public string Pagination { get;}
}
The ElasticSearch mapping is as below
"publicationinfo" : {
"properties" : {
"issn" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"pagination" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"volume" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
}
When the search response is searialized to POCO, the PublicationInfo property is returned as null although the response has a value.
What needs to be done to have NEST serialize the response correctly to the PublicationInfo property?
ConnectionSettings are as below
var settings = new ConnectionSettings(pool)
.DefaultIndex("indexname")
.DefaultFieldNameInferrer(field => field.ToLower());
Using ElasticSearch v7.4 and NEST v7.4