# Hit.id() nullable in newer java libs?

**URL:** <https://discuss.elastic.co/t/hit-id-nullable-in-newer-java-libs/366635>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [September 16, 2024, 4:26pm UTC](https://discuss.elastic.co/t/hit-id-nullable-in-newer-java-libs/366635 "2024-09-16T16:26:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![MChambers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mchambers/32/97650_2.png) [@MChambers](https://discuss.elastic.co/u/MChambers)\
**Post date:** [September 16, 2024, 4:26pm UTC](https://discuss.elastic.co/t/hit-id-nullable-in-newer-java-libs/366635/1 "2024-09-16T16:26:37Z")

</div>

Updating to 8.15.1 form 8.12.1 and I've noticed the Hit class is id field is now nullable? Why? Is it possible to have docs without and ID? How does that even work?

---

<div class="post-metadata">

**Author:** ![Kathleen\_DeRusso](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kathleen_derusso/32/132039_2.png) [@Kathleen\_DeRusso](https://discuss.elastic.co/u/Kathleen_DeRusso)\
**Post date:** [September 16, 2024, 8:08pm UTC](https://discuss.elastic.co/t/hit-id-nullable-in-newer-java-libs/366635/2 "2024-09-16T20:08:48Z")

</div>

Category updated on September 16, 2024, 8:08pm UTC

From #Elastic Search to #Elasticsearch

---

<div class="post-metadata">

**Author:** ![Kathleen\_DeRusso](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kathleen_derusso/32/132039_2.png) [@Kathleen\_DeRusso](https://discuss.elastic.co/u/Kathleen_DeRusso)\
**Post date:** [September 16, 2024, 8:08pm UTC](https://discuss.elastic.co/t/hit-id-nullable-in-newer-java-libs/366635/3 "2024-09-16T20:08:48Z")

</div>

Tags updated on September 16, 2024, 8:08pm UTC

Added #language-clients

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 16, 2024, 9:48pm UTC](https://discuss.elastic.co/t/hit-id-nullable-in-newer-java-libs/366635/4 "2024-09-16T21:48:51Z")

</div>

I did not check but may be it's related to the changes that are happening with the new index mode `logsdb`?  
I'm not sure though 😉

---

<div class="post-metadata">

**Author:** ![ltrotta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ltrotta/32/124003_2.png) [@ltrotta](https://discuss.elastic.co/u/ltrotta)\
**Post date:** [September 17, 2024, 11:16am UTC](https://discuss.elastic.co/t/hit-id-nullable-in-newer-java-libs/366635/5 "2024-09-17T11:16:26Z")

</div>

Hello! It's a very specific case: when `stored_fields` is set to `none` on a search request, the result contains no `_id` field. More info on `store` [here in the docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-store.html).

---

<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 15, 2024, 11:16am UTC](https://discuss.elastic.co/t/hit-id-nullable-in-newer-java-libs/366635/6 "2024-10-15T11:16:56Z")

</div>

Closed on October 15, 2024, 11:16am UTC

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