use of org.opensearch.index.query.BoolQueryBuilder in project fess by codelibs.
the class EsAbstractConditionQuery method regBoolCQ.
protected BoolQueryBuilder regBoolCQ(List<QueryBuilder> mustList, List<QueryBuilder> shouldList, List<QueryBuilder> mustNotList, List<QueryBuilder> filterList) {
assertObjectNotNull("mustList", mustList);
assertObjectNotNull("shouldList", shouldList);
assertObjectNotNull("mustNotList", mustNotList);
assertObjectNotNull("filterList", filterList);
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
mustList.forEach(query -> {
boolQuery.must(query);
});
shouldList.forEach(query -> {
boolQuery.should(query);
});
mustNotList.forEach(query -> {
boolQuery.mustNot(query);
});
filterList.forEach(query -> {
boolQuery.filter(query);
});
regQ(boolQuery);
return boolQuery;
}
use of org.opensearch.index.query.BoolQueryBuilder in project fess by codelibs.
the class BsPathMappingCQ method bool.
public void bool(BoolCall<PathMappingCQ> boolLambda, ConditionOptionCall<BoolQueryBuilder> opLambda) {
PathMappingCQ mustQuery = new PathMappingCQ();
PathMappingCQ shouldQuery = new PathMappingCQ();
PathMappingCQ mustNotQuery = new PathMappingCQ();
PathMappingCQ filterQuery = new PathMappingCQ();
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.opensearch.index.query.BoolQueryBuilder in project fess by codelibs.
the class BsRequestHeaderCQ method bool.
public void bool(BoolCall<RequestHeaderCQ> boolLambda, ConditionOptionCall<BoolQueryBuilder> opLambda) {
RequestHeaderCQ mustQuery = new RequestHeaderCQ();
RequestHeaderCQ shouldQuery = new RequestHeaderCQ();
RequestHeaderCQ mustNotQuery = new RequestHeaderCQ();
RequestHeaderCQ filterQuery = new RequestHeaderCQ();
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.opensearch.index.query.BoolQueryBuilder in project fess by codelibs.
the class BsLabelTypeCQ method bool.
public void bool(BoolCall<LabelTypeCQ> boolLambda, ConditionOptionCall<BoolQueryBuilder> opLambda) {
LabelTypeCQ mustQuery = new LabelTypeCQ();
LabelTypeCQ shouldQuery = new LabelTypeCQ();
LabelTypeCQ mustNotQuery = new LabelTypeCQ();
LabelTypeCQ filterQuery = new LabelTypeCQ();
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.opensearch.index.query.BoolQueryBuilder in project fess by codelibs.
the class BsRoleTypeCQ method bool.
public void bool(BoolCall<RoleTypeCQ> boolLambda, ConditionOptionCall<BoolQueryBuilder> opLambda) {
RoleTypeCQ mustQuery = new RoleTypeCQ();
RoleTypeCQ shouldQuery = new RoleTypeCQ();
RoleTypeCQ mustNotQuery = new RoleTypeCQ();
RoleTypeCQ filterQuery = new RoleTypeCQ();
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);
}
}
}
Aggregations