use of org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder in project fess by codelibs.
the class BsWebConfigToLabelCQ method functionScore.
// ===================================================================================
// Query Control
// =============
public void functionScore(OperatorCall<WebConfigToLabelCQ> queryLambda, ScoreFunctionCall<ScoreFunctionCreator<WebConfigToLabelCQ>> functionsLambda, final ConditionOptionCall<FunctionScoreQueryBuilder> opLambda) {
WebConfigToLabelCQ cq = new WebConfigToLabelCQ();
queryLambda.callback(cq);
final Collection<FilterFunctionBuilder> list = new ArrayList<>();
if (functionsLambda != null) {
functionsLambda.callback((cqLambda, scoreFunctionBuilder) -> {
WebConfigToLabelCQ cf = new WebConfigToLabelCQ();
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 BsWebConfigToRoleCQ method functionScore.
// ===================================================================================
// Query Control
// =============
public void functionScore(OperatorCall<WebConfigToRoleCQ> queryLambda, ScoreFunctionCall<ScoreFunctionCreator<WebConfigToRoleCQ>> functionsLambda, final ConditionOptionCall<FunctionScoreQueryBuilder> opLambda) {
WebConfigToRoleCQ cq = new WebConfigToRoleCQ();
queryLambda.callback(cq);
final Collection<FilterFunctionBuilder> list = new ArrayList<>();
if (functionsLambda != null) {
functionsLambda.callback((cqLambda, scoreFunctionBuilder) -> {
WebConfigToRoleCQ cf = new WebConfigToRoleCQ();
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 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.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder 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.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder in project fess by codelibs.
the class BsSearchLogCQ method functionScore.
// ===================================================================================
// Query Control
// =============
public void functionScore(OperatorCall<SearchLogCQ> queryLambda, ScoreFunctionCall<ScoreFunctionCreator<SearchLogCQ>> functionsLambda, final ConditionOptionCall<FunctionScoreQueryBuilder> opLambda) {
SearchLogCQ cq = new SearchLogCQ();
queryLambda.callback(cq);
final Collection<FilterFunctionBuilder> list = new ArrayList<>();
if (functionsLambda != null) {
functionsLambda.callback((cqLambda, scoreFunctionBuilder) -> {
SearchLogCQ cf = new SearchLogCQ();
cqLambda.callback(cf);
list.add(new FilterFunctionBuilder(cf.getQuery(), scoreFunctionBuilder));
});
}
final FunctionScoreQueryBuilder builder = regFunctionScoreQ(cq.getQuery(), list);
if (opLambda != null) {
opLambda.callback(builder);
}
}
Aggregations