elasticsearch/docs/reference/query-languages/query-dsl/query-dsl-wrapper-query.md
Craig Taverner 94cad286bc
Restructure query-languages docs files for clarity (#124797)
In a few previous PR's we restructured the ES|QL docs to make it possible to generate them dynamically.

This PR just moves a few files around to make the query languages docs easier to work with, and a little more organized like the ES|QL docs.

A bit part of this was setting up redirects to the new locations, so other repo's could correctly link to the elasticsearch docs.
2025-03-17 17:58:58 +01:00

840 B
Raw Blame History

navigation_title mapped_pages
Wrapper
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-wrapper-query.html

Wrapper query [query-dsl-wrapper-query]

A query that accepts any other query as base64 encoded string.

GET /_search
{
  "query": {
    "wrapper": {
      "query": "eyJ0ZXJtIiA6IHsgInVzZXIuaWQiIDogImtpbWNoeSIgfX0=" <1>
    }
  }
}
  1. Base64 encoded string: {"term" : { "user.id" : "kimchy" }}

This query is more useful in the context of Spring Data Elasticsearch. Its 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.