# Elasticsearch max key length

**URL:** <https://discuss.elastic.co/t/elasticsearch-max-key-length/64219>\
**Category:** Elasticsearch\
**Created:** [October 27, 2016, 11:19pm UTC](https://discuss.elastic.co/t/elasticsearch-max-key-length/64219 "2016-10-27T23:19:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sirsirs](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@sirsirs](https://discuss.elastic.co/u/sirsirs)\
**Post date:** [October 27, 2016, 11:19pm UTC](https://discuss.elastic.co/t/elasticsearch-max-key-length/64219/1 "2016-10-27T23:19:47Z")

</div>

This seems like more of a documentation issue. I am using Elasticsearch 5 rc1 however noticed the same behavior in Elasticsearch 2.

I am attempting to build a data table visualization for emails. The email body can be quite long. whenever the email body is (excessively) long, ES will not return the long key under buckets.

What is the maximum value for keys to be returned? Can I change the maximum value?

An example response below with 7 hits but no buckets/data returned.

```
{
  "took": 7,
  "timed_out": false,
  "_shards": {
    "total": 31,
    "successful": 31,
    "failed": 0
  },
  "hits": {
    "total": 7,
    "max_score": 0,
    "hits": []
  },
  "aggregations": {
    "2": {
      "doc_count_error_upper_bound": 0,
      "sum_other_doc_count": 0,
      "buckets": []
    }
  },
  "status": 200
}
```

---

<div class="post-metadata">

**Author:** ![sirsirs](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@sirsirs](https://discuss.elastic.co/u/sirsirs)\
**Post date:** [October 27, 2016, 11:24pm UTC](https://discuss.elastic.co/t/elasticsearch-max-key-length/64219/2 "2016-10-27T23:24:39Z")

</div>

i'm investigating what was found in: [Is there any length limitation of the key in term aggregation ? I mean results display](https://discuss.elastic.co/t/is-there-any-length-limitation-of-the-key-in-term-aggregation-i-mean-results-display/58024)

---

<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:** [July 5, 2017, 10:08pm UTC](https://discuss.elastic.co/t/elasticsearch-max-key-length/64219/3 "2017-07-05T22:08:55Z")

</div>


