Search in sources :

Example 1 with BsRelatedQueryCQ

use of org.codelibs.fess.es.config.cbean.cq.bs.BsRelatedQueryCQ in project fess by codelibs.

the class BsRelatedQueryCA method filter.

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

Aggregations

RelatedQueryCA (org.codelibs.fess.es.config.cbean.ca.RelatedQueryCA)1 RelatedQueryCQ (org.codelibs.fess.es.config.cbean.cq.RelatedQueryCQ)1 BsRelatedQueryCQ (org.codelibs.fess.es.config.cbean.cq.bs.BsRelatedQueryCQ)1 FilterAggregationBuilder (org.opensearch.search.aggregations.bucket.filter.FilterAggregationBuilder)1