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

 

posted @ 2020-09-17 15:46  所向披靡zz  阅读(2052)  评论(0编辑  收藏  举报