Search in sources :

Example 36 with QueryBuilder

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

the class BsCrawlingInfoCB 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.opensearch.index.query.QueryBuilder)

Example 37 with QueryBuilder

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

the class BsElevateWordCB 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.opensearch.index.query.QueryBuilder)

Example 38 with QueryBuilder

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

the class BsFailureUrlCB 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.opensearch.index.query.QueryBuilder)

Example 39 with QueryBuilder

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

the class BsKeyMatchCB 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.opensearch.index.query.QueryBuilder)

Example 40 with QueryBuilder

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

the class BsRelatedQueryCB 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.opensearch.index.query.QueryBuilder)

Aggregations

QueryBuilder (org.opensearch.index.query.QueryBuilder)47 FessConfig (org.codelibs.fess.mylasta.direction.FessConfig)11 SearchEngineClient (org.codelibs.fess.es.client.SearchEngineClient)6 BoolQueryBuilder (org.opensearch.index.query.BoolQueryBuilder)6 Map (java.util.Map)5 LogManager (org.apache.logging.log4j.LogManager)4 Logger (org.apache.logging.log4j.Logger)4 StringUtil (org.codelibs.core.lang.StringUtil)4 Constants (org.codelibs.fess.Constants)4 MatchPhraseQueryBuilder (org.opensearch.index.query.MatchPhraseQueryBuilder)4 PrefixQueryBuilder (org.opensearch.index.query.PrefixQueryBuilder)4 ArrayList (java.util.ArrayList)3 List (java.util.List)3 Resource (javax.annotation.Resource)3 ComponentUtil (org.codelibs.fess.util.ComponentUtil)3 QueryBuilders (org.opensearch.index.query.QueryBuilders)3 HashMap (java.util.HashMap)2 Consumer (java.util.function.Consumer)2 PostConstruct (javax.annotation.PostConstruct)2 Tuple3 (org.codelibs.core.misc.Tuple3)2