use of org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder in project fess by codelibs.
the class BsClickLogCQ method functionScore.
// ===================================================================================
// Query Control
// =============
public void functionScore(OperatorCall<ClickLogCQ> queryLambda, ScoreFunctionCall<ScoreFunctionCreator<ClickLogCQ>> functionsLambda, final ConditionOptionCall<FunctionScoreQueryBuilder> opLambda) {
ClickLogCQ cq = new ClickLogCQ();
queryLambda.callback(cq);
final Collection<FilterFunctionBuilder> list = new ArrayList<>();
if (functionsLambda != null) {
functionsLambda.callback((cqLambda, scoreFunctionBuilder) -> {
ClickLogCQ cf = new ClickLogCQ();
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.opensearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder in project fess by codelibs.
the class EsAbstractConditionQuery method regFunctionScoreQ.
// ===================================================================================
// Register
// ========
protected FunctionScoreQueryBuilder regFunctionScoreQ(QueryBuilder queryBuilder, Collection<FilterFunctionBuilder> list) {
FunctionScoreQueryBuilder functionScoreQuery = QueryBuilders.functionScoreQuery(queryBuilder, list.toArray(new FilterFunctionBuilder[list.size()]));
regQ(functionScoreQuery);
return functionScoreQuery;
}
use of org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder in project fess by codelibs.
the class BsWebAuthenticationCQ method functionScore.
// ===================================================================================
// Query Control
// =============
public void functionScore(OperatorCall<WebAuthenticationCQ> queryLambda, ScoreFunctionCall<ScoreFunctionCreator<WebAuthenticationCQ>> functionsLambda, final ConditionOptionCall<FunctionScoreQueryBuilder> opLambda) {
WebAuthenticationCQ cq = new WebAuthenticationCQ();
queryLambda.callback(cq);
final Collection<FilterFunctionBuilder> list = new ArrayList<>();
if (functionsLambda != null) {
functionsLambda.callback((cqLambda, scoreFunctionBuilder) -> {
WebAuthenticationCQ cf = new WebAuthenticationCQ();
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.opensearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder in project fess by codelibs.
the class BsWebConfigCQ method functionScore.
// ===================================================================================
// Query Control
// =============
public void functionScore(OperatorCall<WebConfigCQ> queryLambda, ScoreFunctionCall<ScoreFunctionCreator<WebConfigCQ>> functionsLambda, final ConditionOptionCall<FunctionScoreQueryBuilder> opLambda) {
WebConfigCQ cq = new WebConfigCQ();
queryLambda.callback(cq);
final Collection<FilterFunctionBuilder> list = new ArrayList<>();
if (functionsLambda != null) {
functionsLambda.callback((cqLambda, scoreFunctionBuilder) -> {
WebConfigCQ cf = new WebConfigCQ();
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.opensearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder in project fess by codelibs.
the class BsCrawlingInfoCQ method functionScore.
// ===================================================================================
// Query Control
// =============
public void functionScore(OperatorCall<CrawlingInfoCQ> queryLambda, ScoreFunctionCall<ScoreFunctionCreator<CrawlingInfoCQ>> functionsLambda, final ConditionOptionCall<FunctionScoreQueryBuilder> opLambda) {
CrawlingInfoCQ cq = new CrawlingInfoCQ();
queryLambda.callback(cq);
final Collection<FilterFunctionBuilder> list = new ArrayList<>();
if (functionsLambda != null) {
functionsLambda.callback((cqLambda, scoreFunctionBuilder) -> {
CrawlingInfoCQ cf = new CrawlingInfoCQ();
cqLambda.callback(cf);
list.add(new FilterFunctionBuilder(cf.getQuery(), scoreFunctionBuilder));
});
}
final FunctionScoreQueryBuilder builder = regFunctionScoreQ(cq.getQuery(), list);
if (opLambda != null) {
opLambda.callback(builder);
}
}
Aggregations