org.elasticsearch.search.aggregations.metrics.ExtendedStatsAggregationBuilder Java Examples

The following examples show how to use org.elasticsearch.search.aggregations.metrics.ExtendedStatsAggregationBuilder. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ElasticsearchSearchQueryBase.java    From vertexium with Apache License 2.0 5 votes vote down vote up
protected List<AbstractAggregationBuilder> getElasticsearchStatisticsAggregations(StatisticsAggregation agg) {
    List<AbstractAggregationBuilder> aggs = new ArrayList<>();
    for (String propertyName : getPropertyNames(agg.getFieldName())) {
        String visibilityHash = getSearchIndex().getPropertyVisibilityHashFromPropertyName(propertyName);
        String aggName = createAggregationName(agg.getAggregationName(), visibilityHash);
        ExtendedStatsAggregationBuilder statsAgg = AggregationBuilders.extendedStats(aggName);
        statsAgg.field(propertyName);
        aggs.add(statsAgg);
    }
    return aggs;
}
 
Example #2
Source File: ElasticQueryBuilder.java    From vind with Apache License 2.0 5 votes vote down vote up
private static List<AggregationBuilder> getStatsAggregationBuilders(String searchContext, String contextualizedFacetName, Facet.StatsFacet statsFacet) {
    final List<AggregationBuilder> statsAggs = new ArrayList<>();
    final ExtendedStatsAggregationBuilder statsAgg = AggregationBuilders
            .extendedStats(contextualizedFacetName)
            .field(FieldUtil.getFieldName(statsFacet.getField(), searchContext));

    if (ArrayUtils.isNotEmpty(statsFacet.getPercentiles())) {
        statsAggs.add(AggregationBuilders
                .percentileRanks(contextualizedFacetName + "_percentiles", ArrayUtils.toPrimitive(statsFacet.getPercentiles()))
                .field(FieldUtil.getFieldName(statsFacet.getField(), searchContext))
        );
    }

    if (statsFacet.getCardinality()) {
        statsAggs.add(AggregationBuilders
                .cardinality(contextualizedFacetName + "_cardinality")
                .field(FieldUtil.getFieldName(statsFacet.getField(), searchContext))
        );
    }

    if (statsFacet.getCountDistinct() || statsFacet.getDistinctValues()) {
        statsAggs.add(AggregationBuilders
                .terms(contextualizedFacetName + "_values")
                .field(FieldUtil.getFieldName(statsFacet.getField(), searchContext))
        );
    }

    if (statsFacet.getMissing()) {
        statsAggs.add(AggregationBuilders
                .missing(contextualizedFacetName + "_missing")
                .field(FieldUtil.getFieldName(statsFacet.getField(), searchContext))
        );
    }

    statsAggs.add(statsAgg);
    return statsAggs;
}
 
Example #3
Source File: BsFileAuthenticationCA.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setCreatedTime_ExtendedStats(String name, ConditionOptionCall<ExtendedStatsAggregationBuilder> opLambda) {
    ExtendedStatsAggregationBuilder builder = regExtendedStatsA(name, "createdTime");
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #4
Source File: BsScheduledJobCA.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setUpdatedTime_ExtendedStats(String name, ConditionOptionCall<ExtendedStatsAggregationBuilder> opLambda) {
    ExtendedStatsAggregationBuilder builder = regExtendedStatsA(name, "updatedTime");
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #5
Source File: BsKeyMatchCA.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setMaxSize_ExtendedStats(ConditionOptionCall<ExtendedStatsAggregationBuilder> opLambda) {
    setMaxSize_ExtendedStats("maxSize", opLambda);
}
 
Example #6
Source File: BsAccessTokenCA.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setUpdatedTime_ExtendedStats(ConditionOptionCall<ExtendedStatsAggregationBuilder> opLambda) {
    setUpdatedTime_ExtendedStats("updatedTime", opLambda);
}
 
Example #7
Source File: BsFileConfigCA.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setIntervalTime_ExtendedStats(String name, ConditionOptionCall<ExtendedStatsAggregationBuilder> opLambda) {
    ExtendedStatsAggregationBuilder builder = regExtendedStatsA(name, "intervalTime");
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #8
Source File: BsAccessTokenCA.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setCreatedTime_ExtendedStats(ConditionOptionCall<ExtendedStatsAggregationBuilder> opLambda) {
    setCreatedTime_ExtendedStats("createdTime", opLambda);
}
 
Example #9
Source File: BsFileConfigCA.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setMaxAccessCount_ExtendedStats(String name, ConditionOptionCall<ExtendedStatsAggregationBuilder> opLambda) {
    ExtendedStatsAggregationBuilder builder = regExtendedStatsA(name, "maxAccessCount");
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #10
Source File: BsBoostDocumentRuleCA.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setUpdatedTime_ExtendedStats(ConditionOptionCall<ExtendedStatsAggregationBuilder> opLambda) {
    setUpdatedTime_ExtendedStats("updatedTime", opLambda);
}
 
Example #11
Source File: BsAccessTokenCA.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setExpiredTime_ExtendedStats(ConditionOptionCall<ExtendedStatsAggregationBuilder> opLambda) {
    setExpiredTime_ExtendedStats("expiredTime", opLambda);
}
 
Example #12
Source File: BsJobLogCA.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setStartTime_ExtendedStats(String name, ConditionOptionCall<ExtendedStatsAggregationBuilder> opLambda) {
    ExtendedStatsAggregationBuilder builder = regExtendedStatsA(name, "startTime");
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #13
Source File: BsKeyMatchCA.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setCreatedTime_ExtendedStats(String name, ConditionOptionCall<ExtendedStatsAggregationBuilder> opLambda) {
    ExtendedStatsAggregationBuilder builder = regExtendedStatsA(name, "createdTime");
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #14
Source File: BsDataConfigCA.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setSortOrder_ExtendedStats(String name, ConditionOptionCall<ExtendedStatsAggregationBuilder> opLambda) {
    ExtendedStatsAggregationBuilder builder = regExtendedStatsA(name, "sortOrder");
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #15
Source File: BsDataConfigCA.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setSortOrder_ExtendedStats(ConditionOptionCall<ExtendedStatsAggregationBuilder> opLambda) {
    setSortOrder_ExtendedStats("sortOrder", opLambda);
}
 
Example #16
Source File: BsDataConfigCA.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setCreatedTime_ExtendedStats(String name, ConditionOptionCall<ExtendedStatsAggregationBuilder> opLambda) {
    ExtendedStatsAggregationBuilder builder = regExtendedStatsA(name, "createdTime");
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #17
Source File: BsDataConfigCA.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setCreatedTime_ExtendedStats(ConditionOptionCall<ExtendedStatsAggregationBuilder> opLambda) {
    setCreatedTime_ExtendedStats("createdTime", opLambda);
}
 
Example #18
Source File: BsJobLogCA.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setLastUpdated_ExtendedStats(ConditionOptionCall<ExtendedStatsAggregationBuilder> opLambda) {
    setLastUpdated_ExtendedStats("lastUpdated", opLambda);
}
 
Example #19
Source File: BsDataConfigCA.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setBoost_ExtendedStats(ConditionOptionCall<ExtendedStatsAggregationBuilder> opLambda) {
    setBoost_ExtendedStats("boost", opLambda);
}
 
Example #20
Source File: BsLabelTypeCA.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setCreatedTime_ExtendedStats(String name, ConditionOptionCall<ExtendedStatsAggregationBuilder> opLambda) {
    ExtendedStatsAggregationBuilder builder = regExtendedStatsA(name, "createdTime");
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #21
Source File: BsDataConfigCA.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setAvailable_ExtendedStats(ConditionOptionCall<ExtendedStatsAggregationBuilder> opLambda) {
    setAvailable_ExtendedStats("available", opLambda);
}
 
Example #22
Source File: BsWebConfigCA.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setTimeToLive_ExtendedStats(ConditionOptionCall<ExtendedStatsAggregationBuilder> opLambda) {
    setTimeToLive_ExtendedStats("timeToLive", opLambda);
}
 
Example #23
Source File: BsFileConfigCA.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setNumOfThread_ExtendedStats(String name, ConditionOptionCall<ExtendedStatsAggregationBuilder> opLambda) {
    ExtendedStatsAggregationBuilder builder = regExtendedStatsA(name, "numOfThread");
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #24
Source File: BsBadWordCA.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setCreatedTime_ExtendedStats(String name, ConditionOptionCall<ExtendedStatsAggregationBuilder> opLambda) {
    ExtendedStatsAggregationBuilder builder = regExtendedStatsA(name, "createdTime");
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #25
Source File: BsWebAuthenticationCA.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setCreatedTime_ExtendedStats(ConditionOptionCall<ExtendedStatsAggregationBuilder> opLambda) {
    setCreatedTime_ExtendedStats("createdTime", opLambda);
}
 
Example #26
Source File: BsRoleTypeCA.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setCreatedTime_ExtendedStats(ConditionOptionCall<ExtendedStatsAggregationBuilder> opLambda) {
    setCreatedTime_ExtendedStats("createdTime", opLambda);
}
 
Example #27
Source File: EsAbstractConditionAggregation.java    From fess with Apache License 2.0 4 votes vote down vote up
protected ExtendedStatsAggregationBuilder regExtendedStatsA(String name, String field) {
    ExtendedStatsAggregationBuilder builder = AggregationBuilders.extendedStats(name).field(field);
    regA(builder);
    return builder;
}
 
Example #28
Source File: BsWebConfigCA.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setUpdatedTime_ExtendedStats(String name, ConditionOptionCall<ExtendedStatsAggregationBuilder> opLambda) {
    ExtendedStatsAggregationBuilder builder = regExtendedStatsA(name, "updatedTime");
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #29
Source File: BsLabelTypeCA.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setUpdatedTime_ExtendedStats(String name, ConditionOptionCall<ExtendedStatsAggregationBuilder> opLambda) {
    ExtendedStatsAggregationBuilder builder = regExtendedStatsA(name, "updatedTime");
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
 
Example #30
Source File: BsFileConfigCA.java    From fess with Apache License 2.0 4 votes vote down vote up
public void setAvailable_ExtendedStats(String name, ConditionOptionCall<ExtendedStatsAggregationBuilder> opLambda) {
    ExtendedStatsAggregationBuilder builder = regExtendedStatsA(name, "available");
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}