# Bytes can be at most 32766 in length

**URL:** <https://discuss.elastic.co/t/bytes-can-be-at-most-32766-in-length/213650>\
**Category:** Elasticsearch\
**Created:** [January 3, 2020, 5:09am UTC](https://discuss.elastic.co/t/bytes-can-be-at-most-32766-in-length/213650 "2020-01-03T05:09:52Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexus/32/12696_2.png) [@alexus](https://discuss.elastic.co/u/alexus)\
**Post date:** [January 3, 2020, 5:09am UTC](https://discuss.elastic.co/t/bytes-can-be-at-most-32766-in-length/213650/1 "2020-01-03T05:09:52Z")

</div>

Hello World!

I'm trying to \_reindex one of my indices, yet I'm running into following issue:

```
{
  "took": 9502,
  "timed_out": false,
  "total": 114143,
  "updated": 0,
  "created": 2999,
  "deleted": 0,
  "batches": 3,
  "version_conflicts": 0,
  "noops": 0,
  "retries": {
    "bulk": 0,
    "search": 0
  },
  "throttled_millis": 0,
  "requests_per_second": -1,
  "throttled_until_millis": 0,
  "failures": [
    {
      "index": "dest",
      "type": "doc",
      "id": "cmBeZW4BYpT_rNQS9_De",
      "cause": {
        "type": "illegal_argument_exception",
        "reason": "Document contains at least one immense term in field=\"post.keyword\" (whose UTF8 encoding is longer than the max length 32766), all of which were skipped. Please correct the analyzer to not produce such terms. The prefix of the first immense term is: '[-48, -99, -48, -80, -47, -125, -47, -121, -48, -67, -48, -66, 45, -48, -72, -47, -127, -47, -127, -48, -69, -48, -75, -48, -76, -48, -66, -48, -78, -48]...', original message: bytes can be at most 32766 in length; got 67247",
        "caused_by": {
          "type": "max_bytes_length_exceeded_exception",
          "reason": "max_bytes_length_exceeded_exception: bytes can be at most 32766 in length; got 67247"
        }
      },
      "status": 400
    }
  ]
}

```

part of `dest/_mapping`

```
  "post" : {
    "type" : "text",
    "fields" : {
      "keyword" : {
        "type" : "keyword",
        "ignore_above" : 70656
      }
    }
  },

```

Please advise.

---

<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:** [January 3, 2020, 5:22am UTC](https://discuss.elastic.co/t/bytes-can-be-at-most-32766-in-length/213650/2 "2020-01-03T05:22:20Z")

</div>

I guess you did not define the index for the destination index and you are then using the default mapping.

---

<div class="post-metadata">

**Author:** ![alexus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexus/32/12696_2.png) [@alexus](https://discuss.elastic.co/u/alexus)\
**Post date:** [January 3, 2020, 5:27am UTC](https://discuss.elastic.co/t/bytes-can-be-at-most-32766-in-length/213650/3 "2020-01-03T05:27:24Z")

</div>

Thank you for quick reply!

I hit submit by accident without finishing writing my question fully) I now updated my initial question with relevant part of custom mapping that I use for my index which is called "dest".

---

<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:** [January 3, 2020, 6:38am UTC](https://discuss.elastic.co/t/bytes-can-be-at-most-32766-in-length/213650/4 "2020-01-03T06:38:27Z")

</div>

What does this field contain? Why do you need a keyword datatype for this field?

---

<div class="post-metadata">

**Author:** ![alexus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexus/32/12696_2.png) [@alexus](https://discuss.elastic.co/u/alexus)\
**Post date:** [January 3, 2020, 4:35pm UTC](https://discuss.elastic.co/t/bytes-can-be-at-most-32766-in-length/213650/5 "2020-01-03T16:35:21Z")

</div>

html

I'm thinking now type keyword probably not the best way to store html...

---

<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:** [January 3, 2020, 5:26pm UTC](https://discuss.elastic.co/t/bytes-can-be-at-most-32766-in-length/213650/6 "2020-01-03T17:26:05Z")

</div>

Definitely not. What is the use case for this field ?

---

<div class="post-metadata">

**Author:** ![alexus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexus/32/12696_2.png) [@alexus](https://discuss.elastic.co/u/alexus)\
**Post date:** [January 4, 2020, 4:13pm UTC](https://discuss.elastic.co/t/bytes-can-be-at-most-32766-in-length/213650/7 "2020-01-04T16:13:42Z")

</div>

requirements of app is to store full html, in case of wrong parsing and needs to be reparse again

---

<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:** [January 4, 2020, 6:15pm UTC](https://discuss.elastic.co/t/bytes-can-be-at-most-32766-in-length/213650/8 "2020-01-04T18:15:42Z")

</div>

I'd use a `text` field with `index: false`. See [https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-index.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-index.html)

---

<div class="post-metadata">

**Author:** ![alexus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexus/32/12696_2.png) [@alexus](https://discuss.elastic.co/u/alexus)\
**Post date:** [January 5, 2020, 6:31pm UTC](https://discuss.elastic.co/t/bytes-can-be-at-most-32766-in-length/213650/9 "2020-01-05T18:31:14Z")

</div>

that's exactly what I need)

thank you!

---

<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 2, 2020, 6:31pm UTC](https://discuss.elastic.co/t/bytes-can-be-at-most-32766-in-length/213650/10 "2020-02-02T18:31:25Z")

</div>

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