Search in sources :

Example 51 with QueryBuilder

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

the class BsRoleTypeCB method build.

// ===================================================================================
//                                                                               Build
//                                                                               =====
@Override
public SearchRequestBuilder build(SearchRequestBuilder builder) {
    if (_conditionQuery != null) {
        QueryBuilder queryBuilder = _conditionQuery.getQuery();
        if (queryBuilder != null) {
            builder.setQuery(queryBuilder);
        }
        _conditionQuery.getFieldSortBuilderList().forEach(sort -> {
            builder.addSort(sort);
        });
    }
    if (_conditionAggregation != null) {
        _conditionAggregation.getAggregationBuilderList().forEach(builder::addAggregation);
    }
    if (_specification != null) {
        builder.setFetchSource(_specification.columnList.toArray(new String[_specification.columnList.size()]), null);
    }
    return builder;
}
Also used : QueryBuilder(org.elasticsearch.index.query.QueryBuilder)

Example 52 with QueryBuilder

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

the class BsThumbnailQueueCB method build.

// ===================================================================================
//                                                                               Build
//                                                                               =====
@Override
public SearchRequestBuilder build(SearchRequestBuilder builder) {
    if (_conditionQuery != null) {
        QueryBuilder queryBuilder = _conditionQuery.getQuery();
        if (queryBuilder != null) {
            builder.setQuery(queryBuilder);
        }
        _conditionQuery.getFieldSortBuilderList().forEach(sort -> {
            builder.addSort(sort);
        });
    }
    if (_conditionAggregation != null) {
        _conditionAggregation.getAggregationBuilderList().forEach(builder::addAggregation);
    }
    if (_specification != null) {
        builder.setFetchSource(_specification.columnList.toArray(new String[_specification.columnList.size()]), null);
    }
    return builder;
}
Also used : QueryBuilder(org.elasticsearch.index.query.QueryBuilder)

Example 53 with QueryBuilder

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

the class BsWebAuthenticationCB method build.

// ===================================================================================
//                                                                               Build
//                                                                               =====
@Override
public SearchRequestBuilder build(SearchRequestBuilder builder) {
    if (_conditionQuery != null) {
        QueryBuilder queryBuilder = _conditionQuery.getQuery();
        if (queryBuilder != null) {
            builder.setQuery(queryBuilder);
        }
        _conditionQuery.getFieldSortBuilderList().forEach(sort -> {
            builder.addSort(sort);
        });
    }
    if (_conditionAggregation != null) {
        _conditionAggregation.getAggregationBuilderList().forEach(builder::addAggregation);
    }
    if (_specification != null) {
        builder.setFetchSource(_specification.columnList.toArray(new String[_specification.columnList.size()]), null);
    }
    return builder;
}
Also used : QueryBuilder(org.elasticsearch.index.query.QueryBuilder)

Example 54 with QueryBuilder

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

the class BsWebConfigToLabelCB method build.

// ===================================================================================
//                                                                               Build
//                                                                               =====
@Override
public SearchRequestBuilder build(SearchRequestBuilder builder) {
    if (_conditionQuery != null) {
        QueryBuilder queryBuilder = _conditionQuery.getQuery();
        if (queryBuilder != null) {
            builder.setQuery(queryBuilder);
        }
        _conditionQuery.getFieldSortBuilderList().forEach(sort -> {
            builder.addSort(sort);
        });
    }
    if (_conditionAggregation != null) {
        _conditionAggregation.getAggregationBuilderList().forEach(builder::addAggregation);
    }
    if (_specification != null) {
        builder.setFetchSource(_specification.columnList.toArray(new String[_specification.columnList.size()]), null);
    }
    return builder;
}
Also used : QueryBuilder(org.elasticsearch.index.query.QueryBuilder)

Example 55 with QueryBuilder

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

the class BsCrawlingInfoParamCB method build.

// ===================================================================================
//                                                                               Build
//                                                                               =====
@Override
public SearchRequestBuilder build(SearchRequestBuilder builder) {
    if (_conditionQuery != null) {
        QueryBuilder queryBuilder = _conditionQuery.getQuery();
        if (queryBuilder != null) {
            builder.setQuery(queryBuilder);
        }
        _conditionQuery.getFieldSortBuilderList().forEach(sort -> {
            builder.addSort(sort);
        });
    }
    if (_conditionAggregation != null) {
        _conditionAggregation.getAggregationBuilderList().forEach(builder::addAggregation);
    }
    if (_specification != null) {
        builder.setFetchSource(_specification.columnList.toArray(new String[_specification.columnList.size()]), null);
    }
    return builder;
}
Also used : QueryBuilder(org.elasticsearch.index.query.QueryBuilder)

Aggregations

QueryBuilder (org.elasticsearch.index.query.QueryBuilder)161 BoolQueryBuilder (org.elasticsearch.index.query.BoolQueryBuilder)51 SearchResponse (org.elasticsearch.action.search.SearchResponse)32 MatchAllQueryBuilder (org.elasticsearch.index.query.MatchAllQueryBuilder)25 Map (java.util.Map)22 ArrayList (java.util.ArrayList)19 AbstractQueryBuilder (org.elasticsearch.index.query.AbstractQueryBuilder)19 RangeQueryBuilder (org.elasticsearch.index.query.RangeQueryBuilder)19 MatchQueryBuilder (org.elasticsearch.index.query.MatchQueryBuilder)18 HashMap (java.util.HashMap)16 SearchRequestBuilder (org.elasticsearch.action.search.SearchRequestBuilder)16 IndexRequestBuilder (org.elasticsearch.action.index.IndexRequestBuilder)14 HasParentQueryBuilder (org.elasticsearch.index.query.HasParentQueryBuilder)14 TermQueryBuilder (org.elasticsearch.index.query.TermQueryBuilder)14 FunctionScoreQueryBuilder (org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder)14 IOException (java.io.IOException)12 FessConfig (org.codelibs.fess.mylasta.direction.FessConfig)12 MultiSearchResponse (org.elasticsearch.action.search.MultiSearchResponse)11 XContentParser (org.elasticsearch.common.xcontent.XContentParser)11 BytesRef (org.apache.lucene.util.BytesRef)10