ignore_above(忽略超越限制的字段)
curl -XPUT 'localhost:9200/my_index?pretty' -H 'Content-Type: application/json' -d'
{
"mappings": {
"my_type": {
"properties": {
"message": {
"type": "keyword",
"ignore_above": 20 # 1
}
}
}
}
}
'
curl -XPUT 'localhost:9200/my_index/my_type/1?pretty' -H 'Content-Type: application/json' -d' # 2
{
"message": "Syntax error"
}
'
curl -XPUT 'localhost:9200/my_index/my_type/2?pretty' -H 'Content-Type: application/json' -d' # 3
{
"message": "Syntax error with some long stacktrace"
}
'
curl -XGET 'localhost:9200/_search?pretty' -H 'Content-Type: application/json' -d' # 4
{
"aggs": {
"messages": {
"terms": {
"field": "message"
}
}
}
}Last updated