最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

elasticsearch - Aggregation based on range and term - Stack Overflow

programmeradmin1浏览0评论

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;
}
发布评论

评论列表(0)

  1. 暂无评论