Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能不能将dsl转为sql,我看dsl支持在嵌套子聚合里限制每个聚合的大小,sql有没有办法做到这一点,大佬有研究没? #42

Open
PandyYang opened this issue Jan 20, 2025 · 0 comments

Comments

@PandyYang
Copy link

例如这种嵌套子聚合,用sql的话是不是不好搞?
官方文档如下:https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html

  "aggs": {
    "dimtimeyear": {
      "terms": {
        "size": 10,
        "field": "dimensions.time.year",
        "order": {
          "_term": "asc"
        }
      },
      "aggs": {
        "dimtimemonth": {
          "terms": {
            "size": 10,
            "field": "dimensions.time.month",
            "order": {
              "_term": "asc"
            }
          },
          "aggs": {
            "dimtimeday": {
              "terms": {
                "size": 10,
                "field": "dimensions.time.day",
                "order": {
                  "_term": "asc"
                }
              },
              "aggs": {
                "dimtimeweek": {
                  "terms": {
                    "size": 10,
                    "field": "dimensions.time.week",
                    "order": {
                      "_term": "asc"
                    }
                  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant