When trying to read certain fields from ElasticSearch, I noticed that if I do not include a text attribute then it will not map the variable name to the field. It will read null for that specific field. Lets say I have a field in ES named ValueId
of type text
. In my model class I have public string ValueId {get; set;}
. ValueId
should have a value for that variable, but when I do not add a Elasticsearch Property Attribute i.e. [Text(Name = "ValueId")]
it returns null.
Now if I have it as the following, then it will return a value for that variable.
[Text(Name = "ValueId")]
public string ValueId {get; set;}
My guess is because of the camel casing, is that correct?
On another note, is there a way I could set that property name (Name = "")
dynamically? As in create a method to do this.