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 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 BsUserInfoCQ method functionScore.
// ===================================================================================
// Query Control
// =============
public void functionScore(OperatorCall<UserInfoCQ> queryLambda, ScoreFunctionCall<ScoreFunctionCreator<UserInfoCQ>> functionsLambda, final ConditionOptionCall<FunctionScoreQueryBuilder> opLambda) {
UserInfoCQ cq = new UserInfoCQ();
queryLambda.callback(cq);
final Collection<FilterFunctionBuilder> list = new ArrayList<>();
if (functionsLambda != null) {
functionsLambda.callback((cqLambda, scoreFunctionBuilder) -> {
UserInfoCQ cf = new UserInfoCQ();
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 BsFavoriteLogCQ method functionScore.
// ===================================================================================
// Query Control
// =============
public void functionScore(OperatorCall<FavoriteLogCQ> queryLambda, ScoreFunctionCall<ScoreFunctionCreator<FavoriteLogCQ>> functionsLambda, final ConditionOptionCall<FunctionScoreQueryBuilder> opLambda) {
FavoriteLogCQ cq = new FavoriteLogCQ();
queryLambda.callback(cq);
final Collection<FilterFunctionBuilder> list = new ArrayList<>();
if (functionsLambda != null) {
functionsLambda.callback((cqLambda, scoreFunctionBuilder) -> {
FavoriteLogCQ cf = new FavoriteLogCQ();
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 BsDuplicateHostCQ method functionScore.
// ===================================================================================
// Query Control
// =============
public void functionScore(OperatorCall<DuplicateHostCQ> queryLambda, ScoreFunctionCall<ScoreFunctionCreator<DuplicateHostCQ>> functionsLambda, final ConditionOptionCall<FunctionScoreQueryBuilder> opLambda) {
DuplicateHostCQ cq = new DuplicateHostCQ();
queryLambda.callback(cq);
final Collection<FilterFunctionBuilder> list = new ArrayList<>();
if (functionsLambda != null) {
functionsLambda.callback((cqLambda, scoreFunctionBuilder) -> {
DuplicateHostCQ cf = new DuplicateHostCQ();
cqLambda.callback(cf);
list.add(new FilterFunctionBuilder(cf.getQuery(), scoreFunctionBuilder));
});
}
final FunctionScoreQueryBuilder builder = regFunctionScoreQ(cq.getQuery(), list);
if (opLambda != null) {
opLambda.callback(builder);
}
}
Aggregations