Search in sources :

Example 36 with FilterAggregationBuilder

use of org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder in project fess by codelibs.

the class EsAbstractConditionAggregation method regFilterA.

protected FilterAggregationBuilder regFilterA(String name, QueryBuilder filter) {
    FilterAggregationBuilder builder = AggregationBuilders.filter(name, filter);
    regA(builder);
    return builder;
}
Also used : FilterAggregationBuilder(org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder)

Example 37 with FilterAggregationBuilder

use of org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder in project fess by codelibs.

the class BsFileAuthenticationCA method filter.

// ===================================================================================
//                                                                     Aggregation Set
//                                                                           =========
public void filter(String name, EsAbstractConditionQuery.OperatorCall<BsFileAuthenticationCQ> queryLambda, ConditionOptionCall<FilterAggregationBuilder> opLambda, OperatorCall<BsFileAuthenticationCA> aggsLambda) {
    FileAuthenticationCQ cq = new FileAuthenticationCQ();
    if (queryLambda != null) {
        queryLambda.callback(cq);
    }
    FilterAggregationBuilder builder = regFilterA(name, cq.getQuery());
    if (opLambda != null) {
        opLambda.callback(builder);
    }
    if (aggsLambda != null) {
        FileAuthenticationCA ca = new FileAuthenticationCA();
        aggsLambda.callback(ca);
        ca.getAggregationBuilderList().forEach(builder::subAggregation);
    }
}
Also used : BsFileAuthenticationCQ(org.codelibs.fess.es.config.cbean.cq.bs.BsFileAuthenticationCQ) FileAuthenticationCQ(org.codelibs.fess.es.config.cbean.cq.FileAuthenticationCQ) FileAuthenticationCA(org.codelibs.fess.es.config.cbean.ca.FileAuthenticationCA) FilterAggregationBuilder(org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder)

Example 38 with FilterAggregationBuilder

use of org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder in project fess by codelibs.

the class BsRequestHeaderCA method filter.

// ===================================================================================
//                                                                     Aggregation Set
//                                                                           =========
public void filter(String name, EsAbstractConditionQuery.OperatorCall<BsRequestHeaderCQ> queryLambda, ConditionOptionCall<FilterAggregationBuilder> opLambda, OperatorCall<BsRequestHeaderCA> aggsLambda) {
    RequestHeaderCQ cq = new RequestHeaderCQ();
    if (queryLambda != null) {
        queryLambda.callback(cq);
    }
    FilterAggregationBuilder builder = regFilterA(name, cq.getQuery());
    if (opLambda != null) {
        opLambda.callback(builder);
    }
    if (aggsLambda != null) {
        RequestHeaderCA ca = new RequestHeaderCA();
        aggsLambda.callback(ca);
        ca.getAggregationBuilderList().forEach(builder::subAggregation);
    }
}
Also used : BsRequestHeaderCQ(org.codelibs.fess.es.config.cbean.cq.bs.BsRequestHeaderCQ) RequestHeaderCQ(org.codelibs.fess.es.config.cbean.cq.RequestHeaderCQ) RequestHeaderCA(org.codelibs.fess.es.config.cbean.ca.RequestHeaderCA) FilterAggregationBuilder(org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder)

Example 39 with FilterAggregationBuilder

use of org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder in project fess by codelibs.

the class BsDataConfigToLabelCA method filter.

// ===================================================================================
//                                                                     Aggregation Set
//                                                                           =========
public void filter(String name, EsAbstractConditionQuery.OperatorCall<BsDataConfigToLabelCQ> queryLambda, ConditionOptionCall<FilterAggregationBuilder> opLambda, OperatorCall<BsDataConfigToLabelCA> aggsLambda) {
    DataConfigToLabelCQ cq = new DataConfigToLabelCQ();
    if (queryLambda != null) {
        queryLambda.callback(cq);
    }
    FilterAggregationBuilder builder = regFilterA(name, cq.getQuery());
    if (opLambda != null) {
        opLambda.callback(builder);
    }
    if (aggsLambda != null) {
        DataConfigToLabelCA ca = new DataConfigToLabelCA();
        aggsLambda.callback(ca);
        ca.getAggregationBuilderList().forEach(builder::subAggregation);
    }
}
Also used : FilterAggregationBuilder(org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder) DataConfigToLabelCQ(org.codelibs.fess.es.config.cbean.cq.DataConfigToLabelCQ) BsDataConfigToLabelCQ(org.codelibs.fess.es.config.cbean.cq.bs.BsDataConfigToLabelCQ) DataConfigToLabelCA(org.codelibs.fess.es.config.cbean.ca.DataConfigToLabelCA)

Example 40 with FilterAggregationBuilder

use of org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder in project fess by codelibs.

the class BsDataConfigCA method filter.

// ===================================================================================
//                                                                     Aggregation Set
//                                                                           =========
public void filter(String name, EsAbstractConditionQuery.OperatorCall<BsDataConfigCQ> queryLambda, ConditionOptionCall<FilterAggregationBuilder> opLambda, OperatorCall<BsDataConfigCA> aggsLambda) {
    DataConfigCQ cq = new DataConfigCQ();
    if (queryLambda != null) {
        queryLambda.callback(cq);
    }
    FilterAggregationBuilder builder = regFilterA(name, cq.getQuery());
    if (opLambda != null) {
        opLambda.callback(builder);
    }
    if (aggsLambda != null) {
        DataConfigCA ca = new DataConfigCA();
        aggsLambda.callback(ca);
        ca.getAggregationBuilderList().forEach(builder::subAggregation);
    }
}
Also used : FilterAggregationBuilder(org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder) BsDataConfigCQ(org.codelibs.fess.es.config.cbean.cq.bs.BsDataConfigCQ) DataConfigCQ(org.codelibs.fess.es.config.cbean.cq.DataConfigCQ) DataConfigCA(org.codelibs.fess.es.config.cbean.ca.DataConfigCA)

Aggregations

FilterAggregationBuilder (org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder)52 SearchRequest (org.elasticsearch.action.search.SearchRequest)6 SearchRequestBuilder (org.elasticsearch.action.search.SearchRequestBuilder)6 SearchResponse (org.elasticsearch.action.search.SearchResponse)6 Filter (org.elasticsearch.search.aggregations.bucket.filter.Filter)6 BoolQueryBuilder (org.elasticsearch.index.query.BoolQueryBuilder)5 Terms (org.elasticsearch.search.aggregations.bucket.terms.Terms)4 QueryBuilder (org.elasticsearch.index.query.QueryBuilder)2 StickyFacetBuilder (org.sonar.server.es.StickyFacetBuilder)2 ImmutableList (com.google.common.collect.ImmutableList)1 IOException (java.io.IOException)1 Arrays (java.util.Arrays)1 Map (java.util.Map)1 Objects (java.util.Objects)1 Collector (java.util.stream.Collector)1 Collectors (java.util.stream.Collectors)1 Nullable (javax.annotation.Nullable)1 ArrayUtils (org.apache.commons.lang.ArrayUtils)1 AccessTokenCA (org.codelibs.fess.es.config.cbean.ca.AccessTokenCA)1 BadWordCA (org.codelibs.fess.es.config.cbean.ca.BadWordCA)1