Search in sources :

Example 41 with BoolQueryBuilder

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

the class BsThumbnailQueueCQ method bool.

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

Example 42 with BoolQueryBuilder

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

the class BsWebConfigToLabelCQ method bool.

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

Example 43 with BoolQueryBuilder

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

the class BsWebConfigToRoleCQ method bool.

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

Example 44 with BoolQueryBuilder

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

the class BsFavoriteLogCQ method bool.

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

Example 45 with BoolQueryBuilder

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

the class BsSearchFieldLogCQ method bool.

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

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