# How to store/compress large string field in index (V6.8)

**URL:** <https://discuss.elastic.co/t/how-to-store-compress-large-string-field-in-index-v6-8/341777>\
**Category:** Elasticsearch\
**Created:** [August 28, 2023, 6:20am UTC](https://discuss.elastic.co/t/how-to-store-compress-large-string-field-in-index-v6-8/341777 "2023-08-28T06:20:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![elron](https://avatars.discourse-cdn.com/v4/letter/e/4af34b/32.png) [@elron](https://discuss.elastic.co/u/elron)\
**Post date:** [August 28, 2023, 6:20am UTC](https://discuss.elastic.co/t/how-to-store-compress-large-string-field-in-index-v6-8/341777/1 "2023-08-28T06:20:43Z")

</div>

We are planning to store in the index a large string(error log) with a classifier for future use in a machine learning project. The error log can get to the size of tens of megabytes and we are planning to store tens of thousands+ of documents. how should I define the index or even just the logText field such that it is compressed in elastic, or should I compress it before sending it to Elasticsearch and if so what should I set the field type to be.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [August 29, 2023, 6:08am UTC](https://discuss.elastic.co/t/how-to-store-compress-large-string-field-in-index-v6-8/341777/2 "2023-08-29T06:08:04Z")

</div>

Elasticsearch is not really built to handle very large documents efficiently, so if you are not indexing and searching the large text field I would recommend you store it elsewhere, e.g. S3, and just include a link in the document.

I would also recommend you upgrade to the latest version of Elasticsearch as the version you are using is very old and has been EOL for quite a while.

---

<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 26, 2023, 6:08am UTC](https://discuss.elastic.co/t/how-to-store-compress-large-string-field-in-index-v6-8/341777/3 "2023-09-26T06:08:16Z")

</div>

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