# Property mapping elasticsearch

**URL:** <https://discuss.elastic.co/t/property-mapping-elasticsearch/283580>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [September 7, 2021, 8:41pm UTC](https://discuss.elastic.co/t/property-mapping-elasticsearch/283580 "2021-09-07T20:41:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![woal\_idal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/woal_idal/32/93235_2.png) [@woal\_idal](https://discuss.elastic.co/u/woal_idal)\
**Post date:** [September 7, 2021, 8:41pm UTC](https://discuss.elastic.co/t/property-mapping-elasticsearch/283580/1 "2021-09-07T20:41:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![stevejgordon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stevejgordon/32/80912_2.png) [@stevejgordon](https://discuss.elastic.co/u/stevejgordon)\
**Post date:** [September 8, 2021, 6:57am UTC](https://discuss.elastic.co/t/property-mapping-elasticsearch/283580/2 "2021-09-08T06:57:52Z")

</div>

You seem to have repeated pretty much the same question from your [earlier post](https://discuss.elastic.co/t/how-to-read-different-field-names-with-same-field-value-elasticsearch/283314/2). As answered there, the default configuration assumes that types are camel-case in JSON and the documentation I linked to provides guidance on changing that behaviour. You can also look at [Fluent mapping](https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/fluent-mapping.html) for configuring the JSON name for properties which potentially could meet your dynamic requirement to set that when the application starts up for example.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 6, 2021, 6:58am UTC](https://discuss.elastic.co/t/property-mapping-elasticsearch/283580/3 "2021-10-06T06:58:25Z")

</div>

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