Search in sources :

Example 1 with CrawlingInfoParamCQ

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

the class BsCrawlingInfoParamCQ method bool.

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

Example 2 with CrawlingInfoParamCQ

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

the class BsCrawlingInfoParamCA method filter.

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

Example 3 with CrawlingInfoParamCQ

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

the class BsCrawlingInfoParamCQ method functionScore.

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

Aggregations

CrawlingInfoParamCQ (org.codelibs.fess.es.config.cbean.cq.CrawlingInfoParamCQ)3 ArrayList (java.util.ArrayList)1 CrawlingInfoParamCA (org.codelibs.fess.es.config.cbean.ca.CrawlingInfoParamCA)1 BsCrawlingInfoParamCQ (org.codelibs.fess.es.config.cbean.cq.bs.BsCrawlingInfoParamCQ)1 BoolQueryBuilder (org.elasticsearch.index.query.BoolQueryBuilder)1 FunctionScoreQueryBuilder (org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder)1 FilterFunctionBuilder (org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder)1 FilterAggregationBuilder (org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder)1