首页 > 编程知识 正文

elasticsearch 字段运算,elasticsearch 聚合函数

时间:2023-05-04 03:15:28 阅读:194398 作者:386

curl - XPUT 'http://192.168.1.181:9200/t_url-2018-12-04/' - d ' {   # 指定url地址  索引名称
    "settings": {
        "index": {
            "number_of_shards": 2, #分区数
            "number_of_replicas": 1##副本数
        }
    },
    "mappings": {
        "info": {
            "properties": {
                "referer": {
                    "type": "string", #类型
                    "index": "not_analyzed" #设置不分词
                },
                "descid": {
                    "type": "integer",
                    "index": "not_analyzed"
                },
                "line": {
                    "type": "string",
                    "index": "not_analyzed"
                },
                "words": {
                    "type": "string",
                    "index": "not_analyzed"
                },
                "dip": {
                    "type": "ip",
                    "index": "not_analyzed"
                },
                "starttime": {
                    "type": "date", #日期类型
                    "format": "yyy-MM-dd HH:mm:ss"
                },

                "dir": {
                    "type": "integer",
                    "index": "not_analyzed"
                },
                "rid": {
                    "type": "string",
                    "index": "not_analyzed"
                },
                "type": {
                    "type": "integer",
                    "index": "not_analyzed"
                },
                "grpids": {
                    "type": "integer",
                    "index": "not_analyzed"
                },
                "platform": {
                    "type": "string",
                    "index": "not_analyzed"
                },
                "url": {
                    "type": "string",
                    "index": "not_analyzed"
                },
                "dport": {
                    "type": "integer",
                    "index": "not_analyzed"
                },
                "subtype": {
                    "type": "integer",
                    "index": "not_analyzed"
                },
                "bytes": {
                    "type": "integer",
                    "index": "not_analyzed"
                },
                "browser": {
                    "type": "string",
                    "index": "not_analyzed"
                },
                "domain": {
                    "type": "string",
                    "index": "not_analyzed"
                },
                "action": {
                    "type": "string",
                    "index": "not_analyzed"
                },
                "termtype": {
                    "type": "string",
                    "index": "not_analyzed"
                },
                "sip": {
                    "type": "ip",
                    "index": "not_analyzed"
                },
                "sport": {
                    "type": "integer",
                    "index": "not_analyzed"
                },
                "username": {
                    "type": "string",
                    "index": "not_analyzed"
                }
            }
        }
    }
}
'

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。