Search + K

Command Palette

Search for a command to run...

Sign In

Search rolled-up data

Deprecated
POST /{index}/_rollup_search
Copy endpoint

The rollup search endpoint is needed because, internally, rolled-up documents utilize a different document structure than the original data. It rewrites standard Query DSL into a format that matches the rollup documents then takes the response and rewrites it back to what a client would expect given the original query.

The request body supports a subset of features from the regular search API. The following functionality is not available:

size: Because rollups work on pre-aggregated data, no search hits can be returned and so size must be set to zero or omitted entirely. highlighter, suggestors, post_filter, profile, explain: These are similarly disallowed.

For more detailed examples of using the rollup search API, including querying rolled-up data only or combining rolled-up and live data, refer to the External documentation.

Parameters

path Path Parameters

Name Type
index required

A comma-separated list of data streams and indices used to limit the request. This parameter has the following rules:

  • At least one data stream, index, or wildcard expression must be specified. This target can include a rollup or non-rollup index. For data streams, the stream's backing indices can only serve as non-rollup indices. Omitting the parameter or using _all are not permitted.
  • Multiple non-rollup indices may be specified.
  • Only one rollup index may be specified. If more than one are supplied, an exception occurs.
  • Wildcard expressions (*) may be used. If they match more than one rollup index, an exception occurs. However, you can use an expression to match multiple non-rollup indices or data streams.
type TypesIndices = type TypesIndexName = string | type TypesIndexName = string[]

query Query Parameters

Name Type
rest_total_hits_as_int

Indicates whether hits.total should be rendered as an integer or an object in the rest search response

boolean
typed_keys

Specify whether aggregation and suggester names should be prefixed by their respective types in the response

boolean

Request Body

application/json required
{ aggregations?: { };query?: TypesQueryDslQueryContainer

An Elasticsearch Query DSL (Domain Specific Language) object that defines a query.

interface TypesQueryDslQueryContainer {
bool?: TypesQueryDslBoolQuery;
boosting?: TypesQueryDslBoostingQuery;
common?: { };
combined_fields?: TypesQueryDslCombinedFieldsQuery;
constant_score?: TypesQueryDslConstantScoreQuery;
dis_max?: TypesQueryDslDisMaxQuery;
distance_feature?: TypesQueryDslDistanceFeatureQuery;
exists?: TypesQueryDslExistsQuery;
function_score?: TypesQueryDslFunctionScoreQuery;
fuzzy?: { };
geo_bounding_box?: TypesQueryDslGeoBoundingBoxQuery;
geo_distance?: TypesQueryDslGeoDistanceQuery;
geo_grid?: { };
geo_polygon?: TypesQueryDslGeoPolygonQuery;
geo_shape?: TypesQueryDslGeoShapeQuery;
has_child?: TypesQueryDslHasChildQuery;
has_parent?: TypesQueryDslHasParentQuery;
ids?: TypesQueryDslIdsQuery;
intervals?: { };
knn?: TypesKnnQuery;
match?: { };
match_all?: TypesQueryDslMatchAllQuery;
match_bool_prefix?: { };
match_none?: TypesQueryDslMatchNoneQuery;
match_phrase?: { };
match_phrase_prefix?: { };
more_like_this?: TypesQueryDslMoreLikeThisQuery;
multi_match?: TypesQueryDslMultiMatchQuery;
nested?: TypesQueryDslNestedQuery;
parent_id?: TypesQueryDslParentIdQuery;
percolate?: TypesQueryDslPercolateQuery;
pinned?: TypesQueryDslPinnedQuery;
prefix?: { };
query_string?: TypesQueryDslQueryStringQuery;
range?: { };
rank_feature?: TypesQueryDslRankFeatureQuery;
regexp?: { };
rule?: TypesQueryDslRuleQuery;
script?: TypesQueryDslScriptQuery;
script_score?: TypesQueryDslScriptScoreQuery;
semantic?: TypesQueryDslSemanticQuery;
shape?: TypesQueryDslShapeQuery;
simple_query_string?: TypesQueryDslSimpleQueryStringQuery;
span_containing?: TypesQueryDslSpanContainingQuery;
span_field_masking?: TypesQueryDslSpanFieldMaskingQuery;
span_first?: TypesQueryDslSpanFirstQuery;
span_multi?: TypesQueryDslSpanMultiTermQuery;
span_near?: TypesQueryDslSpanNearQuery;
span_not?: TypesQueryDslSpanNotQuery;
span_or?: TypesQueryDslSpanOrQuery;
span_term?: { };
span_within?: TypesQueryDslSpanWithinQuery;
sparse_vector?: TypesQueryDslSparseVectorQuery;
term?: { };
terms?: TypesQueryDslTermsQuery;
terms_set?: { };
text_expansion?: { };
weighted_tokens?: { };
wildcard?: { };
wrapper?: TypesQueryDslWrapperQuery;
type?: TypesQueryDslTypeQuery;
}
;size?: number; }

Responses

200 application/json
{
took: number;
timed_out: boolean;
terminated_early?: boolean;
_shards: TypesShardStatistics
interface TypesShardStatistics {
failed: TypesUint;
successful: TypesUint;
total: TypesUint;
failures?: TypesShardFailure[];
skipped?: TypesUint;
}
;
hits: GlobalSearchTypesHitsMetadata
interface GlobalSearchTypesHitsMetadata {
total?: GlobalSearchTypesTotalHits | number;
hits: GlobalSearchTypesHit[];
max_score?: string | number | null;
}
;
aggregations?: { };
}