# Do I need to optimize document like this?

**URL:** <https://discuss.elastic.co/t/do-i-need-to-optimize-document-like-this/136520>\
**Category:** Elasticsearch\
**Created:** [June 19, 2018, 3:12pm UTC](https://discuss.elastic.co/t/do-i-need-to-optimize-document-like-this/136520 "2018-06-19T15:12:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![plexcellmedia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/plexcellmedia/32/54536_2.png) [@plexcellmedia](https://discuss.elastic.co/u/plexcellmedia)\
**Post date:** [June 19, 2018, 3:12pm UTC](https://discuss.elastic.co/t/do-i-need-to-optimize-document-like-this/136520/1 "2018-06-19T15:12:14Z")

</div>

Hey!

I was wondering, how does elastic search work in the background after document is indexed.  
Lets say I have billions of documents like this:

```
{
	"user_id": "1",
	"status": "enabled"
}

```

Would it make any difference if I indexed those documents like this?

```
{
	"uid": "1",
	"s": "1"
}

```

Does elastic search have any own optimization in background for shortening data?  
Would it be wise to design document structure to use shortenings and codes instead of plain raw text?

As example, instead of text, I would insert number from list:  
0 = pending  
1 = enabled  
2 = disabled

Would this be considered as smart approach when designing document "schema"?

Thanks!

---

<div class="post-metadata">

**Author:** ![plexcellmedia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/plexcellmedia/32/54536_2.png) [@plexcellmedia](https://discuss.elastic.co/u/plexcellmedia)\
**Post date:** [June 29, 2018, 3:09pm UTC](https://discuss.elastic.co/t/do-i-need-to-optimize-document-like-this/136520/2 "2018-06-29T15:09:21Z")

</div>

Any help with this please? 🙂

---

<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 27, 2018, 3:09pm UTC](https://discuss.elastic.co/t/do-i-need-to-optimize-document-like-this/136520/3 "2018-07-27T15:09:22Z")

</div>

Closed on July 27, 2018, 3:09pm UTC

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