Search in sources :

Example 16 with QueryBuilder

use of org.opensearch.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.opensearch.index.query.QueryBuilder)

Example 17 with QueryBuilder

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

the class BsGroupCB 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 18 with QueryBuilder

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

the class IndexingHelper method getChildDocumentList.

public List<Map<String, Object>> getChildDocumentList(final SearchEngineClient searchEngineClient, final String id, final String[] fields) {
    final FessConfig fessConfig = ComponentUtil.getFessConfig();
    final QueryBuilder queryBuilder = QueryBuilders.termQuery(fessConfig.getIndexFieldParentId(), id);
    return getDocumentListByQuery(searchEngineClient, queryBuilder, fields);
}
Also used : QueryBuilder(org.opensearch.index.query.QueryBuilder) FessConfig(org.codelibs.fess.mylasta.direction.FessConfig)

Example 19 with QueryBuilder

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

the class IndexingHelper method deleteBySessionId.

public long deleteBySessionId(final String sessionId) {
    final FessConfig fessConfig = ComponentUtil.getFessConfig();
    final String index = fessConfig.getIndexDocumentUpdateIndex();
    final QueryBuilder queryBuilder = QueryBuilders.termQuery(fessConfig.getIndexFieldSegment(), sessionId);
    return deleteByQueryBuilder(index, queryBuilder);
}
Also used : QueryBuilder(org.opensearch.index.query.QueryBuilder) FessConfig(org.codelibs.fess.mylasta.direction.FessConfig)

Example 20 with QueryBuilder

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

the class IndexingHelper method deleteByVirtualHost.

public long deleteByVirtualHost(final String virtualHost) {
    final FessConfig fessConfig = ComponentUtil.getFessConfig();
    final String index = fessConfig.getIndexDocumentUpdateIndex();
    final QueryBuilder queryBuilder = QueryBuilders.termQuery(fessConfig.getIndexFieldVirtualHost(), virtualHost);
    return deleteByQueryBuilder(index, queryBuilder);
}
Also used : QueryBuilder(org.opensearch.index.query.QueryBuilder) FessConfig(org.codelibs.fess.mylasta.direction.FessConfig)

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