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"
}
}
]
}
}