# How to index large text string data?

**URL:** <https://discuss.elastic.co/t/how-to-index-large-text-string-data/246848>\
**Category:** Elasticsearch\
**Created:** [August 29, 2020, 4:50pm UTC](https://discuss.elastic.co/t/how-to-index-large-text-string-data/246848 "2020-08-29T16:50:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandeep\_rana](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@sandeep\_rana](https://discuss.elastic.co/u/sandeep_rana)\
**Post date:** [August 29, 2020, 4:50pm UTC](https://discuss.elastic.co/t/how-to-index-large-text-string-data/246848/1 "2020-08-29T16:50:47Z")

</div>

`Why max_bytes_length_exceeded_exception while insert a doc with some large text field data.. ?`

---

<div class="post-metadata">

**Author:** ![dominique.bejean](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@dominique.bejean](https://discuss.elastic.co/u/dominique.bejean)\
**Post date:** [August 30, 2020, 9:51am UTC](https://discuss.elastic.co/t/how-to-index-large-text-string-data/246848/2 "2020-08-30T09:51:26Z")

</div>

Hi,

A little bit more information would be great !

ES version ?  
How is defined you target field ?  
How long is the data ?

Regards.

Dominique

---

<div class="post-metadata">

**Author:** ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)\
**Post date:** [August 30, 2020, 11:16am UTC](https://discuss.elastic.co/t/how-to-index-large-text-string-data/246848/3 "2020-08-30T11:16:40Z")

</div>

Can you share your index mapping ?  
May be you are trying to index a large text into a term field ?  
You can try to change mapping into text or something like this

```
PUT my-index/_mapping
{
   "properties": {
      "my_field": {
         "type": "keyword",
         "ignore_above": 1024,
         "fields": {
            "raw_text": {
               "type": "text"
            }
         }
      }
   }
}
```

---

<div class="post-metadata">

**Author:** ![sandeep\_rana](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@sandeep\_rana](https://discuss.elastic.co/u/sandeep_rana)\
**Post date:** [August 31, 2020, 4:47am UTC](https://discuss.elastic.co/t/how-to-index-large-text-string-data/246848/4 "2020-08-31T04:47:58Z")

</div>

Thanks ylasri,

Its working .. 👍

---

<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:** [September 28, 2020, 4:48am UTC](https://discuss.elastic.co/t/how-to-index-large-text-string-data/246848/5 "2020-09-28T04:48:14Z")

</div>

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