Search in sources :

Example 31 with BoolQueryBuilder

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

the class BsDataConfigCQ method bool.

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

Example 32 with BoolQueryBuilder

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

the class BsCrawlingInfoParamCQ method bool.

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

Example 33 with BoolQueryBuilder

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

the class BsDuplicateHostCQ method bool.

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

Example 34 with BoolQueryBuilder

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

the class BsFailureUrlCQ method bool.

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

Example 35 with BoolQueryBuilder

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

the class BsFileAuthenticationCQ method bool.

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

Aggregations

BoolQueryBuilder (org.elasticsearch.index.query.BoolQueryBuilder)98 QueryBuilder (org.elasticsearch.index.query.QueryBuilder)25 SearchResponse (org.elasticsearch.action.search.SearchResponse)15 SearchRequestBuilder (org.elasticsearch.action.search.SearchRequestBuilder)9 MatchQueryBuilder (org.elasticsearch.index.query.MatchQueryBuilder)9 HasParentQueryBuilder (org.elasticsearch.index.query.HasParentQueryBuilder)8 ElasticsearchAssertions.assertSearchResponse (org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse)7 ArrayList (java.util.ArrayList)5 HashMap (java.util.HashMap)5 List (java.util.List)5 MatchAllQueryBuilder (org.elasticsearch.index.query.MatchAllQueryBuilder)5 RangeQueryBuilder (org.elasticsearch.index.query.RangeQueryBuilder)5 Map (java.util.Map)4 AbstractAggregationBuilder (org.elasticsearch.search.aggregations.AbstractAggregationBuilder)4 FilterAggregationBuilder (org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder)4 FieldSortBuilder (org.elasticsearch.search.sort.FieldSortBuilder)4 Matchers.containsString (org.hamcrest.Matchers.containsString)4 StickyFacetBuilder (org.sonar.server.es.StickyFacetBuilder)4 HasChildQueryBuilder (org.elasticsearch.index.query.HasChildQueryBuilder)3 InnerHitBuilder (org.elasticsearch.index.query.InnerHitBuilder)3