# Base64 in WrapperBuilder. co.elastic.clients

**URL:** <https://discuss.elastic.co/t/base64-in-wrapperbuilder-co-elastic-clients/365930>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [September 3, 2024, 7:27am UTC](https://discuss.elastic.co/t/base64-in-wrapperbuilder-co-elastic-clients/365930 "2024-09-03T07:27:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![S\_R](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s_r/32/123391_2.png) [@S\_R](https://discuss.elastic.co/u/S_R)\
**Post date:** [September 3, 2024, 7:27am UTC](https://discuss.elastic.co/t/base64-in-wrapperbuilder-co-elastic-clients/365930/1 "2024-09-03T07:27:03Z")

</div>

Hi Community,

I encountered strange behavior with a new Elasticsearch Java client.

Before, I used org.elasticsearch:elasticsearch:7:8:1  
`WrapperQueryBuilder wrapperQueryBuilder = new WrapperQueryBuilder("string")` to get a wrapped query with Base64.

Now, I decided to use a new client co.elastic.clients:elasticsearch-java:7.17.22 and the same logic

```auto
WrapperQuery.Builder wrapperQueryBuilder =
              QueryBuilders.wrapper()
                      .query("string");

```

Unfortunately, I did not get the old result. It means I have to use Base64Encoder or use another builder to get Base64?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 3, 2024, 8:05am UTC](https://discuss.elastic.co/t/base64-in-wrapperbuilder-co-elastic-clients/365930/2 "2024-09-03T08:05:35Z")

</div>

Have a look at

> <https://github.com/dadoonet/elasticsearch-java-client-demo/blob/4b9f89d45a3350fa01cf950b94599dd80d6f9d74/src/test/java/fr/pilato/test/elasticsearch/hlclient/EsClientIT.java#L280-L289>

Hope this helps.

---

<div class="post-metadata">

**Author:** ![S\_R](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s_r/32/123391_2.png) [@S\_R](https://discuss.elastic.co/u/S_R)\
**Post date:** [September 14, 2024, 11:38am UTC](https://discuss.elastic.co/t/base64-in-wrapperbuilder-co-elastic-clients/365930/3 "2024-09-14T11:38:22Z")

</div>

Great solution.

Thank you for your help.
