吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 1103|回复: 2
收起左侧

[已解决] 作废,请版主删除,谢谢!

[复制链接]
540558233 发表于 2020-7-29 16:55
本帖最后由 540558233 于 2020-9-14 13:54 编辑

此贴作废

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

自我催眠chg 发表于 2020-7-30 09:56
写出来了吗,用es-sql 跑了一下,没测正确性。
[Asm] 纯文本查看 复制代码
{
    "_source": {
        "excludes": [],
        "includes": [
            "com.alibaba.druid.xzl.sql.ast.expr.SQLAggregateExpr@63ff0831",
            "COUNT"
        ]
    },
    "aggregations": {
        "sysdt_d": {
            "aggregations": {
                "kv_from": {
                    "aggregations": {
                        "ui": {
                            "aggregations": {
                                "kv_itemId": {
                                    "aggregations": {
                                        "count": {
                                            "value_count": {
                                                "field": "_index"
                                            }
                                        }
                                    },
                                    "terms": {
                                        "field": "kv_itemId",
                                        "min_doc_count": 1,
                                        "order": [
                                            {
                                                "_count": "desc"
                                            },
                                            {
                                                "_term": "asc"
                                            }
                                        ],
                                        "shard_min_doc_count": 0,
                                        "show_term_doc_count_error": false,
                                        "size": 10
                                    }
                                }
                            },
                            "terms": {
                                "field": "ui",
                                "min_doc_count": 1,
                                "order": [
                                    {
                                        "_count": "desc"
                                    },
                                    {
                                        "_term": "asc"
                                    }
                                ],
                                "shard_min_doc_count": 0,
                                "show_term_doc_count_error": false,
                                "size": 10
                            }
                        }
                    },
                    "terms": {
                        "field": "kv_from",
                        "min_doc_count": 1,
                        "order": [
                            {
                                "_count": "desc"
                            },
                            {
                                "_term": "asc"
                            }
                        ],
                        "shard_min_doc_count": 0,
                        "show_term_doc_count_error": false,
                        "size": 10
                    }
                }
            },
            "terms": {
                "field": "sysdt_d",
                "min_doc_count": 1,
                "order": [
                    {
                        "_count": "desc"
                    },
                    {
                        "_term": "asc"
                    }
                ],
                "shard_min_doc_count": 3,
                "shard_size": 2000,
                "show_term_doc_count_error": false,
                "size": 2
            }
        }
    },
    "from": 0,
    "query": {
        "bool": {
            "adjust_pure_negative": true,
            "boost": 1.0,
            "disable_coord": false,
            "filter": [
                {
                    "bool": {
                        "adjust_pure_negative": true,
                        "boost": 1.0,
                        "disable_coord": false,
                        "must": [
                            {
                                "bool": {
                                    "adjust_pure_negative": true,
                                    "boost": 1.0,
                                    "disable_coord": false,
                                    "must": [
                                        {
                                            "match_phrase": {
                                                "ei": {
                                                    "boost": 1.0,
                                                    "query": "ga.sx.btn",
                                                    "slop": 0
                                                }
                                            }
                                        },
                                        {
                                            "range": {
                                                "sysdt_d": {
                                                    "boost": 1.0,
                                                    "from": "2020-07-01",
                                                    "include_lower": true,
                                                    "include_upper": true
                                                }
                                            }
                                        },
                                        {
                                            "range": {
                                                "sysdt_d": {
                                                    "boost": 1.0,
                                                    "include_lower": true,
                                                    "include_upper": true,
                                                    "to": "2020-07-30"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        ]
                    }
                }
            ]
        }
    },
    "size": 0,
    "stored_fields": "com.alibaba.druid.xzl.sql.ast.expr.SQLAggregateExpr@63ff0831"
}
自我催眠chg 发表于 2020-7-30 09:57
换php风格好看点
[PHP] 纯文本查看 复制代码
{
    "_source": {
        "excludes": [],
        "includes": [
            "com.alibaba.druid.xzl.sql.ast.expr.SQLAggregateExpr@63ff0831",
            "COUNT"
        ]
    },
    "aggregations": {
        "sysdt_d": {
            "aggregations": {
                "kv_from": {
                    "aggregations": {
                        "ui": {
                            "aggregations": {
                                "kv_itemId": {
                                    "aggregations": {
                                        "count": {
                                            "value_count": {
                                                "field": "_index"
                                            }
                                        }
                                    },
                                    "terms": {
                                        "field": "kv_itemId",
                                        "min_doc_count": 1,
                                        "order": [
                                            {
                                                "_count": "desc"
                                            },
                                            {
                                                "_term": "asc"
                                            }
                                        ],
                                        "shard_min_doc_count": 0,
                                        "show_term_doc_count_error": false,
                                        "size": 10
                                    }
                                }
                            },
                            "terms": {
                                "field": "ui",
                                "min_doc_count": 1,
                                "order": [
                                    {
                                        "_count": "desc"
                                    },
                                    {
                                        "_term": "asc"
                                    }
                                ],
                                "shard_min_doc_count": 0,
                                "show_term_doc_count_error": false,
                                "size": 10
                            }
                        }
                    },
                    "terms": {
                        "field": "kv_from",
                        "min_doc_count": 1,
                        "order": [
                            {
                                "_count": "desc"
                            },
                            {
                                "_term": "asc"
                            }
                        ],
                        "shard_min_doc_count": 0,
                        "show_term_doc_count_error": false,
                        "size": 10
                    }
                }
            },
            "terms": {
                "field": "sysdt_d",
                "min_doc_count": 1,
                "order": [
                    {
                        "_count": "desc"
                    },
                    {
                        "_term": "asc"
                    }
                ],
                "shard_min_doc_count": 3,
                "shard_size": 2000,
                "show_term_doc_count_error": false,
                "size": 2
            }
        }
    },
    "from": 0,
    "query": {
        "bool": {
            "adjust_pure_negative": true,
            "boost": 1.0,
            "disable_coord": false,
            "filter": [
                {
                    "bool": {
                        "adjust_pure_negative": true,
                        "boost": 1.0,
                        "disable_coord": false,
                        "must": [
                            {
                                "bool": {
                                    "adjust_pure_negative": true,
                                    "boost": 1.0,
                                    "disable_coord": false,
                                    "must": [
                                        {
                                            "match_phrase": {
                                                "ei": {
                                                    "boost": 1.0,
                                                    "query": "ga.sx.btn",
                                                    "slop": 0
                                                }
                                            }
                                        },
                                        {
                                            "range": {
                                                "sysdt_d": {
                                                    "boost": 1.0,
                                                    "from": "2020-07-01",
                                                    "include_lower": true,
                                                    "include_upper": true
                                                }
                                            }
                                        },
                                        {
                                            "range": {
                                                "sysdt_d": {
                                                    "boost": 1.0,
                                                    "include_lower": true,
                                                    "include_upper": true,
                                                    "to": "2020-07-30"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        ]
                    }
                }
            ]
        }
    },
    "size": 0,
    "stored_fields": "com.alibaba.druid.xzl.sql.ast.expr.SQLAggregateExpr@63ff0831"
}
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-26 13:30

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表