search.asciidoc 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --
  2. :api: search
  3. :request: SearchRequest
  4. :response: SearchResponse
  5. --
  6. [role="xpack"]
  7. [id="{upid}-{api}"]
  8. === Rollup Search API
  9. experimental::[]
  10. The Rollup Search endpoint allows searching rolled-up data using the standard
  11. Query DSL. The Rollup Search endpoint is needed because, internally,
  12. rolled-up documents utilize a different document structure than the original
  13. data. The Rollup Search endpoint rewrites standard Query DSL into a format that
  14. matches the rollup documents, then takes the response and rewrites it back to
  15. what a client would expect given the original query.
  16. [id="{upid}-{api}-request"]
  17. ==== Request
  18. Rollup Search uses the same +{request}+ that is used by the <<{mainid}-search>>
  19. but it is mostly for aggregations you should set the `size` to 0 and add
  20. aggregations like this:
  21. ["source","java",subs="attributes,callouts,macros"]
  22. --------------------------------------------------
  23. include-tagged::{doc-tests-file}[{api}-request]
  24. --------------------------------------------------
  25. NOTE:: Rollup Search is limited in many ways because only some query elements
  26. can be translated into queries against the rollup indices. See the main
  27. {ref}/rollup-search.html[Rollup Search] documentation for more.
  28. include::../execution.asciidoc[]
  29. [id="{upid}-{api}-response"]
  30. ==== Response
  31. Rollup Search returns the same +{response}+ that is used by the
  32. <<{mainid}-search>> and everything can be accessed in exactly the same way.
  33. This will access the aggregation built by the example request above:
  34. ["source","java",subs="attributes,callouts,macros"]
  35. --------------------------------------------------
  36. include-tagged::{doc-tests-file}[{api}-response]
  37. --------------------------------------------------