# Understanding implications of \`index: false\` with \`type: keyword\`

**URL:** https://discuss.elastic.co/t/understanding-implications-of-index-false-with-type-keyword/264352
**Category:** Elasticsearch
**Created:** [February 15, 2021, 7:12pm UTC](https://discuss.elastic.co/t/understanding-implications-of-index-false-with-type-keyword/264352 "2021-02-15T19:12:24Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![workmanw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/workmanw/32/35517_2.png) [@workmanw](https://discuss.elastic.co/u/workmanw)
#### Post date: [February 15, 2021, 7:12pm UTC](https://discuss.elastic.co/t/understanding-implications-of-index-false-with-type-keyword/264352/1 "2021-02-15T19:12:24Z")

</div>

Hello,

I have a pretty simple use case that has been discussed at length on this forum, I'm storing a large block of text that I just want to reside in my source document, not be indexed at all. Originally this field was index with the following:

```auto
"message_body": {
    "type": "keyword",
    "index": false
} 

```

We chose keyword because it was either keyword or text and with `index: false` we didn't think it would matter. However after a little while we ran into the 32K limit issue for the keyword field. I created a new index using `"ignore_above": 1` on the field and to my surprise that worked.

So I migrated the data with the reindex api and that solved it. But I noticed something very surprising that I'd like help understanding, the size the of index on disk was reduced greatly. Just by adding: `ignore_above: 1`, the size of my index (`total.store.size_in_bytes`) has dropped from 39 GB to 15 GB in our test env. While this is really great because our production index is approach 1 TB, I don't understand the reason for this. With `index: false` the data is not store in the inverted index right? If that's the case why would there be such a different with `ignore_above` being set?

I also repeated this test using `"type": "text"` and `"index": false`. In that case the size of the index was also reduced down to 15GB. Can someone explain this to me?

---

<div class="post-metadata">

### Author: ![workmanw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/workmanw/32/35517_2.png) [@workmanw](https://discuss.elastic.co/u/workmanw)
#### Post date: [February 15, 2021, 8:45pm UTC](https://discuss.elastic.co/t/understanding-implications-of-index-false-with-type-keyword/264352/2 "2021-02-15T20:45:24Z")

</div>

I very embarrassingly forgot about `doc_values`. Doing the following also yields the reduced size on disk:

```auto
"message_body": {
    "type": "keyword",
    "index": false,
    "doc_values": false
} 

```

I am curious if there is any difference than above snippet and `{ "type": "text", "index": false }` at that point. Is one preferential?

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [February 15, 2021, 11:57pm UTC](https://discuss.elastic.co/t/understanding-implications-of-index-false-with-type-keyword/264352/3 "2021-02-15T23:57:30Z")

</div>

`text` fields are analysed by default - [Text field type | Elasticsearch Reference [7.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.11/text.html)

---

<div class="post-metadata">

### Author: ![workmanw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/workmanw/32/35517_2.png) [@workmanw](https://discuss.elastic.co/u/workmanw)
#### Post date: [February 16, 2021, 1:14am UTC](https://discuss.elastic.co/t/understanding-implications-of-index-false-with-type-keyword/264352/4 "2021-02-16T01:14:37Z")

</div>

> `text` fields are analysed by default -

So even when `index: false` is set, the analyzer will still be executed during indexing operations? If that's the case then it seems better to do:

```auto
"message_body": {
    "type": "keyword",
    "index": false,
    "doc_values": false,
    "ignore_above": 1
} 

```

---

<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: [March 16, 2021, 1:15am UTC](https://discuss.elastic.co/t/understanding-implications-of-index-false-with-type-keyword/264352/5 "2021-03-16T01:15:21Z")

</div>

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