Search in sources :

Example 26 with FilterAggregationBuilder

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

the class BsFileConfigToLabelCA method filter.

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

Example 27 with FilterAggregationBuilder

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

the class BsFileConfigToRoleCA method filter.

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

Example 28 with FilterAggregationBuilder

use of org.graylog.shaded.elasticsearch7.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 29 with FilterAggregationBuilder

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

the class BsWebConfigToRoleCA method filter.

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

Example 30 with FilterAggregationBuilder

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

the class BsLabelToRoleCA method filter.

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

Aggregations

FilterAggregationBuilder (org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder)33 BoolQueryBuilder (org.elasticsearch.index.query.BoolQueryBuilder)15 TermsAggregationBuilder (org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder)8 Map (java.util.Map)6 SearchRequest (org.elasticsearch.action.search.SearchRequest)6 SearchResponse (org.elasticsearch.action.search.SearchResponse)6 Test (org.junit.Test)6 SearchRequestBuilder (org.elasticsearch.action.search.SearchRequestBuilder)5 QueryBuilder (org.elasticsearch.index.query.QueryBuilder)5 AggregationBuilder (org.elasticsearch.search.aggregations.AggregationBuilder)5 Filter (org.elasticsearch.search.aggregations.bucket.filter.Filter)5 Terms (org.elasticsearch.search.aggregations.bucket.terms.Terms)5 DateTime (org.joda.time.DateTime)5 Search (io.searchbox.core.Search)3 Arrays (java.util.Arrays)3 List (java.util.List)3 Objects (java.util.Objects)3 Collectors (java.util.stream.Collectors)3 Nullable (javax.annotation.Nullable)3 ImmutableMap (com.google.common.collect.ImmutableMap)2