# How to make \_id available for aggs?

**URL:** <https://discuss.elastic.co/t/how-to-make-id-available-for-aggs/295814>\
**Category:** Elasticsearch\
**Created:** [January 31, 2022, 10:03am UTC](https://discuss.elastic.co/t/how-to-make-id-available-for-aggs/295814 "2022-01-31T10:03:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emporea](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emporea/32/101071_2.png) [@Emporea](https://discuss.elastic.co/u/Emporea)\
**Post date:** [January 31, 2022, 10:03am UTC](https://discuss.elastic.co/t/how-to-make-id-available-for-aggs/295814/1 "2022-01-31T10:03:42Z")

</div>

Upon indexing I overwrote \_id with my own unique \_id field filled with integers.

How can I aggregate something like max on my \_id field?  
`max_id: { max: { field: "_id" } }`

This only throws an error.

Currently I am using python's Elasticsearch to populate my index. Is there a setting I can put on creating the index like `indices.put_settings(...)` ?

Also I was wondering if there is a put\_setting or something like that to set the `ignore_above` setting globablly for every field?

Thanks.

---

<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:** [February 28, 2022, 10:04am UTC](https://discuss.elastic.co/t/how-to-make-id-available-for-aggs/295814/2 "2022-02-28T10:04:03Z")

</div>

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