wrapper-query.asciidoc 744 B

123456789101112131415161718192021222324
  1. [[query-dsl-wrapper-query]]
  2. === Wrapper Query
  3. A query that accepts any other query as base64 encoded string.
  4. [source,js]
  5. --------------------------------------------------
  6. GET /_search
  7. {
  8. "query" : {
  9. "wrapper": {
  10. "query" : "eyJ0ZXJtIiA6IHsgInVzZXIiIDogIktpbWNoeSIgfX0=" <1>
  11. }
  12. }
  13. }
  14. --------------------------------------------------
  15. // CONSOLE
  16. <1> Base64 encoded string: `{"term" : { "user" : "Kimchy" }}`
  17. This query is more useful in the context of the Java high-level REST client or
  18. transport client to also accept queries as json formatted string.
  19. In these cases queries can be specified as a json or yaml formatted string or
  20. as a query builder (which is a available in the Java high-level REST client).