Search in sources :

Example 1 with CrawlingInfoCQ

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

the class BsCrawlingInfoCA method filter.

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

Example 2 with CrawlingInfoCQ

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

the class BsCrawlingInfoCQ method functionScore.

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

Example 3 with CrawlingInfoCQ

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

the class BsCrawlingInfoCQ method bool.

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

Aggregations

CrawlingInfoCQ (org.codelibs.fess.es.config.cbean.cq.CrawlingInfoCQ)3 ArrayList (java.util.ArrayList)1 CrawlingInfoCA (org.codelibs.fess.es.config.cbean.ca.CrawlingInfoCA)1 BsCrawlingInfoCQ (org.codelibs.fess.es.config.cbean.cq.bs.BsCrawlingInfoCQ)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