use of org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder 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.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder 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);
}
}
Aggregations