Search in sources :

Example 1 with ParsedTerms

use of org.elasticsearch.search.aggregations.bucket.terms.ParsedTerms in project incubator-inlong by apache.

the class AuditServiceImpl method listByCondition.

/**
 * Query audit data for list by condition
 *
 * @param request The audit request of query condition
 * @return The result of query
 */
@Override
public List<AuditVO> listByCondition(AuditRequest request) throws IOException {
    LOGGER.info("begin query audit list request={}", request);
    Preconditions.checkNotNull(request, "request is null");
    List<AuditVO> result = new ArrayList<>();
    AuditQuerySource querySource = AuditQuerySource.valueOf(auditQuerySource);
    for (String auditId : request.getAuditIds()) {
        if (AuditQuerySource.MYSQL == querySource) {
            String format = "%Y-%m-%d %H:%i:00";
            // Support min agg at now
            DateTimeFormatter forPattern = DateTimeFormat.forPattern("yyyy-MM-dd");
            DateTime dtDate = forPattern.parseDateTime(request.getDt());
            String eDate = dtDate.plusDays(1).toString(forPattern);
            List<Map<String, Object>> sumList = auditEntityMapper.sumByLogTs(request.getInlongGroupId(), request.getInlongStreamId(), auditId, request.getDt(), eDate, format);
            List<AuditInfo> auditSet = sumList.stream().map(s -> {
                AuditInfo vo = new AuditInfo();
                vo.setLogTs((String) s.get("logTs"));
                vo.setCount(((BigDecimal) s.get("total")).longValue());
                return vo;
            }).collect(Collectors.toList());
            result.add(new AuditVO(auditId, auditSet));
        } else if (AuditQuerySource.ELASTICSEARCH == querySource) {
            String index = String.format("%s_%s", request.getDt().replaceAll("-", ""), auditId);
            if (elasticsearchApi.indexExists(index)) {
                SearchResponse response = elasticsearchApi.search(toAuditSearchRequest(index, request.getInlongGroupId(), request.getInlongStreamId()));
                final List<Aggregation> aggregations = response.getAggregations().asList();
                if (CollectionUtils.isNotEmpty(aggregations)) {
                    ParsedTerms terms = (ParsedTerms) aggregations.get(0);
                    if (CollectionUtils.isNotEmpty(terms.getBuckets())) {
                        List<AuditInfo> auditSet = terms.getBuckets().stream().map(bucket -> {
                            AuditInfo vo = new AuditInfo();
                            vo.setLogTs(bucket.getKeyAsString());
                            vo.setCount((long) ((ParsedSum) bucket.getAggregations().asList().get(0)).getValue());
                            return vo;
                        }).collect(Collectors.toList());
                        result.add(new AuditVO(auditId, auditSet));
                    }
                }
            } else {
                LOGGER.warn("Elasticsearch index={} not exists", index);
            }
        }
    }
    LOGGER.info("success to query audit list for request={}", request);
    return result;
}
Also used : AuditService(org.apache.inlong.manager.service.core.AuditService) LoggerFactory(org.slf4j.LoggerFactory) AuditInfo(org.apache.inlong.manager.common.pojo.audit.AuditInfo) Autowired(org.springframework.beans.factory.annotation.Autowired) SearchRequest(org.elasticsearch.action.search.SearchRequest) AuditEntityMapper(org.apache.inlong.manager.dao.mapper.AuditEntityMapper) ArrayList(java.util.ArrayList) AuditVO(org.apache.inlong.manager.common.pojo.audit.AuditVO) Value(org.springframework.beans.factory.annotation.Value) BigDecimal(java.math.BigDecimal) Preconditions(org.apache.inlong.manager.common.util.Preconditions) CollectionUtils(org.apache.commons.collections.CollectionUtils) Service(org.springframework.stereotype.Service) Map(java.util.Map) SearchResponse(org.elasticsearch.action.search.SearchResponse) SearchSourceBuilder(org.elasticsearch.search.builder.SearchSourceBuilder) Aggregation(org.elasticsearch.search.aggregations.Aggregation) TermsAggregationBuilder(org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder) DateTimeFormat(org.joda.time.format.DateTimeFormat) ParsedTerms(org.elasticsearch.search.aggregations.bucket.terms.ParsedTerms) Logger(org.slf4j.Logger) ParsedSum(org.elasticsearch.search.aggregations.metrics.sum.ParsedSum) DateTimeFormatter(org.joda.time.format.DateTimeFormatter) DateTime(org.joda.time.DateTime) IOException(java.io.IOException) AggregationBuilders(org.elasticsearch.search.aggregations.AggregationBuilders) Collectors(java.util.stream.Collectors) ElasticsearchApi(org.apache.inlong.manager.service.thirdparty.elasticsearch.ElasticsearchApi) QueryBuilders.termQuery(org.elasticsearch.index.query.QueryBuilders.termQuery) List(java.util.List) AuditRequest(org.apache.inlong.manager.common.pojo.audit.AuditRequest) SortOrder(org.elasticsearch.search.sort.SortOrder) AuditQuerySource(org.apache.inlong.manager.common.enums.AuditQuerySource) BoolQueryBuilder(org.elasticsearch.index.query.BoolQueryBuilder) AuditQuerySource(org.apache.inlong.manager.common.enums.AuditQuerySource) AuditInfo(org.apache.inlong.manager.common.pojo.audit.AuditInfo) ParsedTerms(org.elasticsearch.search.aggregations.bucket.terms.ParsedTerms) ArrayList(java.util.ArrayList) ParsedSum(org.elasticsearch.search.aggregations.metrics.sum.ParsedSum) DateTime(org.joda.time.DateTime) BigDecimal(java.math.BigDecimal) SearchResponse(org.elasticsearch.action.search.SearchResponse) AuditVO(org.apache.inlong.manager.common.pojo.audit.AuditVO) ArrayList(java.util.ArrayList) List(java.util.List) DateTimeFormatter(org.joda.time.format.DateTimeFormatter) Map(java.util.Map)

Example 2 with ParsedTerms

use of org.elasticsearch.search.aggregations.bucket.terms.ParsedTerms in project apiman by apiman.

the class EsRegistry method listClientVersions.

@Override
@SuppressWarnings("nls")
public void listClientVersions(String organizationId, String clientId, int page, int pageSize, IAsyncResultHandler<List<String>> handler) {
    String query = "{" + "  \"query\": {" + "    \"bool\": {" + "      \"filter\": [" + "        {" + "          \"term\": {" + // organizationId
    "            \"organizationId\": \"{{organizationId}}\"" + "          }" + "        }," + "        {" + "          \"term\": {" + // clientId
    "            \"clientId\": \"{{clientId}}\"" + "          }" + "        }" + "      ]" + "    }" + "  }," + "    \"aggs\": {" + "      \"client_versions\": {" + "        \"terms\": {" + // only return version fields of clients
    "          \"field\": \"version\"" + "        }" + "      }" + "    }" + "}";
    SearchTemplateRequest searchTemplateRequest = new SearchTemplateRequest();
    searchTemplateRequest.setRequest(new SearchRequest(getIndexPrefix() + EsConstants.INDEX_CLIENTS));
    searchTemplateRequest.setScriptType(ScriptType.INLINE);
    searchTemplateRequest.setScript(query);
    Map<String, Object> scriptParams = new HashMap<>();
    scriptParams.put("organizationId", organizationId);
    scriptParams.put("clientId", clientId);
    searchTemplateRequest.setScriptParams(scriptParams);
    try {
        SearchTemplateResponse response = getClient().searchTemplate(searchTemplateRequest, RequestOptions.DEFAULT);
        SearchResponse searchResponse = response.getResponse();
        List terms = ((ParsedTerms) searchResponse.getAggregations().asMap().get("client_versions")).getBuckets();
        // Grab only the name of each aggregation (we don't care about count
        List<String> results = (List<String>) terms.stream().map(o -> ((ParsedTerms.ParsedBucket) o).getKey()).collect(Collectors.toList());
        handler.handle(AsyncResultImpl.create(results));
    } catch (IOException e) {
        LOGGER.error(e.getMessage(), e);
    }
}
Also used : SearchRequest(org.elasticsearch.action.search.SearchRequest) ParsedTerms(org.elasticsearch.search.aggregations.bucket.terms.ParsedTerms) HashMap(java.util.HashMap) SearchTemplateRequest(org.elasticsearch.script.mustache.SearchTemplateRequest) SearchTemplateResponse(org.elasticsearch.script.mustache.SearchTemplateResponse) List(java.util.List) IOException(java.io.IOException) SearchResponse(org.elasticsearch.action.search.SearchResponse)

Example 3 with ParsedTerms

use of org.elasticsearch.search.aggregations.bucket.terms.ParsedTerms in project apiman by apiman.

the class EsRegistry method listOrgs.

@Override
@SuppressWarnings("nls")
public void listOrgs(IAsyncResultHandler<List<String>> handler) {
    try {
        SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
        // i.e. only records containing an organizationId field:
        TermsAggregationBuilder aggregation = AggregationBuilders.terms("all_orgs").field("organizationId");
        // keep searching in specific api mgmt indices to avoid search in foreign indices beside specific api-mgmt ones
        String[] indices = { getIndexPrefix() + EsConstants.INDEX_APIS, getIndexPrefix() + EsConstants.INDEX_CLIENTS };
        SearchRequest searchRequest = new SearchRequest(indices).source(searchSourceBuilder.aggregation(aggregation));
        SearchResponse searchResponse = getClient().search(searchRequest, RequestOptions.DEFAULT);
        List terms = ((ParsedTerms) searchResponse.getAggregations().asMap().get("all_orgs")).getBuckets();
        // Grab only the name of each aggregation (we don't care about count
        List<String> results = (List<String>) terms.stream().map(o -> ((ParsedTerms.ParsedBucket) o).getKey()).collect(Collectors.toList());
        handler.handle(AsyncResultImpl.create(results));
    } catch (IOException e) {
        LOGGER.error(e.getMessage(), e);
    }
}
Also used : SearchRequest(org.elasticsearch.action.search.SearchRequest) TermsAggregationBuilder(org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder) ParsedTerms(org.elasticsearch.search.aggregations.bucket.terms.ParsedTerms) List(java.util.List) IOException(java.io.IOException) SearchSourceBuilder(org.elasticsearch.search.builder.SearchSourceBuilder) SearchResponse(org.elasticsearch.action.search.SearchResponse)

Example 4 with ParsedTerms

use of org.elasticsearch.search.aggregations.bucket.terms.ParsedTerms in project vind by RBMHTechnology.

the class ResultUtils method getStatsFacetResults.

private static Pair<String, StatsFacetResult> getStatsFacetResults(Map<String, Aggregation> aggregations, Facet.StatsFacet statsFacet) {
    final FieldDescriptor field = statsFacet.getField();
    Object min = null;
    Object max = null;
    Double sum = null;
    Long count = null;
    Long missing = null;
    Double sumOfSquares = null;
    Object mean = null;
    Double stddev = null;
    Map<Double, Double> percentiles = null;
    List distinctValues = null;
    Long countDistinct = null;
    Long cardinality = null;
    final Optional<ParsedExtendedStats> statsAggregation = aggregations.entrySet().stream().filter(entry -> entry.getKey().endsWith(statsFacet.getFacetName())).map(Map.Entry::getValue).map(agg -> (ParsedExtendedStats) agg).findFirst();
    if (statsAggregation.isPresent() && statsFacet.getSum()) {
        sum = statsAggregation.get().getSum();
    }
    if (statsAggregation.isPresent() && statsFacet.getMin()) {
        min = DocumentUtil.castForDescriptor(statsAggregation.get().getMin(), field, FieldDescriptor.UseCase.Facet);
    }
    if (statsAggregation.isPresent() && statsFacet.getMax()) {
        max = DocumentUtil.castForDescriptor(statsAggregation.get().getMax(), field, FieldDescriptor.UseCase.Facet);
    }
    if (statsAggregation.isPresent() && statsFacet.getCount()) {
        count = statsAggregation.get().getCount();
    }
    if (statsFacet.getMissing()) {
        final Optional<Aggregation> statsMissingAggregation = aggregations.entrySet().stream().filter(entry -> entry.getKey().endsWith(statsFacet.getFacetName() + "_missing")).map(Map.Entry::getValue).findFirst();
        if (statsMissingAggregation.isPresent()) {
            missing = ((ParsedMissing) statsMissingAggregation.get()).getDocCount();
        }
    }
    if (statsAggregation.isPresent() && statsFacet.getSumOfSquares()) {
        sumOfSquares = statsAggregation.get().getSumOfSquares();
    }
    if (statsAggregation.isPresent() && statsFacet.getMean()) {
        mean = DocumentUtil.castForDescriptor(statsAggregation.get().getAvg(), field, FieldDescriptor.UseCase.Facet);
    }
    if (statsAggregation.isPresent() && statsFacet.getStddev()) {
        stddev = statsAggregation.get().getStdDeviation();
    }
    if (ArrayUtils.isNotEmpty(statsFacet.getPercentiles())) {
        final Optional<Aggregation> statsPercentilesAggregation = aggregations.entrySet().stream().filter(entry -> entry.getKey().endsWith(statsFacet.getFacetName() + "_percentiles")).map(Map.Entry::getValue).findFirst();
        if (statsPercentilesAggregation.isPresent()) {
            percentiles = Streams.stream(((ParsedPercentiles) statsPercentilesAggregation.get()).iterator()).collect(Collectors.toMap((Percentile p) -> Double.valueOf(p.getPercent()), (Percentile p) -> Double.valueOf(p.getValue())));
        }
    }
    if (statsFacet.getDistinctValues()) {
        final Optional<Aggregation> statsValuesAggregation = aggregations.entrySet().stream().filter(entry -> entry.getKey().endsWith(statsFacet.getFacetName() + "_values")).map(Map.Entry::getValue).findFirst();
        if (statsValuesAggregation.isPresent()) {
            distinctValues = ((ParsedTerms) statsValuesAggregation.get()).getBuckets().stream().filter(bucket -> bucket.getDocCount() > 0).map(MultiBucketsAggregation.Bucket::getKey).map(o -> DocumentUtil.castForDescriptor(o, field, FieldDescriptor.UseCase.Facet)).collect(Collectors.toList());
        }
    }
    if (statsFacet.getCountDistinct()) {
        final Optional<Aggregation> statsValuesAggregation = aggregations.entrySet().stream().filter(entry -> entry.getKey().endsWith(statsFacet.getFacetName() + "_values")).map(Map.Entry::getValue).findFirst();
        if (statsValuesAggregation.isPresent()) {
            countDistinct = ((ParsedTerms) statsValuesAggregation.get()).getBuckets().stream().filter(bucket -> bucket.getDocCount() > 0).count();
        }
    }
    if (statsFacet.getCardinality()) {
        final Optional<Aggregation> statsCardinalityAggregation = aggregations.entrySet().stream().filter(entry -> entry.getKey().endsWith(statsFacet.getFacetName() + "_cardinality")).map(Map.Entry::getValue).findFirst();
        if (statsCardinalityAggregation.isPresent()) {
            cardinality = ((ParsedCardinality) statsCardinalityAggregation.get()).getValue();
        }
    }
    final StatsFacetResult statsFacetResult = new StatsFacetResult(field, min, max, sum, count, missing, sumOfSquares, mean, stddev, percentiles, distinctValues, countDistinct, cardinality);
    return Pair.of(statsFacet.getFacetName(), statsFacetResult);
}
Also used : ElasticsearchException(org.elasticsearch.ElasticsearchException) StatsFacetResult(com.rbmhtechnology.vind.api.result.facet.StatsFacetResult) GetResponse(org.elasticsearch.action.get.GetResponse) Arrays(java.util.Arrays) FacetValue(com.rbmhtechnology.vind.api.result.facet.FacetValue) ParsedDateRange(org.elasticsearch.search.aggregations.bucket.range.ParsedDateRange) ParsedQuery(org.elasticsearch.index.query.ParsedQuery) ParsedStringTerms(org.elasticsearch.search.aggregations.bucket.terms.ParsedStringTerms) IntervalFacetResult(com.rbmhtechnology.vind.api.result.facet.IntervalFacetResult) Pair(org.apache.commons.lang3.tuple.Pair) Facet(com.rbmhtechnology.vind.api.query.facet.Facet) Map(java.util.Map) SearchResponse(org.elasticsearch.action.search.SearchResponse) QueryFacetResult(com.rbmhtechnology.vind.api.result.facet.QueryFacetResult) ParsedSingleValueNumericMetricsAggregation(org.elasticsearch.search.aggregations.metrics.ParsedSingleValueNumericMetricsAggregation) SearchHit(org.elasticsearch.search.SearchHit) MultiGetResponse(org.elasticsearch.action.get.MultiGetResponse) Aggregations(org.elasticsearch.search.aggregations.Aggregations) Collection(java.util.Collection) ParsedCardinality(org.elasticsearch.search.aggregations.metrics.ParsedCardinality) MultiGetItemResponse(org.elasticsearch.action.get.MultiGetItemResponse) Streams(com.google.common.collect.Streams) GetResult(com.rbmhtechnology.vind.api.result.GetResult) Collectors(java.util.stream.Collectors) Objects(java.util.Objects) RealTimeGet(com.rbmhtechnology.vind.api.query.get.RealTimeGet) List(java.util.List) ParsedPercentiles(org.elasticsearch.search.aggregations.metrics.ParsedPercentiles) Stream(java.util.stream.Stream) ParsedMissing(org.elasticsearch.search.aggregations.bucket.missing.ParsedMissing) MultiBucketsAggregation(org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation) Optional(java.util.Optional) SubdocumentFacetResult(com.rbmhtechnology.vind.api.result.facet.SubdocumentFacetResult) FieldDescriptor(com.rbmhtechnology.vind.model.FieldDescriptor) ArrayUtils(org.apache.commons.lang3.ArrayUtils) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) CollectionUtils(org.apache.commons.collections.CollectionUtils) Percentile(org.elasticsearch.search.aggregations.metrics.Percentile) Aggregation(org.elasticsearch.search.aggregations.Aggregation) ParsedFilters(org.elasticsearch.search.aggregations.bucket.filter.ParsedFilters) TermFacetResult(com.rbmhtechnology.vind.api.result.facet.TermFacetResult) FacetResults(com.rbmhtechnology.vind.api.result.FacetResults) ParsedTerms(org.elasticsearch.search.aggregations.bucket.terms.ParsedTerms) RangeFacetResult(com.rbmhtechnology.vind.api.result.facet.RangeFacetResult) ParsedDateHistogram(org.elasticsearch.search.aggregations.bucket.histogram.ParsedDateHistogram) ParsedExtendedStats(org.elasticsearch.search.aggregations.metrics.ParsedExtendedStats) Document(com.rbmhtechnology.vind.api.Document) ParsedRange(org.elasticsearch.search.aggregations.bucket.range.ParsedRange) PivotFacetResult(com.rbmhtechnology.vind.api.result.facet.PivotFacetResult) DocumentFactory(com.rbmhtechnology.vind.model.DocumentFactory) Collections(java.util.Collections) ParsedHistogram(org.elasticsearch.search.aggregations.bucket.histogram.ParsedHistogram) ParsedExtendedStats(org.elasticsearch.search.aggregations.metrics.ParsedExtendedStats) Percentile(org.elasticsearch.search.aggregations.metrics.Percentile) ParsedTerms(org.elasticsearch.search.aggregations.bucket.terms.ParsedTerms) StatsFacetResult(com.rbmhtechnology.vind.api.result.facet.StatsFacetResult) FieldDescriptor(com.rbmhtechnology.vind.model.FieldDescriptor) ParsedSingleValueNumericMetricsAggregation(org.elasticsearch.search.aggregations.metrics.ParsedSingleValueNumericMetricsAggregation) MultiBucketsAggregation(org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation) Aggregation(org.elasticsearch.search.aggregations.Aggregation) MultiBucketsAggregation(org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation) List(java.util.List) ArrayList(java.util.ArrayList) Map(java.util.Map) HashMap(java.util.HashMap)

Example 5 with ParsedTerms

use of org.elasticsearch.search.aggregations.bucket.terms.ParsedTerms in project vind by RBMHTechnology.

the class ResultUtils method getPivotFacetResults.

private static Pair<String, List<PivotFacetResult>> getPivotFacetResults(Aggregation aggregation, Facet.PivotFacet pivotFacet, Map<String, Facet> vindFacets) {
    final FieldDescriptor field = pivotFacet.getFieldDescriptors().get(0);
    if (Objects.nonNull(aggregation)) {
        final ParsedTerms rootPivot = (ParsedTerms) aggregation;
        final List<PivotFacetResult> pivotFacetResult = rootPivot.getBuckets().stream().map(bucket -> {
            final Map<String, Aggregation> aggMap = bucket.getAggregations().asMap();
            final Aggregation pivotAgg = aggMap.get(pivotFacet.getFacetName());
            final Map<String, RangeFacetResult<?>> rangeSubfacets = new HashMap<>();
            final Map<String, QueryFacetResult<?>> querySubfacets = new HashMap<>();
            final Map<String, StatsFacetResult<?>> statsSubfacets = new HashMap<>();
            Double score = null;
            if (!pivotFacet.getSortings().isEmpty()) {
                score = pivotFacet.getSortings().keySet().stream().map(aggMap::get).mapToDouble(sortAgg -> ((ParsedSingleValueNumericMetricsAggregation) sortAgg).value()).sum();
            }
            aggMap.values().forEach(agg -> {
                if (ParsedExtendedStats.class.isAssignableFrom(agg.getClass())) {
                    final HashMap<String, Aggregation> statsMap = new HashMap<>();
                    statsMap.put(agg.getName(), agg);
                    statsSubfacets.put(agg.getName(), ResultUtils.getStatsFacetResults(statsMap, (Facet.StatsFacet) vindFacets.get(agg.getName())).getValue());
                }
                if (ParsedQuery.class.isAssignableFrom(agg.getClass())) {
                    querySubfacets.put(agg.getName(), ResultUtils.getQueryFacetResults(agg, (Facet.QueryFacet) vindFacets.get(agg.getName())).getValue());
                }
                if (ParsedRange.class.isAssignableFrom(agg.getClass())) {
                    rangeSubfacets.put(agg.getName(), ResultUtils.getRangeFacetResults(agg, vindFacets.get(agg.getName())).getValue());
                }
            });
            final List<PivotFacetResult> subPivot = getPivotFacetResults(pivotAgg, pivotFacet, vindFacets).getValue();
            return new PivotFacetResult(subPivot, bucket.getKey(), field, Long.valueOf(bucket.getDocCount()).intValue(), rangeSubfacets, querySubfacets, statsSubfacets, score);
        }).collect(Collectors.toList());
        return Pair.of(pivotFacet.getFacetName(), pivotFacetResult);
    }
    return Pair.of(null, null);
}
Also used : ElasticsearchException(org.elasticsearch.ElasticsearchException) StatsFacetResult(com.rbmhtechnology.vind.api.result.facet.StatsFacetResult) GetResponse(org.elasticsearch.action.get.GetResponse) Arrays(java.util.Arrays) FacetValue(com.rbmhtechnology.vind.api.result.facet.FacetValue) ParsedDateRange(org.elasticsearch.search.aggregations.bucket.range.ParsedDateRange) ParsedQuery(org.elasticsearch.index.query.ParsedQuery) ParsedStringTerms(org.elasticsearch.search.aggregations.bucket.terms.ParsedStringTerms) IntervalFacetResult(com.rbmhtechnology.vind.api.result.facet.IntervalFacetResult) Pair(org.apache.commons.lang3.tuple.Pair) Facet(com.rbmhtechnology.vind.api.query.facet.Facet) Map(java.util.Map) SearchResponse(org.elasticsearch.action.search.SearchResponse) QueryFacetResult(com.rbmhtechnology.vind.api.result.facet.QueryFacetResult) ParsedSingleValueNumericMetricsAggregation(org.elasticsearch.search.aggregations.metrics.ParsedSingleValueNumericMetricsAggregation) SearchHit(org.elasticsearch.search.SearchHit) MultiGetResponse(org.elasticsearch.action.get.MultiGetResponse) Aggregations(org.elasticsearch.search.aggregations.Aggregations) Collection(java.util.Collection) ParsedCardinality(org.elasticsearch.search.aggregations.metrics.ParsedCardinality) MultiGetItemResponse(org.elasticsearch.action.get.MultiGetItemResponse) Streams(com.google.common.collect.Streams) GetResult(com.rbmhtechnology.vind.api.result.GetResult) Collectors(java.util.stream.Collectors) Objects(java.util.Objects) RealTimeGet(com.rbmhtechnology.vind.api.query.get.RealTimeGet) List(java.util.List) ParsedPercentiles(org.elasticsearch.search.aggregations.metrics.ParsedPercentiles) Stream(java.util.stream.Stream) ParsedMissing(org.elasticsearch.search.aggregations.bucket.missing.ParsedMissing) MultiBucketsAggregation(org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation) Optional(java.util.Optional) SubdocumentFacetResult(com.rbmhtechnology.vind.api.result.facet.SubdocumentFacetResult) FieldDescriptor(com.rbmhtechnology.vind.model.FieldDescriptor) ArrayUtils(org.apache.commons.lang3.ArrayUtils) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) CollectionUtils(org.apache.commons.collections.CollectionUtils) Percentile(org.elasticsearch.search.aggregations.metrics.Percentile) Aggregation(org.elasticsearch.search.aggregations.Aggregation) ParsedFilters(org.elasticsearch.search.aggregations.bucket.filter.ParsedFilters) TermFacetResult(com.rbmhtechnology.vind.api.result.facet.TermFacetResult) FacetResults(com.rbmhtechnology.vind.api.result.FacetResults) ParsedTerms(org.elasticsearch.search.aggregations.bucket.terms.ParsedTerms) RangeFacetResult(com.rbmhtechnology.vind.api.result.facet.RangeFacetResult) ParsedDateHistogram(org.elasticsearch.search.aggregations.bucket.histogram.ParsedDateHistogram) ParsedExtendedStats(org.elasticsearch.search.aggregations.metrics.ParsedExtendedStats) Document(com.rbmhtechnology.vind.api.Document) ParsedRange(org.elasticsearch.search.aggregations.bucket.range.ParsedRange) PivotFacetResult(com.rbmhtechnology.vind.api.result.facet.PivotFacetResult) DocumentFactory(com.rbmhtechnology.vind.model.DocumentFactory) Collections(java.util.Collections) ParsedHistogram(org.elasticsearch.search.aggregations.bucket.histogram.ParsedHistogram) ParsedExtendedStats(org.elasticsearch.search.aggregations.metrics.ParsedExtendedStats) ParsedTerms(org.elasticsearch.search.aggregations.bucket.terms.ParsedTerms) HashMap(java.util.HashMap) ParsedQuery(org.elasticsearch.index.query.ParsedQuery) FieldDescriptor(com.rbmhtechnology.vind.model.FieldDescriptor) ParsedSingleValueNumericMetricsAggregation(org.elasticsearch.search.aggregations.metrics.ParsedSingleValueNumericMetricsAggregation) MultiBucketsAggregation(org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation) Aggregation(org.elasticsearch.search.aggregations.Aggregation) ParsedSingleValueNumericMetricsAggregation(org.elasticsearch.search.aggregations.metrics.ParsedSingleValueNumericMetricsAggregation) List(java.util.List) ArrayList(java.util.ArrayList) ParsedRange(org.elasticsearch.search.aggregations.bucket.range.ParsedRange) Map(java.util.Map) HashMap(java.util.HashMap) PivotFacetResult(com.rbmhtechnology.vind.api.result.facet.PivotFacetResult)

Aggregations

List (java.util.List)9 SearchResponse (org.elasticsearch.action.search.SearchResponse)9 ParsedTerms (org.elasticsearch.search.aggregations.bucket.terms.ParsedTerms)9 IOException (java.io.IOException)6 SearchRequest (org.elasticsearch.action.search.SearchRequest)6 HashMap (java.util.HashMap)5 ArrayList (java.util.ArrayList)4 Map (java.util.Map)4 Collectors (java.util.stream.Collectors)4 CollectionUtils (org.apache.commons.collections.CollectionUtils)4 Streams (com.google.common.collect.Streams)3 Document (com.rbmhtechnology.vind.api.Document)3 Facet (com.rbmhtechnology.vind.api.query.facet.Facet)3 RealTimeGet (com.rbmhtechnology.vind.api.query.get.RealTimeGet)3 FacetResults (com.rbmhtechnology.vind.api.result.FacetResults)3 GetResult (com.rbmhtechnology.vind.api.result.GetResult)3 FacetValue (com.rbmhtechnology.vind.api.result.facet.FacetValue)3 IntervalFacetResult (com.rbmhtechnology.vind.api.result.facet.IntervalFacetResult)3 PivotFacetResult (com.rbmhtechnology.vind.api.result.facet.PivotFacetResult)3 QueryFacetResult (com.rbmhtechnology.vind.api.result.facet.QueryFacetResult)3