Elasticsearch _mapping

http方式创建mapping:
PUT my_index/my_type/_mapping
{
    "properties": {
        "category": {
            "type": "long",
            "index": "not_analyzed"
        },
        "connection": {
            "type": "long",
            "index": "not_analyzed"
        },
        "time": {
            "type": "long",
            "index": "not_analyzed"
        },
        "user": {
            "type": "string",
            "index": "not_analyzed"
        },
        "ip": {
            "type": "ip",
            "index": "not_analyzed"
        }
    }
}
注:
"index": "not_analyzed" 指定字段不分词
默认 Elasticsearch 对 text 类型的字段是不可聚合的,基本类型可聚合

 

mapping type可参考官方

 

posted @ 2018-11-06 11:14  Hsinwang  阅读(145)  评论(0编辑  收藏  举报