当前位置:   article > 正文

es之pipeline用法_es pipeline

es pipeline
GET kibana_sample_data_ecommerce/_search
{
  "size": 1, 
  "aggs": {
    "count_of_day": {
      "terms": {
        "field":"day_of_week_i"
      },
      "aggs": {
        "avg_day_count": {
           "avg": {
              "field":"taxful_total_price"
            }
        }
      }
    },
    "min_miv_avg_count":{
      "min_bucket":{
        "buckets_path":"count_of_day>avg_day_count"
      }
    },
    "max_miv_avg_count":{
      "max_bucket":{
        "buckets_path":"count_of_day>avg_day_count"
      }
    }
    
  }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
GET kibana_sample_data_ecommerce/_search
{
  "size": 0, 
  "aggs": {
    "count_of_day": {
      "histogram": {
        "field":"day_of_week_i",
        "interval":2
      },
      "aggs": {
        "avg_day_count": {
           "avg": {
              "field":"taxful_total_price"
            }
        },
        // parent
        "deirective_xxx":{
          // 递归求和
          "cumulative_sum":{
            "buckets_path":"avg_day_count"
          }
        }
      }
    },
    
    // sibling
    "min_miv_avg_count":{
      "min_bucket":{
        "buckets_path":"count_of_day>avg_day_count"
      }
    },
    "max_miv_avg_count":{
      "max_bucket":{
        "buckets_path":"count_of_day>avg_day_count"
      }
    }
    
  }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/黑客灵魂/article/detail/812216
推荐阅读
  

闽ICP备14008679号