# Can ES not to store original keyword content but a mapping num value (4 save space)?

**URL:** https://discuss.elastic.co/t/can-es-not-to-store-original-keyword-content-but-a-mapping-num-value-4-save-space/215664
**Category:** Elasticsearch
**Created:** [January 20, 2020, 4:31am UTC](https://discuss.elastic.co/t/can-es-not-to-store-original-keyword-content-but-a-mapping-num-value-4-save-space/215664 "2020-01-20T04:31:41Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![DeeeFOX](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/deeefox/32/49566_2.png) [@DeeeFOX](https://discuss.elastic.co/u/DeeeFOX)
#### Post date: [January 20, 2020, 4:31am UTC](https://discuss.elastic.co/t/can-es-not-to-store-original-keyword-content-but-a-mapping-num-value-4-save-space/215664/1 "2020-01-20T04:31:41Z")

</div>

We use es as tsdb described in

[my other question](https://discuss.elastic.co/t/how-to-write-a-efficient-es-query-for-the-below-sql-query/215599/2)

and data look like:

```
{
	"metric": "metric_name",
	"@timestamp": "2020-01-01T01:01:01",
	"t": {
		"key1": "val1",
		"key2": "val2"
	},
	"f": {
		"name1": 1.2,
		"name2": 2.3
	}
}

```

But when data grows (to billion datapoint), these file grows to a size so huge as below (already rolling by date):

```
('Points', '0.07')
size: 1,657,438,615 bytes

('DocValues', '0.18')
size: 3,876,527,301 bytes

('Term Dictionary', '0.20')
size: 4,237,561,161 bytes

('Field Data', '0.44')
size: 9,265,590,659 bytes

('Frequencies', '0.08'):
size: 1,733,107,687 bytes

```

And the query we use are just term(yes or no) and prefix and some simple aggregation(terms, date\_histogram then sum, avg).

So, my question is

Whether es can translate first then store the the mapping data instead of original keyword content in the storing layer(Transparent to users) to save the space and io?

like:

```
{
	"metric": "0",
	"@timestamp": "2020-01-01T01:01:01",
	"t": {
		"key1": "1",
		"key2": "2"
	},
	"f": {
		"name1": 1.2,
		"name2": 2.3
	}
}

```

instead of

```
{
	"metric": "long_metric_name",
	"@timestamp": "2020-01-01T01:01:01",
	"t": {
		"key1": "long_val1",
		"key2": "long_val2"
	},
	"f": {
		"name1": 1.2,
		"name2": 2.3
	}
}
```

---

<div class="post-metadata">

### Author: ![DeeeFOX](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/deeefox/32/49566_2.png) [@DeeeFOX](https://discuss.elastic.co/u/DeeeFOX)
#### Post date: [January 20, 2020, 8:57am UTC](https://discuss.elastic.co/t/can-es-not-to-store-original-keyword-content-but-a-mapping-num-value-4-save-space/215664/2 "2020-01-20T08:57:08Z")

</div>

wait for reply!

---

<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 20, 2020, 9:25am UTC](https://discuss.elastic.co/t/can-es-not-to-store-original-keyword-content-but-a-mapping-num-value-4-save-space/215664/3 "2020-01-20T09:25:07Z")

</div>

Read [this](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and specifically the "Also be patient" part.

It's fine to answer on your own thread after 2 or 3 days (not including weekends) if you don't have an answer.

---

<div class="post-metadata">

### Author: ![DeeeFOX](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/deeefox/32/49566_2.png) [@DeeeFOX](https://discuss.elastic.co/u/DeeeFOX)
#### Post date: [January 20, 2020, 9:29am UTC](https://discuss.elastic.co/t/can-es-not-to-store-original-keyword-content-but-a-mapping-num-value-4-save-space/215664/4 "2020-01-20T09:29:49Z")

</div>

sorry for that, emmm

---

<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 17, 2020, 9:35am UTC](https://discuss.elastic.co/t/can-es-not-to-store-original-keyword-content-but-a-mapping-num-value-4-save-space/215664/5 "2020-02-17T09:35:07Z")

</div>

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