| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 | --:api: search:request: SearchRequest:response: SearchResponse--[role="xpack"][id="{upid}-{api}"]=== Rollup Search APIexperimental::[]The Rollup Search endpoint allows searching rolled-up data using the standardQuery DSL. The Rollup Search endpoint is needed because, internally,rolled-up documents utilize a different document structure than the originaldata. The Rollup Search endpoint rewrites standard Query DSL into a format thatmatches the rollup documents, then takes the response and rewrites it back towhat a client would expect given the original query.[id="{upid}-{api}-request"]==== RequestRollup Search uses the same +{request}+ that is used by the <<{mainid}-search>>but it is mostly for aggregations you should set the `size` to 0 and addaggregations like this:["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests-file}[{api}-request]--------------------------------------------------NOTE:: Rollup Search is limited in many ways because only some query elementscan be translated into queries against the rollup indices. See the main{ref}/rollup-search.html[Rollup Search] documentation for more.include::../execution.asciidoc[][id="{upid}-{api}-response"]==== ResponseRollup Search returns the same +{response}+ that is used by the<<{mainid}-search>> and everything can be accessed in exactly the same way.This will access the aggregation built by the example request above:["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests-file}[{api}-response]--------------------------------------------------
 |