Search rolled-up data
- POST also GET /{index}/_rollup_search
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.
Getting started with rollupsPath Parameters
-
indexIndexName | IndexNamerequired -
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
_allare 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.
- 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
Query Parameters
-
rest_total_hits_as_intboolean · default: false Indicates whether hits.total should be rendered as an integer or an object in the rest search response
-
typed_keysboolean · default: false Specify whether aggregation and suggester names should be prefixed by their respective types in the response
Request
-
aggregationsmap string to AggregationContainer -
Specifies aggregations.
-
queryQueryContainer -
Specifies a DSL query that is subject to some limitations.
-
sizenumber -
Must be zero if set, as rollups work on pre-aggregated data.
Response
-
tooknumberrequired -
timed_outbooleanrequired -
terminated_earlyboolean -
_shardsShardStatisticsrequired -
failednumber uintrequired -
The number of shards the operation or search attempted to run on but failed.
-
successfulnumber uintrequired -
The number of shards the operation or search succeeded on.
-
totalnumber uintrequired -
The number of shards the operation or search will run on overall.
-
failuresShardFailure -
indexstring IndexName -
nodestring -
reasonErrorCauserequired -
typestringrequired -
The type of error
-
reasonstringnullable -
A human-readable explanation of the error, in English.
-
stack_tracestring -
The server stack trace. Present only if the
error_trace=trueparameter was sent with the request. -
caused_byErrorCause -
root_causeErrorCause -
suppressedErrorCause -
shardnumber -
statusstring -
primaryboolean -
skippednumber uint -
hitsHitsMetadatarequired -
totaloneOf -
Total hit count information, present only if
track_total_hitswasn'tfalsein the search request. -
hitsHitrequired -
_indexstring IndexNamerequired -
_idstring Id -
_scorenumber | stringnullable -
_explanationExplanation -
descriptionstringrequired -
detailsExplanationDetailrequired -
descriptionstringrequired -
detailsExplanationDetail -
valuenumberrequired -
valuenumberrequired -
fieldsmap string to object -
highlightmap string to string -
inner_hitsmap string to InnerHitsResult -
<string>InnerHitsResult -
hitsHitsMetadatarequired -
matched_queriesoneOf -
_ignoredstring -
ignored_field_valuesmap string to object -
_shardstring -
_nodestring -
_routingstring -
_sourceobject -
_ranknumber -
_seq_nonumber SequenceNumber -
_primary_termnumber -
_versionnumber VersionNumber -
sortSortResults -
max_scorenumber | stringnullable -
aggregationsmap string to Aggregate