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