Search in sources :

Example 46 with FilterAggregationBuilder

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

the class BsThumbnailQueueCA method filter.

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

Example 47 with FilterAggregationBuilder

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

the class BsSearchLogCA method filter.

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

Example 48 with FilterAggregationBuilder

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

the class BsUserCA method filter.

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

Example 49 with FilterAggregationBuilder

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

the class BsBoostDocumentRuleCA method filter.

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

Example 50 with FilterAggregationBuilder

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

the class BsBadWordCA method filter.

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

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