Search in sources :

Example 31 with BoolQueryBuilder

use of org.opensearch.index.query.BoolQueryBuilder in project fess by codelibs.

the class BsClickLogCQ method bool.

public void bool(BoolCall<ClickLogCQ> boolLambda, ConditionOptionCall<BoolQueryBuilder> opLambda) {
    ClickLogCQ mustQuery = new ClickLogCQ();
    ClickLogCQ shouldQuery = new ClickLogCQ();
    ClickLogCQ mustNotQuery = new ClickLogCQ();
    ClickLogCQ filterQuery = new ClickLogCQ();
    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);
        }
    }
}
Also used : BoolQueryBuilder(org.opensearch.index.query.BoolQueryBuilder) ClickLogCQ(org.codelibs.fess.es.log.cbean.cq.ClickLogCQ)

Example 32 with BoolQueryBuilder

use of org.opensearch.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);
        }
    }
}
Also used : BoolQueryBuilder(org.opensearch.index.query.BoolQueryBuilder) ElevateWordToLabelCQ(org.codelibs.fess.es.config.cbean.cq.ElevateWordToLabelCQ)

Example 33 with BoolQueryBuilder

use of org.opensearch.index.query.BoolQueryBuilder in project fess by codelibs.

the class BsBadWordCQ method bool.

public void bool(BoolCall<BadWordCQ> boolLambda, ConditionOptionCall<BoolQueryBuilder> opLambda) {
    BadWordCQ mustQuery = new BadWordCQ();
    BadWordCQ shouldQuery = new BadWordCQ();
    BadWordCQ mustNotQuery = new BadWordCQ();
    BadWordCQ filterQuery = new BadWordCQ();
    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);
        }
    }
}
Also used : BadWordCQ(org.codelibs.fess.es.config.cbean.cq.BadWordCQ) BoolQueryBuilder(org.opensearch.index.query.BoolQueryBuilder)

Example 34 with BoolQueryBuilder

use of org.opensearch.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);
        }
    }
}
Also used : CrawlingInfoCQ(org.codelibs.fess.es.config.cbean.cq.CrawlingInfoCQ) BoolQueryBuilder(org.opensearch.index.query.BoolQueryBuilder)

Example 35 with BoolQueryBuilder

use of org.opensearch.index.query.BoolQueryBuilder in project fess by codelibs.

the class EsAbstractConditionQuery method getQuery.

public QueryBuilder getQuery() {
    if (queryBuilderList == null) {
        return null;
    } else if (queryBuilderList.size() == 1) {
        return queryBuilderList.get(0);
    }
    BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
    queryBuilderList.forEach(query -> {
        boolQuery.must(query);
    });
    return boolQuery;
}
Also used : BoolQueryBuilder(org.opensearch.index.query.BoolQueryBuilder)

Aggregations

BoolQueryBuilder (org.opensearch.index.query.BoolQueryBuilder)43 FessConfig (org.codelibs.fess.mylasta.direction.FessConfig)3 ArrayList (java.util.ArrayList)1 Collections (java.util.Collections)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Locale (java.util.Locale)1 Map (java.util.Map)1 PostConstruct (javax.annotation.PostConstruct)1 LogManager (org.apache.logging.log4j.LogManager)1 Logger (org.apache.logging.log4j.Logger)1 StringUtil (org.codelibs.core.lang.StringUtil)1 Tuple3 (org.codelibs.core.misc.Tuple3)1 Constants (org.codelibs.fess.Constants)1 SearchRequestType (org.codelibs.fess.entity.SearchRequestParams.SearchRequestType)1 SearchEngineClient (org.codelibs.fess.es.client.SearchEngineClient)1 SearchConditionBuilder (org.codelibs.fess.es.client.SearchEngineClient.SearchConditionBuilder)1 AccessTokenCQ (org.codelibs.fess.es.config.cbean.cq.AccessTokenCQ)1 BadWordCQ (org.codelibs.fess.es.config.cbean.cq.BadWordCQ)1 BoostDocumentRuleCQ (org.codelibs.fess.es.config.cbean.cq.BoostDocumentRuleCQ)1