Search in sources :

Example 1 with PercentilesAggregationBuilder

use of org.elasticsearch.search.aggregations.metrics.percentiles.PercentilesAggregationBuilder in project fess by codelibs.

the class EsAbstractConditionAggregation method regPercentilesA.

protected PercentilesAggregationBuilder regPercentilesA(String name, String field) {
    PercentilesAggregationBuilder builder = AggregationBuilders.percentiles(name).field(field);
    regA(builder);
    return builder;
}
Also used : PercentilesAggregationBuilder(org.elasticsearch.search.aggregations.metrics.percentiles.PercentilesAggregationBuilder)

Example 2 with PercentilesAggregationBuilder

use of org.elasticsearch.search.aggregations.metrics.percentiles.PercentilesAggregationBuilder in project fess by codelibs.

the class EsAbstractConditionAggregation method regPercentilesA.

protected PercentilesAggregationBuilder regPercentilesA(String name, String field) {
    PercentilesAggregationBuilder builder = AggregationBuilders.percentiles(name).field(field);
    regA(builder);
    return builder;
}
Also used : PercentilesAggregationBuilder(org.elasticsearch.search.aggregations.metrics.percentiles.PercentilesAggregationBuilder)

Example 3 with PercentilesAggregationBuilder

use of org.elasticsearch.search.aggregations.metrics.percentiles.PercentilesAggregationBuilder in project elasticsearch by elastic.

the class PercentilesTests method createTestAggregatorBuilder.

@Override
protected PercentilesAggregationBuilder createTestAggregatorBuilder() {
    PercentilesAggregationBuilder factory = new PercentilesAggregationBuilder(randomAsciiOfLengthBetween(1, 20));
    if (randomBoolean()) {
        factory.keyed(randomBoolean());
    }
    if (randomBoolean()) {
        int percentsSize = randomIntBetween(1, 20);
        double[] percents = new double[percentsSize];
        for (int i = 0; i < percentsSize; i++) {
            percents[i] = randomDouble() * 100;
        }
        factory.percentiles(percents);
    }
    if (randomBoolean()) {
        factory.numberOfSignificantValueDigits(randomIntBetween(0, 5));
    }
    if (randomBoolean()) {
        factory.compression(randomIntBetween(1, 50000));
    }
    String field = randomNumericField();
    int randomFieldBranch = randomInt(3);
    switch(randomFieldBranch) {
        case 0:
            factory.field(field);
            break;
        case 1:
            factory.field(field);
            factory.script(new Script("_value + 1"));
            break;
        case 2:
            factory.script(new Script("doc[" + field + "] + 1"));
            break;
    }
    if (randomBoolean()) {
        factory.missing("MISSING");
    }
    if (randomBoolean()) {
        factory.format("###.00");
    }
    return factory;
}
Also used : Script(org.elasticsearch.script.Script) PercentilesAggregationBuilder(org.elasticsearch.search.aggregations.metrics.percentiles.PercentilesAggregationBuilder)

Example 4 with PercentilesAggregationBuilder

use of org.elasticsearch.search.aggregations.metrics.percentiles.PercentilesAggregationBuilder in project fess by codelibs.

the class EsAbstractConditionAggregation method regPercentilesA.

protected PercentilesAggregationBuilder regPercentilesA(String name, String field) {
    PercentilesAggregationBuilder builder = AggregationBuilders.percentiles(name).field(field);
    regA(builder);
    return builder;
}
Also used : PercentilesAggregationBuilder(org.elasticsearch.search.aggregations.metrics.percentiles.PercentilesAggregationBuilder)

Aggregations

PercentilesAggregationBuilder (org.elasticsearch.search.aggregations.metrics.percentiles.PercentilesAggregationBuilder)4 Script (org.elasticsearch.script.Script)1