elasticsearch - Aggregation based on range and term - Stack Overflow

Problem: I want to have a bucket with range aggregation on win probability. But instead of having Bucke

Problem: I want to have a bucket with range aggregation on win probability. But instead of having Bucket of "WON" based on win probability, have it on Constants.REVENUE_STATUS is "WON" or "WON_PENDING".

Condition:

  1. PIPELINE = REVN_WIN_PROBABILITY (9, 31)
  2. UPSIDE = REVN_WIN_PROBABILITY (39, 51)
  3. FORECAST = REVN_WIN_PROBABILITY (59,101)
  4. WON = REVENUE_STATUS = "WON" or "WON_PENDING"

Existing Code:

AbstractAggregationBuilder getRevenueWinProbAggregationBuilder() {
    AbstractAggregationBuilder rangeAggBuilder = AggregationBuilders
            .range(FORECAST_STATUS_TYPE_AGGREGATION_NAME)
            .field(Constants.REVN_WIN_PROBABILITY)
            .addRange(ForecastType.PIPELINE.toString(), 9, 31)
            .addRange(ForecastType.UPSIDE.toString(), 39, 51)
            .addRange(ForecastType.FORECAST.toString(), 59, 101)
            .addRange(ForecastType.WON.toString(), 99, 101);
    return rangeAggBuilder;
}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745297625a4621236.html

相关推荐

  • elasticsearch - Aggregation based on range and term - Stack Overflow

    Problem: I want to have a bucket with range aggregation on win probability. But instead of having Bucke

    12小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信