use of org.elasticsearch.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);
}
}
}
use of org.elasticsearch.index.query.BoolQueryBuilder in project fess by codelibs.
the class SuggestHelper method purgeDocumentSuggest.
public void purgeDocumentSuggest(final LocalDateTime time) {
final BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
boolQueryBuilder.must(QueryBuilders.rangeQuery(FieldNames.TIMESTAMP).lt(time.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli()));
boolQueryBuilder.must(QueryBuilders.termQuery(FieldNames.KINDS, SuggestItem.Kind.DOCUMENT.toString()));
boolQueryBuilder.mustNot(QueryBuilders.termQuery(FieldNames.KINDS, SuggestItem.Kind.QUERY.toString()));
boolQueryBuilder.mustNot(QueryBuilders.termQuery(FieldNames.KINDS, SuggestItem.Kind.USER.toString()));
SuggestUtil.deleteByQuery(fessEsClient, suggester.getIndex(), suggester.getType(), boolQueryBuilder);
}
use of org.elasticsearch.index.query.BoolQueryBuilder in project fess by codelibs.
the class BsCrawlingInfoCQ method bool.
public void bool(BoolCall<CrawlingInfoCQ> boolLambda, ConditionOptionCall<BoolQueryBuilder> opLambda) {
CrawlingInfoCQ mustQuery = new CrawlingInfoCQ();
CrawlingInfoCQ shouldQuery = new CrawlingInfoCQ();
CrawlingInfoCQ mustNotQuery = new CrawlingInfoCQ();
CrawlingInfoCQ filterQuery = new CrawlingInfoCQ();
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.elasticsearch.index.query.BoolQueryBuilder in project fess by codelibs.
the class BsDataConfigToLabelCQ method bool.
public void bool(BoolCall<DataConfigToLabelCQ> boolLambda, ConditionOptionCall<BoolQueryBuilder> opLambda) {
DataConfigToLabelCQ mustQuery = new DataConfigToLabelCQ();
DataConfigToLabelCQ shouldQuery = new DataConfigToLabelCQ();
DataConfigToLabelCQ mustNotQuery = new DataConfigToLabelCQ();
DataConfigToLabelCQ filterQuery = new DataConfigToLabelCQ();
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.elasticsearch.index.query.BoolQueryBuilder in project fess by codelibs.
the class BsElevateWordToLabelCQ method bool.
public void bool(BoolCall<ElevateWordToLabelCQ> boolLambda, ConditionOptionCall<BoolQueryBuilder> opLambda) {
ElevateWordToLabelCQ mustQuery = new ElevateWordToLabelCQ();
ElevateWordToLabelCQ shouldQuery = new ElevateWordToLabelCQ();
ElevateWordToLabelCQ mustNotQuery = new ElevateWordToLabelCQ();
ElevateWordToLabelCQ filterQuery = new ElevateWordToLabelCQ();
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