search.asciidoc 1.7 KB

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