use of org.codelibs.fess.es.config.cbean.cq.ElevateWordCQ in project fess by codelibs.
the class BsElevateWordCQ method functionScore.
// ===================================================================================
// Query Control
// =============
public void functionScore(OperatorCall<ElevateWordCQ> queryLambda, ScoreFunctionCall<ScoreFunctionCreator<ElevateWordCQ>> functionsLambda, final ConditionOptionCall<FunctionScoreQueryBuilder> opLambda) {
ElevateWordCQ cq = new ElevateWordCQ();
queryLambda.callback(cq);
final Collection<FilterFunctionBuilder> list = new ArrayList<>();
if (functionsLambda != null) {
functionsLambda.callback((cqLambda, scoreFunctionBuilder) -> {
ElevateWordCQ cf = new ElevateWordCQ();
cqLambda.callback(cf);
list.add(new FilterFunctionBuilder(cf.getQuery(), scoreFunctionBuilder));
});
}
final FunctionScoreQueryBuilder builder = regFunctionScoreQ(cq.getQuery(), list);
if (opLambda != null) {
opLambda.callback(builder);
}
}
use of org.codelibs.fess.es.config.cbean.cq.ElevateWordCQ in project fess by codelibs.
the class BsElevateWordCA method filter.
// ===================================================================================
// Aggregation Set
// =========
public void filter(String name, EsAbstractConditionQuery.OperatorCall<BsElevateWordCQ> queryLambda, ConditionOptionCall<FilterAggregationBuilder> opLambda, OperatorCall<BsElevateWordCA> aggsLambda) {
ElevateWordCQ cq = new ElevateWordCQ();
if (queryLambda != null) {
queryLambda.callback(cq);
}
FilterAggregationBuilder builder = regFilterA(name, cq.getQuery());
if (opLambda != null) {
opLambda.callback(builder);
}
if (aggsLambda != null) {
ElevateWordCA ca = new ElevateWordCA();
aggsLambda.callback(ca);
ca.getAggregationBuilderList().forEach(builder::subAggregation);
}
}
use of org.codelibs.fess.es.config.cbean.cq.ElevateWordCQ in project fess by codelibs.
the class BsElevateWordCQ method bool.
public void bool(BoolCall<ElevateWordCQ> boolLambda, ConditionOptionCall<BoolQueryBuilder> opLambda) {
ElevateWordCQ mustQuery = new ElevateWordCQ();
ElevateWordCQ shouldQuery = new ElevateWordCQ();
ElevateWordCQ mustNotQuery = new ElevateWordCQ();
ElevateWordCQ filterQuery = new ElevateWordCQ();
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);
}
}
}
Aggregations