2018-03-14 06:51:22 -04:00
|
|
|
[[query-dsl-wrapper-query]]
|
2019-07-18 10:18:11 -04:00
|
|
|
=== Wrapper query
|
|
|
|
++++
|
|
|
|
<titleabbrev>Wrapper</titleabbrev>
|
|
|
|
++++
|
2018-03-14 06:51:22 -04:00
|
|
|
|
|
|
|
A query that accepts any other query as base64 encoded string.
|
|
|
|
|
2019-09-09 12:35:50 -04:00
|
|
|
[source,console]
|
2018-03-14 06:51:22 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
GET /_search
|
|
|
|
{
|
2020-07-21 15:49:58 -04:00
|
|
|
"query": {
|
|
|
|
"wrapper": {
|
|
|
|
"query": "eyJ0ZXJtIiA6IHsgInVzZXIiIDogIktpbWNoeSIgfX0=" <1>
|
2018-03-14 06:51:22 -04:00
|
|
|
}
|
2020-07-21 15:49:58 -04:00
|
|
|
}
|
2018-03-14 06:51:22 -04:00
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
<1> Base64 encoded string: `{"term" : { "user" : "Kimchy" }}`
|
|
|
|
|
|
|
|
This query is more useful in the context of the Java high-level REST client or
|
|
|
|
transport client to also accept queries as json formatted string.
|
|
|
|
In these cases queries can be specified as a json or yaml formatted string or
|
|
|
|
as a query builder (which is a available in the Java high-level REST client).
|