# How to convert field to Java properties

**URL:** <https://discuss.elastic.co/t/how-to-convert-field-to-java-properties/346104>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [October 31, 2023, 9:26am UTC](https://discuss.elastic.co/t/how-to-convert-field-to-java-properties/346104 "2023-10-31T09:26:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hsu\_Demon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hsu_demon/32/122633_2.png) [@Hsu\_Demon](https://discuss.elastic.co/u/Hsu_Demon)\
**Post date:** [October 31, 2023, 9:26am UTC](https://discuss.elastic.co/t/how-to-convert-field-to-java-properties/346104/1 "2023-10-31T09:26:23Z")

</div>

I use elasticsearch-java version 8.10.4 rather than spring-data-elasticsearch.  
In my elasticsearch index, the field is underline-word such as "user\_id". But in my Java Object, it is "userId". when i get the SearchResponse, the value of "userId" is null, as all the camel-case properties. But the simple property like "id", "model", it works well. How can I resolve it ?

---

<div class="post-metadata">

**Author:** ![Hsu\_Demon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hsu_demon/32/122633_2.png) [@Hsu\_Demon](https://discuss.elastic.co/u/Hsu_Demon)\
**Post date:** [November 2, 2023, 2:11am UTC](https://discuss.elastic.co/t/how-to-convert-field-to-java-properties/346104/2 "2023-11-02T02:11:09Z")

</div>

Need help, please

---

<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:** [November 30, 2023, 2:12am UTC](https://discuss.elastic.co/t/how-to-convert-field-to-java-properties/346104/3 "2023-11-30T02:12:04Z")

</div>

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