# Store Text Content of PDF in elastic search

**URL:** <https://discuss.elastic.co/t/store-text-content-of-pdf-in-elastic-search/338924>\
**Category:** Elasticsearch\
**Created:** [July 21, 2023, 7:10am UTC](https://discuss.elastic.co/t/store-text-content-of-pdf-in-elastic-search/338924 "2023-07-21T07:10:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![a.nguyentuan](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@a.nguyentuan](https://discuss.elastic.co/u/a.nguyentuan)\
**Post date:** [July 21, 2023, 7:10am UTC](https://discuss.elastic.co/t/store-text-content-of-pdf-in-elastic-search/338924/1 "2023-07-21T07:10:31Z")

</div>

I had a database which contain millions of document text content records. I would like to sync those text into Elasticsearch index for document content searching purpose. Could you please suggest what is the best way to store those texts in ES as it will take a lot of storage

---

<div class="post-metadata">

**Author:** ![a.nguyentuan](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@a.nguyentuan](https://discuss.elastic.co/u/a.nguyentuan)\
**Post date:** [July 22, 2023, 12:34am UTC](https://discuss.elastic.co/t/store-text-content-of-pdf-in-elastic-search/338924/2 "2023-07-22T00:34:30Z")

</div>

I have research around and Seem like ES is already compressed stored field according to this topic [Large string fields - Elastic Stack / Elasticsearch - Discuss the Elastic Stack](https://discuss.elastic.co/t/large-string-fields/71818)

There is also a settings to compress it even more  
[Store compression in Lucene and Elasticsearch | Elastic Blog](https://www.elastic.co/jp/blog/store-compression-in-lucene-and-elasticsearch)

```auto
curl -XPUT ‘localhost:9200/my_index’ -d ‘{
  “settings”: {
    “index.codec”: “best_compression”
  }
}’

```

Is this setting suitable for our storage optimization if we store millions of document content?

---

<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:** [August 19, 2023, 12:35am UTC](https://discuss.elastic.co/t/store-text-content-of-pdf-in-elastic-search/338924/3 "2023-08-19T00:35:22Z")

</div>

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