# Ignore\_above does not work

**URL:** <https://discuss.elastic.co/t/ignore-above-does-not-work/227710>\
**Category:** Elasticsearch\
**Created:** [April 12, 2020, 10:40pm UTC](https://discuss.elastic.co/t/ignore-above-does-not-work/227710 "2020-04-12T22:40:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guerreiro\_Sousa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guerreiro_sousa/32/46074_2.png) [@Guerreiro\_Sousa](https://discuss.elastic.co/u/Guerreiro_Sousa)\
**Post date:** [April 12, 2020, 10:40pm UTC](https://discuss.elastic.co/t/ignore-above-does-not-work/227710/1 "2020-04-12T22:40:13Z")

</div>

I'm trying to use "ignore\_above" for a "keyword" type field without success.

My mapping:

```
{
	"settings": {
		"index": {
			"number_of_shards": 1,
			"number_of_replicas": 1
		}
	},
	"mappings": {
		"properties": {
			"name": {
				"type": "text"
			},
			"age": {
				"type": "integer"
			},
			"role": {
				"type": "keyword",
				"ignore_above": 5
			},
			"post_date": {
				"type": "date"
			},
			"message": {
				"type": "text"
			}
		}
	}
}

```

Request for data insertion:

```
POST /example/_doc

{
	"name": "User Name",
	"post_date": "1990-07-02T14:12:12",
	"role": ["This is a test"],
	"message": "trying out Elasticsearch"
}

```

My output is returning the full value of "role" even using "ignore\_above":

```
GET /example/_search/

{
  "took": 1,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 1,
      "relation": "eq"
    },
    "max_score": 1.0,
    "hits": [
      {
        "_index": "example",
        "_type": "_doc",
        "_id": "1",
        "_score": 1.0,
        "_source": {
          "name": "fabio janio",
          "post_date": "1990-07-02T14:12:12",
          "role": ["This is a test"],
          "message": "trying out Elasticsearch"
        }
      }
    ]
  }
}
```

---

<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:** [April 13, 2020, 1:28am UTC](https://discuss.elastic.co/t/ignore-above-does-not-work/227710/2 "2020-04-13T01:28:53Z")

</div>

Did you try to search using this field?

The documentation says:

> **Do not index any string longer than this value.** Defaults to `2147483647` so that all values would be accepted. Please however note that default dynamic mapping rules create a sub `keyword` field that overrides this default by setting `ignore_above: 256` .

It does not mean that it should reject your document or modify the `_source` field.

---

<div class="post-metadata">

**Author:** ![Guerreiro\_Sousa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guerreiro_sousa/32/46074_2.png) [@Guerreiro\_Sousa](https://discuss.elastic.co/u/Guerreiro_Sousa)\
**Post date:** [April 13, 2020, 1:37am UTC](https://discuss.elastic.co/t/ignore-above-does-not-work/227710/3 "2020-04-13T01:37:20Z")

</div>

> [@dadoonet](#):
>
> Did you try to search using this field?
> 
> The documentation says:
> 
> > **Do not index any string longer than this value.** Defaults to `2147483647` so that all values would be accepted. Please however note that default dynamic mapping rules create a sub `keyword` field that overrides this default by setting `ignore_above: 256` .
> 
> It does not mean that it should reject your document or modify the `_source` field.

Thank you. Now I understand how it works.

---

<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:** [May 11, 2020, 1:37am UTC](https://discuss.elastic.co/t/ignore-above-does-not-work/227710/4 "2020-05-11T01:37:23Z")

</div>

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