ES mapping设置字段别名
"domain" : {"type" : "text","analyzer" : "ik_max_word","norms" : false,"fields" : {"host" : {"type" : "keyword","doc_values":true}}},
字段 domain
别名 host
查询可以按照别名进行查询: domian.host
POST domain_name_aliases/_search { "aggs": { "aggCount": { "terms": { "field": "domain.host" } } } }