Search in sources :

Example 1 with ScheduledJobCQ

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

the class BsScheduledJobCQ method bool.

public void bool(BoolCall<ScheduledJobCQ> boolLambda, ConditionOptionCall<BoolQueryBuilder> opLambda) {
    ScheduledJobCQ mustQuery = new ScheduledJobCQ();
    ScheduledJobCQ shouldQuery = new ScheduledJobCQ();
    ScheduledJobCQ mustNotQuery = new ScheduledJobCQ();
    ScheduledJobCQ filterQuery = new ScheduledJobCQ();
    boolLambda.callback(mustQuery, shouldQuery, mustNotQuery, filterQuery);
    if (mustQuery.hasQueries() || shouldQuery.hasQueries() || mustNotQuery.hasQueries() || filterQuery.hasQueries()) {
        BoolQueryBuilder builder = regBoolCQ(mustQuery.getQueryBuilderList(), shouldQuery.getQueryBuilderList(), mustNotQuery.getQueryBuilderList(), filterQuery.getQueryBuilderList());
        if (opLambda != null) {
            opLambda.callback(builder);
        }
    }
}
Also used : BoolQueryBuilder(org.opensearch.index.query.BoolQueryBuilder) ScheduledJobCQ(org.codelibs.fess.es.config.cbean.cq.ScheduledJobCQ)

Example 2 with ScheduledJobCQ

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

the class BsScheduledJobCQ method functionScore.

// ===================================================================================
// Query Control
// =============
public void functionScore(OperatorCall<ScheduledJobCQ> queryLambda, ScoreFunctionCall<ScoreFunctionCreator<ScheduledJobCQ>> functionsLambda, final ConditionOptionCall<FunctionScoreQueryBuilder> opLambda) {
    ScheduledJobCQ cq = new ScheduledJobCQ();
    queryLambda.callback(cq);
    final Collection<FilterFunctionBuilder> list = new ArrayList<>();
    if (functionsLambda != null) {
        functionsLambda.callback((cqLambda, scoreFunctionBuilder) -> {
            ScheduledJobCQ cf = new ScheduledJobCQ();
            cqLambda.callback(cf);
            list.add(new FilterFunctionBuilder(cf.getQuery(), scoreFunctionBuilder));
        });
    }
    final FunctionScoreQueryBuilder builder = regFunctionScoreQ(cq.getQuery(), list);
    if (opLambda != null) {
        opLambda.callback(builder);
    }
}
Also used : FunctionScoreQueryBuilder(org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder) FilterFunctionBuilder(org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder) ArrayList(java.util.ArrayList) ScheduledJobCQ(org.codelibs.fess.es.config.cbean.cq.ScheduledJobCQ)

Example 3 with ScheduledJobCQ

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

the class BsScheduledJobCA method filter.

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

Aggregations

ScheduledJobCQ (org.codelibs.fess.es.config.cbean.cq.ScheduledJobCQ)3 ArrayList (java.util.ArrayList)1 ScheduledJobCA (org.codelibs.fess.es.config.cbean.ca.ScheduledJobCA)1 BsScheduledJobCQ (org.codelibs.fess.es.config.cbean.cq.bs.BsScheduledJobCQ)1 BoolQueryBuilder (org.opensearch.index.query.BoolQueryBuilder)1 FunctionScoreQueryBuilder (org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder)1 FilterFunctionBuilder (org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder)1 FilterAggregationBuilder (org.opensearch.search.aggregations.bucket.filter.FilterAggregationBuilder)1