use of org.codelibs.fess.es.log.cbean.cq.SearchLogCQ 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);
}
}
use of org.codelibs.fess.es.log.cbean.cq.SearchLogCQ in project fess by codelibs.
the class BsSearchLogCQ method bool.
public void bool(BoolCall<SearchLogCQ> boolLambda, ConditionOptionCall<BoolQueryBuilder> opLambda) {
SearchLogCQ mustQuery = new SearchLogCQ();
SearchLogCQ shouldQuery = new SearchLogCQ();
SearchLogCQ mustNotQuery = new SearchLogCQ();
SearchLogCQ filterQuery = new SearchLogCQ();
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.log.cbean.cq.SearchLogCQ in project fess by codelibs.
the class BsSearchLogCA method filter.
// ===================================================================================
// Aggregation Set
// =========
public void filter(String name, EsAbstractConditionQuery.OperatorCall<BsSearchLogCQ> queryLambda, ConditionOptionCall<FilterAggregationBuilder> opLambda, OperatorCall<BsSearchLogCA> aggsLambda) {
SearchLogCQ cq = new SearchLogCQ();
if (queryLambda != null) {
queryLambda.callback(cq);
}
FilterAggregationBuilder builder = regFilterA(name, cq.getQuery());
if (opLambda != null) {
opLambda.callback(builder);
}
if (aggsLambda != null) {
SearchLogCA ca = new SearchLogCA();
aggsLambda.callback(ca);
ca.getAggregationBuilderList().forEach(builder::subAggregation);
}
}
Aggregations