# Change \_id field generation strategy from UUID-strings to long (by means of ES)

**URL:** <https://discuss.elastic.co/t/change-id-field-generation-strategy-from-uuid-strings-to-long-by-means-of-es/198050>\
**Category:** Elasticsearch\
**Created:** [September 4, 2019, 1:15pm UTC](https://discuss.elastic.co/t/change-id-field-generation-strategy-from-uuid-strings-to-long-by-means-of-es/198050 "2019-09-04T13:15:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tworogue](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tworogue/32/45591_2.png) [@tworogue](https://discuss.elastic.co/u/tworogue)\
**Post date:** [September 4, 2019, 1:15pm UTC](https://discuss.elastic.co/t/change-id-field-generation-strategy-from-uuid-strings-to-long-by-means-of-es/198050/1 "2019-09-04T13:15:26Z")

</div>

Hello!

I'm wondering if I can change the default behavior for '\_id' field generation.

I'd like ES to generate ids, but, instead of Flake-based string UUIDs I would like to get long (incremental, sequential) numbers (represented as strings).

Is that possible?

If yes, then how?  
If no, then why?

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 4, 2019, 4:31pm UTC](https://discuss.elastic.co/t/change-id-field-generation-strategy-from-uuid-strings-to-long-by-means-of-es/198050/2 "2019-09-04T16:31:54Z")

</div>

No, that is not configurable. Trying to assign sequential long identifiers in a highly concurrent and distributed system would also be very tricky and potentially quite slow. If you need them, generate then externally and send with the indexing requests.

---

<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 2, 2019, 4:32pm UTC](https://discuss.elastic.co/t/change-id-field-generation-strategy-from-uuid-strings-to-long-by-means-of-es/198050/3 "2019-10-02T16:32:02Z")

</div>

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