# String mapping: ignore\_above for not\_analyzed fields

**URL:** <https://discuss.elastic.co/t/string-mapping-ignore-above-for-not-analyzed-fields/26511>\
**Category:** Elasticsearch\
**Created:** [July 29, 2015, 6:31pm UTC](https://discuss.elastic.co/t/string-mapping-ignore-above-for-not-analyzed-fields/26511 "2015-07-29T18:31:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![BradVido](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bradvido/32/741_2.png) [@BradVido](https://discuss.elastic.co/u/BradVido)\
**Post date:** [July 29, 2015, 6:31pm UTC](https://discuss.elastic.co/t/string-mapping-ignore-above-for-not-analyzed-fields/26511/1 "2015-07-29T18:31:27Z")

</div>

I have some string fields in ES with mappings like so:

```
{
  "index": "analyzed",
  "type": "string",
  "fields": {
	"raw": {
	  "index": "not_analyzed",
	  "ignore_above": 256,
	  "type": "string",
	  "doc_values": true
	}
  }
}

```

From [the docs](https://www.elastic.co/guide/en/elasticsearch/reference/1.6/mapping-core-types.html#string "the docs"), for the `ignore_above` setting:

> The analyzer will ignore strings larger than this size. Useful for generic not\_analyzed fields that should ignore long text.

What exactly does this mean? If my field is 257 characters, will the field.raw not be searchable at all? Will it not show up in aggregations. Will only the first 256 characters be included?

---

<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:** [July 29, 2015, 11:00pm UTC](https://discuss.elastic.co/t/string-mapping-ignore-above-for-not-analyzed-fields/26511/2 "2015-07-29T23:00:52Z")

</div>

Only the first 256 chars will be included, everything else will be dropped.

---

<div class="post-metadata">

**Author:** ![tsprlng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsprlng/32/4520_2.png) [@tsprlng](https://discuss.elastic.co/u/tsprlng)\
**Post date:** [September 1, 2015, 2:27pm UTC](https://discuss.elastic.co/t/string-mapping-ignore-above-for-not-analyzed-fields/26511/3 "2015-09-01T14:27:13Z")

</div>

This doesn't seem to be correct. I have a type defined as follows:

```auto
              "index": "analyzed",
              "omit_norms": true,
              "type": "string",
              "fields": {
                "raw": {
                  "index": "not_analyzed",
                  "ignore_above": 384,
                  "type": "string"
                }
              }

```

Terms aggregation completely fails on this field's .raw value – values that are longer are not truncated; no buckets at all are returned for these values.

---

<div class="post-metadata">

**Author:** ![BradVido](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bradvido/32/741_2.png) [@BradVido](https://discuss.elastic.co/u/BradVido)\
**Post date:** [October 30, 2015, 4:56pm UTC](https://discuss.elastic.co/t/string-mapping-ignore-above-for-not-analyzed-fields/26511/4 "2015-10-30T16:56:41Z")

</div>

I'm still trying to figure out what this means.

If the field is `not_analyzed`, then why do the docs mention that `the analyzer will ignore strings larger than this size...`?

> [@BradVido](#):
>
> The **analyzer** will ignore strings larger than this size. Useful for generic not\_analyzed fields that should ignore long text.

Edit: I just found that the [new 2.0 documentation](https://www.elastic.co/guide/en/elasticsearch/reference/2.0/ignore-above.html) better explains ignore\_above. That documentation doesn't exist for 1.x versions, but I'm hoping behavior was the same or very similar.

---

<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 5, 2017, 11:41pm UTC](https://discuss.elastic.co/t/string-mapping-ignore-above-for-not-analyzed-fields/26511/5 "2017-07-05T23:41:38Z")

</div>


