1
0

wrapper-query.asciidoc 783 B

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