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