Search in sources :

Example 1 with ThumbnailQueueCQ

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

the class BsThumbnailQueueCQ method functionScore.

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

Example 2 with ThumbnailQueueCQ

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

the class BsThumbnailQueueCQ method bool.

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

Example 3 with ThumbnailQueueCQ

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

the class BsThumbnailQueueCA method filter.

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

Aggregations

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