Skip to main content

Wildcard search

This example uses Elasticsearch’s wildcard query to find all elements whose description contains a word matching the pattern colo*r - i.e. both the American spelling “color” and the British spelling “colour” - restricted to the first page of 5 results via the pageSize step parameter.
Results are then hydrated, i.e. transformed into a collection response.

Note: like prefix, wildcard is a term-level query and is matched against the exact indexed value. * matches zero or more characters, ? matches exactly one character.

curl -X POST \
-H 'Authorization: Bearer secret-token:PIPeJGUt7c00ENn8a5uDlc' \
-H 'Content-Type: application/json' \
-d '{
"debug": true,
"steps": [
{
"type": "elasticsearch-query-dsl-mixin",
"query": {
"wildcard": {
"description": {
"value": "colo*r"
}
}
},
"parameters": {
"pageSize": 5
}
},
{
"type": "element-hydration"
}
]
}' \
https://api.example.com/search
[
{
"input": {
"type": "elasticsearch-query-dsl-mixin",
"query": {
"wildcard": {
"description": {
"value": "colo*r"
}
}
},
"parameters": {
"pageSize": 5,
"stepResults": []
}
},
"step-handler": "elasticsearch-query-dsl-mixin (App\\EventSystem\\SearchStep\\EventListener\\ElasticsearchQueryDslMixinSearchStepEventListener)",
"start": 1758826006.799941,
"indices": "*",
"combinedQuery": {
"_source": [
"_id"
],
"from": 0,
"size": 5,
"query": {
"bool": {
"must": [
{
"wildcard": {
"description": {
"value": "colo*r"
}
}
},
{
"bool": {
"should": [
{
"terms": {
"_groupsWithSearchAccess.keyword": []
}
},
{
"term": {
"_usersWithSearchAccess.keyword": {
"value": "7baba8b7-a6bb-4184-9a9a-925a4d2736b0"
}
}
}
],
"minimum_should_match": 1
}
}
]
}
}
},
"end": 1758826006.829988,
"duration": 0.030047
},
{
"input": {
"type": "element-hydration",
"query": null,
"parameters": {
"stepResults": [
{
"elements": [
{
"id": "90819566-3121-42af-bdb5-19cbef67cd31",
"type": "Tag",
"metadata": {
"score": 1.0219789
}
},
{
"id": "b7121a49-8f17-4858-b988-4bd837a5f1fe",
"type": "Tag",
"metadata": {
"score": 1.0219789
}
},
{
"id": "b8674d32-af5f-4ef1-a5d8-fc5cbb56b795",
"type": "Tag",
"metadata": {
"score": 1.0219789
}
},
{
"id": "bbc7529f-72da-4df2-aff5-e139a5618ccb",
"type": "Tag",
"metadata": {
"score": 1.0219789
}
},
{
"id": "be14916b-0068-4b49-b8d0-f9e528f3d10e",
"type": "Tag",
"metadata": {
"score": 1.0219789
}
}
],
"totalHits": 29,
"maxScore": 1.0219789
}
]
}
},
"step-handler": "element-hydration (App\\EventSystem\\SearchStep\\EventListener\\ElementHydrationSearchStepEventListener)",
"start": 1758826006.830163,
"accessibleElementIds": [
"90819566-3121-42af-bdb5-19cbef67cd31",
"b7121a49-8f17-4858-b988-4bd837a5f1fe",
"b8674d32-af5f-4ef1-a5d8-fc5cbb56b795",
"bbc7529f-72da-4df2-aff5-e139a5618ccb",
"be14916b-0068-4b49-b8d0-f9e528f3d10e"
],
"end": 1758826006.864428,
"duration": 0.034265
}
]
{
"type": "_SearchResultResponse",
"results": [
{
"type": "Tag",
"id": "90819566-3121-42af-bdb5-19cbef67cd31",
"data": {
"description": "White is the lightest color[2] and is achromatic (having no chroma). It is the color of objects such as snow, chalk, and milk, and is the opposite of black. White objects fully (or almost fully) reflect and scatter all the visible wavelengths of light. White on television and computer screens is created by a mixture of red, blue, and green light. The color white can be given with white pigments, especially titanium dioxide.[3]\n\nIn ancient Egypt and ancient Rome, priestesses wore white as a symbol of purity, and Romans wore white togas as symbols of citizenship. In the Middle Ages and Renaissance a white unicorn symbolized chastity, and a white lamb sacrifice and purity. It was the royal color of the kings of France as well as the flag of monarchist France from 1815 to 1830, and of the monarchist movement that opposed the Bolsheviks during the Russian Civil War (1917\\u20131922). Greek temples and Roman temples were faced with white marble, and beginning in the 18th century, with the advent of neoclassical architecture, white became the most common color of new churches, capitols, and other government buildings, especially in the United States. It was also widely used in 20th century modern architecture as a symbol of modernity and simplicity.\n\nAccording to surveys in Europe and the United States, white is the color most often associated with perfection, the good, honesty, cleanliness, the beginning, the new, neutrality, and exactitude.[4] White is an important color for almost all world religions. The pope, the head of the Roman Catholic Church, has worn white since 1566, as a symbol of purity and sacrifice. In Islam, and in the Shinto religion of Japan, it is worn by pilgrims. In Western cultures and in Japan, white is the most common color for wedding dresses, symbolizing purity and virginity. In many Asian cultures, white is also the color of mourning.[5]",
"created": "2025-09-25T18:45:42+00:00",
"updated": "2025-09-25T18:45:42+00:00",
"name": "white",
"color": "#ffffff",
"scenario": "general.botanicExample",
"link": "https://en.wikipedia.org/wiki/White"
}
},
{
"type": "Tag",
"id": "b7121a49-8f17-4858-b988-4bd837a5f1fe",
"data": {
"created": "2025-09-25T18:45:42+00:00",
"updated": "2025-09-25T18:45:42+00:00",
"name": "lavender",
"color": "#dcbeff",
"scenario": "general.botanicExample",
"link": "https://en.wikipedia.org/wiki/Lavender_(color)",
"description": "Lavender is a light shade of purple or violet. It applies particularly to the color of the flower of the same name. The web color called lavender is displayed adjacent\\u2014it matches the color of the palest part of the flower; however, the more saturated color shown as floral lavender more closely matches the average color of the lavender flower as shown in the picture and is the tone of lavender historically and traditionally considered lavender by average people as opposed to website designers.[3] The color lavender might be described as a medium purple, a pale bluish purple,[4] or a light pinkish-purple. The term lavender may be used in general to apply to a wide range of pale, light, or grayish-purples, but only on the blue side; lilac is pale purple on the pink side. In paints, the color lavender is made by mixing purple and white paint."
}
},
{
"type": "Tag",
"id": "b8674d32-af5f-4ef1-a5d8-fc5cbb56b795",
"data": {
"description": "Purple is a color similar in appearance to violet light. In the RYB color model historically used in the arts, purple is a secondary color created by combining red and blue pigments. In the CMYK color model used in modern printing, purple is made by combining magenta pigment with either cyan pigment, black pigment, or both. In the RGB color model used in computer and television screens, purple is created by mixing red and blue light in order to create colors that appear similar to violet light. According to color theory, purple is considered a cool color.[1]\n\nPurple has long been associated with royalty, originally because Tyrian purple dye\\u2014made from the secretions of sea snails\\u2014was extremely expensive in antiquity.[2] Purple was the color worn by Roman magistrates; it became the imperial color worn by the rulers of the Byzantine Empire and the Holy Roman Empire, and later by Roman Catholic bishops. Similarly in Japan, the color is traditionally associated with the emperor and aristocracy.[3]\n\nAccording to contemporary surveys in Europe and the United States, purple is the color most often associated with rarity, royalty, luxury, ambition, magic, mystery, piety and spirituality.[4][5] When combined with pink, it is associated with eroticism, femininity, and seduction.[6]\nEtymology and definitions\n\nThe modern English word purple comes from the Old English purpul, which derives from Latin purpura, which, in turn, derives from the Greek \\u03c0\\u03bf\\u03c1\\u03c6\\u03cd\\u03c1\\u03b1 (porphura),[7] the name of the Tyrian purple dye manufactured in classical antiquity from a mucus secreted by the spiny dye-murex snail.[8][9] The first recorded use of the word purple dates to the late 900s AD.[8]",
"created": "2025-09-25T18:45:42+00:00",
"updated": "2025-09-25T18:45:42+00:00",
"name": "purple",
"color": "#911eb4",
"scenario": "general.botanicExample",
"link": "https://en.wikipedia.org/wiki/Purple"
}
},
{
"type": "Tag",
"id": "bbc7529f-72da-4df2-aff5-e139a5618ccb",
"data": {
"description": "Brown is a color. It can be thought as a darker, and usually desaturated, shade of orange. In the CMYK color model used in printing and painting, brown is usually made by combining yellow, magenta, and black inks (these two last in a lesser amount).[4][5][6]\n\nIn the RGB color model used to project colors onto television screens and computer monitors, brown is the result of combining red light at low intensity, and green light at an even lower intensity, with blue light also being present in most shades of the color. The color brown is seen widely in nature, wood, soil, human hair color, eye color and skin pigmentation. Brown is the color of dark wood or rich soil.[7]\n\nIn the RYB color model, brown is made by mixing the three primary colors, red, yellow, and blue.\n\nAccording to public opinion surveys in Europe and the United States, brown is the least favorite color of the public; it is often associated with fecal matter, plainness, the rustic, although it does also have positive associations, including baking, warmth, wildlife, the autumn and music.",
"created": "2025-09-25T18:45:42+00:00",
"updated": "2025-09-25T18:45:42+00:00",
"name": "brown",
"color": "#9a6324",
"scenario": "general.botanicExample",
"link": "https://en.wikipedia.org/wiki/Brown"
}
},
{
"type": "Tag",
"id": "be14916b-0068-4b49-b8d0-f9e528f3d10e",
"data": {
"description": "Yellow is the color between green and orange on the spectrum of light. It is evoked by light with a dominant wavelength of roughly 575\\u2013585 nm. It is a primary color in subtractive color systems, used in painting or color printing. In the RGB color model, used to create colors on television and computer screens, yellow is a secondary color made by combining red and green at equal intensity. Carotenoids give the characteristic yellow color to autumn leaves, corn, canaries, daffodils, and lemons, as well as egg yolks, buttercups, and bananas. They absorb light energy and protect plants from photo damage in some cases.[3] Sunlight has a slight yellowish hue when the Sun is near the horizon, due to atmospheric scattering of shorter wavelengths (green, blue, and violet).\n\nBecause it was widely available, yellow ochre pigment was one of the first colors used in art; the Lascaux cave in France has a painting of a yellow horse 17,000 years old. Ochre and orpiment pigments were used to represent gold and skin color in Egyptian tombs, then in the murals in Roman villas.[4] In the early Christian church, yellow was the color associated with the Pope and the golden keys of the Kingdom, but it was also associated with Judas Iscariot and used to mark heretics. In the 20th century, Jews in Nazi-occupied Europe were forced to wear a yellow star. In China, bright yellow was the color of the Middle Kingdom, and could be worn only by the emperor and his household; special guests were welcomed on a yellow carpet.[5]\n\nAccording to surveys in Europe, Canada, the United States and elsewhere, yellow is the color people most often associate with amusement, gentleness, humor, happiness, and spontaneity; however it can also be associated with duplicity, envy, jealousy, greed, justice, and, in the U.S., cowardice.[6] In Iran it has connotations of pallor/sickness,[7] but also wisdom and connection.[8] In China and many Asian countries, it is seen as the color of royalty, nobility, respect, happiness, glory, harmony and wisdom.[9]",
"created": "2025-09-25T18:45:42+00:00",
"updated": "2025-09-25T18:45:42+00:00",
"name": "yellow",
"color": "#ffe119",
"scenario": "general.botanicExample",
"link": "https://en.wikipedia.org/wiki/Yellow"
}
}
],
"debug": [
{
"input": {
"type": "elasticsearch-query-dsl-mixin",
"query": {
"wildcard": {
"description": {
"value": "colo*r"
}
}
},
"parameters": {
"pageSize": 5,
"stepResults": []
}
},
"step-handler": "elasticsearch-query-dsl-mixin (App\\EventSystem\\SearchStep\\EventListener\\ElasticsearchQueryDslMixinSearchStepEventListener)",
"start": 1758826006.799941,
"indices": "*",
"combinedQuery": {
"_source": [
"_id"
],
"from": 0,
"size": 5,
"query": {
"bool": {
"must": [
{
"wildcard": {
"description": {
"value": "colo*r"
}
}
},
{
"bool": {
"should": [
{
"terms": {
"_groupsWithSearchAccess.keyword": []
}
},
{
"term": {
"_usersWithSearchAccess.keyword": {
"value": "7baba8b7-a6bb-4184-9a9a-925a4d2736b0"
}
}
}
],
"minimum_should_match": 1
}
}
]
}
}
},
"end": 1758826006.829988,
"duration": 0.030047
},
{
"input": {
"type": "element-hydration",
"query": null,
"parameters": {
"stepResults": [
{
"elements": [
{
"id": "90819566-3121-42af-bdb5-19cbef67cd31",
"type": "Tag",
"metadata": {
"score": 1.0219789
}
},
{
"id": "b7121a49-8f17-4858-b988-4bd837a5f1fe",
"type": "Tag",
"metadata": {
"score": 1.0219789
}
},
{
"id": "b8674d32-af5f-4ef1-a5d8-fc5cbb56b795",
"type": "Tag",
"metadata": {
"score": 1.0219789
}
},
{
"id": "bbc7529f-72da-4df2-aff5-e139a5618ccb",
"type": "Tag",
"metadata": {
"score": 1.0219789
}
},
{
"id": "be14916b-0068-4b49-b8d0-f9e528f3d10e",
"type": "Tag",
"metadata": {
"score": 1.0219789
}
}
],
"totalHits": 29,
"maxScore": 1.0219789
}
]
}
},
"step-handler": "element-hydration (App\\EventSystem\\SearchStep\\EventListener\\ElementHydrationSearchStepEventListener)",
"start": 1758826006.830163,
"accessibleElementIds": [
"90819566-3121-42af-bdb5-19cbef67cd31",
"b7121a49-8f17-4858-b988-4bd837a5f1fe",
"b8674d32-af5f-4ef1-a5d8-fc5cbb56b795",
"bbc7529f-72da-4df2-aff5-e139a5618ccb",
"be14916b-0068-4b49-b8d0-f9e528f3d10e"
],
"end": 1758826006.864428,
"duration": 0.034265
}
]
}
Access-Control-Allow-Headers: *
Access-Control-Allow-Methods: GET, HEAD, POST, OPTIONS, PUT, PATCH, DELETE, PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, UNLOCK
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: ETag, Location
Allow: GET, HEAD, POST, OPTIONS, PUT, PATCH, DELETE, PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, UNLOCK
Cache-Control: no-cache, private
Content-Type: application/json; charset=utf-8
Date: Sat, 06 Sep 2025 14:57:35 GMT
Transfer-Encoding: chunked
X-Powered-By: Ember Nexus API

The response only contains the first 5 of 29 total matching elements, as requested via pageSize.