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