# Validation Failed: 1: id is too long, must be no longer than 512 bytes

**URL:** <https://discuss.elastic.co/t/validation-failed-1-id-is-too-long-must-be-no-longer-than-512-bytes/101924>\
**Category:** Elasticsearch\
**Created:** [September 27, 2017, 4:50am UTC](https://discuss.elastic.co/t/validation-failed-1-id-is-too-long-must-be-no-longer-than-512-bytes/101924 "2017-09-27T04:50:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stp\_ra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stp_ra/32/42073_2.png) [@stp\_ra](https://discuss.elastic.co/u/stp_ra)\
**Post date:** [September 27, 2017, 4:50am UTC](https://discuss.elastic.co/t/validation-failed-1-id-is-too-long-must-be-no-longer-than-512-bytes/101924/1 "2017-09-27T04:50:18Z")

</div>

From this closed thread: [Id is too long, must be no longer than 512](https://discuss.elastic.co/t/id-is-too-long-must-be-no-longer-than-512/80643/3) I understand that \_id cannot be longer than 512 bytes. Now I am stuck. Since there isn't a unique constraint for a field I have chosen to use \_id. Now the \_id cannot be \>512 bytes. Why is there this limit? Seems arbitrary. Yes I know that \>512 bytes for an \_id is long, blah, blah, blah. But if I want \>512 bytes why not?

Can we remove the limit and just put in the docs a note that shorter id's are better? It is a small index and performance isn't too important.

---

<div class="post-metadata">

**Author:** ![idanhagai](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/idanhagai/32/16175_2.png) [@idanhagai](https://discuss.elastic.co/u/idanhagai)\
**Post date:** [October 8, 2017, 11:03am UTC](https://discuss.elastic.co/t/validation-failed-1-id-is-too-long-must-be-no-longer-than-512-bytes/101924/2 "2017-10-08T11:03:51Z")

</div>

My solution was to use the original \_id **hash value**.

---

<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 5, 2017, 11:04am UTC](https://discuss.elastic.co/t/validation-failed-1-id-is-too-long-must-be-no-longer-than-512-bytes/101924/3 "2017-11-05T11:04:14Z")

</div>

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