Search in sources :

Example 1 with ClickLogCQ

use of org.codelibs.fess.es.log.cbean.cq.ClickLogCQ in project fess by codelibs.

the class BsClickLogCQ method functionScore.

// ===================================================================================
// Query Control
// =============
public void functionScore(OperatorCall<ClickLogCQ> queryLambda, ScoreFunctionCall<ScoreFunctionCreator<ClickLogCQ>> functionsLambda, final ConditionOptionCall<FunctionScoreQueryBuilder> opLambda) {
    ClickLogCQ cq = new ClickLogCQ();
    queryLambda.callback(cq);
    final Collection<FilterFunctionBuilder> list = new ArrayList<>();
    if (functionsLambda != null) {
        functionsLambda.callback((cqLambda, scoreFunctionBuilder) -> {
            ClickLogCQ cf = new ClickLogCQ();
            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) ClickLogCQ(org.codelibs.fess.es.log.cbean.cq.ClickLogCQ)

Example 2 with ClickLogCQ

use of org.codelibs.fess.es.log.cbean.cq.ClickLogCQ in project fess by codelibs.

the class BsClickLogCQ method bool.

public void bool(BoolCall<ClickLogCQ> boolLambda, ConditionOptionCall<BoolQueryBuilder> opLambda) {
    ClickLogCQ mustQuery = new ClickLogCQ();
    ClickLogCQ shouldQuery = new ClickLogCQ();
    ClickLogCQ mustNotQuery = new ClickLogCQ();
    ClickLogCQ filterQuery = new ClickLogCQ();
    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) ClickLogCQ(org.codelibs.fess.es.log.cbean.cq.ClickLogCQ)

Example 3 with ClickLogCQ

use of org.codelibs.fess.es.log.cbean.cq.ClickLogCQ in project fess by codelibs.

the class BsClickLogCA method filter.

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

Aggregations

ClickLogCQ (org.codelibs.fess.es.log.cbean.cq.ClickLogCQ)3 ArrayList (java.util.ArrayList)1 ClickLogCA (org.codelibs.fess.es.log.cbean.ca.ClickLogCA)1 BsClickLogCQ (org.codelibs.fess.es.log.cbean.cq.bs.BsClickLogCQ)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