﻿---
title: Wrapper query
description: A query that accepts any other query as base64 encoded string. This query is more useful in the context of Spring Data Elasticsearch. It’s the way a user...
url: https://www.elastic.co/elastic/docs-builder/docs/2773/reference/query-languages/query-dsl/query-dsl-wrapper-query
products:
  - Elasticsearch
---

# Wrapper query
A query that accepts any other query as base64 encoded string.
```json

{
  "query": {
    "wrapper": {
      "query": "eyJ0ZXJtIiA6IHsgInVzZXIuaWQiIDogImtpbWNoeSIgfX0=" <1>
    }
  }
}
```

This query is more useful in the context of Spring Data Elasticsearch. It’s the way a user can add custom queries when using Spring Data repositories. The user can add a @Query() annotation to a repository method. When such a method is called we do a parameter replacement in the query argument of the annotation and then send this as the query part of a search request.