Element hydration
The element hydration search step is a single task, executable within requests.
The hydration step converts a list of element ids to a collection response, containing elements and all their properties. This step is mostly used to convert results of other search steps to collection responses usable by clients.
Security aspects
As all element ids are internally checked for access by the current user and only accessible elements are hydrated and returned, this search step is considered safe and can therefore be executed by any user.
Input parameters
This search step does not have explicit parameters defined. Parameters are available within expressions.
Input query
The query must be an object containing the following properties:
elementIds: List of element ids (string) or a single string containing an expression, which returns a list of element ids (string).
Step result
List of hydrated elements.
Metadata
Steps can add metadata to elements, e.g. the Elasticsearch adds the score of its elements. The hydration returns the metadata of all previous steps as metadata, after the native properties of the element like data and file. It is associated with the element id, so it is also returned for elements whose ids passed through steps which do not know about it, e.g. a Cypher path search.
metadata is a single object: the metadata of all previous steps is merged in the order of the steps, so keys of later steps overwrite keys of earlier steps. The metadata of individual steps stays available to later steps in their stepResults, e.g. in expressions. Elements without metadata have no metadata property. As with all elements, only elements which the user has access to are returned, including their metadata.
The following search runs an Elasticsearch step followed by the hydration. Each element contains the score of the Elasticsearch step in metadata.score:
curl -X POST \ -H 'Authorization: Bearer secret-token:PIPeJGUt7c00ENn8a5uDlc' \ -H 'Content-Type: application/json' \ -d '{ "debug": true, "steps": [ { "type": "elasticsearch-query-dsl-mixin", "query": { "match": { "description": "lily" } }, "parameters": { "nodeTypes": [ "Plant" ], "pageSize": 3 } }, { "type": "element-hydration" } ] }' \ https://api.example.com/search[ { "input": { "type": "elasticsearch-query-dsl-mixin", "query": { "match": { "description": "lily" } }, "parameters": { "nodeTypes": [ "Plant" ], "pageSize": 3, "stepResults": [] } }, "step-handler": "elasticsearch-query-dsl-mixin (App\\EventSystem\\SearchStep\\EventListener\\ElasticsearchQueryDslMixinSearchStepEventListener)", "start": 1796473377.210894, "indices": "node_plant", "combinedQuery": { "_source": [ "_id" ], "from": 0, "size": 3, "query": { "bool": { "must": [ { "match": { "description": "lily" } } ], "filter": [ { "bool": { "should": [ { "terms": { "_groupsWithSearchAccess.keyword": [] } }, { "term": { "_usersWithSearchAccess.keyword": { "value": "02IiNr0GOoKiPMM5A0eq9jHk2upaJezsVtWjL" } } } ], "minimum_should_match": 1 } } ] } } }, "end": 1796473377.220724, "duration": 0.00983 }, { "input": { "type": "element-hydration", "query": null, "parameters": { "stepResults": [ { "elements": [ { "id": "02IiNr0GOoKiPMLPDlPbKrlR4vnBQsvSBSkU5", "type": "Plant", "metadata": { "score": 4.001134 } }, { "id": "02IiNr0GOoKiPMN3kwX8zU4CDN8SlR7WlvzLO", "type": "Plant", "metadata": { "score": 3.2452915 } }, { "id": "02IiNr0GOoKiPMLO9dQSP9Mmvy5E3YmZXDsBP", "type": "Plant", "metadata": { "score": 3.0498557 } } ], "totalHits": 8, "maxScore": 4.001134 } ] } }, "step-handler": "element-hydration (App\\EventSystem\\SearchStep\\EventListener\\ElementHydrationSearchStepEventListener)", "start": 1796473377.221027, "accessibleElementIds": [ "02IiNr0GOoKiPMLPDlPbKrlR4vnBQsvSBSkU5", "02IiNr0GOoKiPMN3kwX8zU4CDN8SlR7WlvzLO", "02IiNr0GOoKiPMLO9dQSP9Mmvy5E3YmZXDsBP" ], "end": 1796473377.23253, "duration": 0.011503 }]{ "type": "_SearchResultResponse", "results": [ { "type": "Plant", "id": "02IiNr0GOoKiPMLPDlPbKrlR4vnBQsvSBSkU5", "data": { "images": [ { "description": "", "imageLinkFull": "https://upload.wikimedia.org/wikipedia/commons/f/fe/Flame_lily.png", "imageLinkThumbnail": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/fe/Flame_lily.png/500px-Flame_lily.png", "link": "https://en.wikipedia.org/wiki/File:Flame_lily.png" }, { "description": "Gloriosa superba at Mabvuku, Harare, Zimbabwe", "imageLinkFull": "https://upload.wikimedia.org/wikipedia/commons/b/bc/Gloriosa_superba_1.jpg", "imageLinkThumbnail": "https://upload.wikimedia.org/wikipedia/commons/thumb/b/bc/Gloriosa_superba_1.jpg/960px-Gloriosa_superba_1.jpg", "link": "https://en.wikipedia.org/wiki/File:Gloriosa_superba_1.jpg" } ], "hasFile": true, "name": "Flame Lily", "scenario": "general.botanicExample", "scientificName": "G. superba", "link": "https://en.wikipedia.org/wiki/Gloriosa_superba", "description": "Gloriosa superba is a species of flowering plant in the family Colchicaceae. Common names include flame lily, climbing lily, creeping lily, glory lily, gloriosa lily, tiger claw, and fire lily.", "createdAt": "2026-12-05T12:21:40+00:00", "updatedAt": "2026-12-05T12:21:40+00:00" }, "file": { "contentLength": 90681, "extension": "jpg", "mimeType": "image/jpeg", "hash": { "sha256": "72e3e3770db795b2f04f0b5bb0be43e74df70de4faa0bf83a706bbde29e4ea0b" } }, "metadata": { "score": 4.001134 } }, { "type": "Plant", "id": "02IiNr0GOoKiPMN3kwX8zU4CDN8SlR7WlvzLO", "data": { "images": [ { "description": "Red-hot poker plants (Kniphofia uvaria) on the shore of Lake Jindabyne, New South Wales, Australia.", "imageLinkFull": "https://upload.wikimedia.org/wikipedia/commons/c/c1/Kniphofia_uvaria_close.JPG", "imageLinkThumbnail": "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c1/Kniphofia_uvaria_close.JPG/960px-Kniphofia_uvaria_close.JPG", "link": "https://en.wikipedia.org/wiki/File:Kniphofia_uvaria_close.JPG" } ], "hasFile": true, "name": "Red Hot Poker", "scenario": "general.botanicExample", "scientificName": "K. uvaria", "link": "https://en.wikipedia.org/wiki/Kniphofia_uvaria", "description": "Kniphofia uvaria is a species of flowering plant in the family Asphodelaceae, commonly known as tritomea, torch lily, or red hot poker, due to the shape and color of its inflorescence. The leaves are reminiscent of a lily, and the flowerhead can reach up to 1.5 m (5 ft) in height. There are many varieties of torch lily, and they bloom at different times during the growing season. The flowers are red, orange, and yellow.", "createdAt": "2026-12-05T12:21:40+00:00", "updatedAt": "2026-12-05T12:21:40+00:00" }, "file": { "contentLength": 123686, "extension": "jpg", "mimeType": "image/jpeg", "hash": { "sha256": "a0f461e0383bc5b4518a43e1ac76060612c7e87bf420f9a6bbbe5231012108fe" } }, "metadata": { "score": 3.2452915 } }, { "type": "Plant", "id": "02IiNr0GOoKiPMLO9dQSP9Mmvy5E3YmZXDsBP", "data": { "images": [ { "description": "Lilium candidum, Israel", "imageLinkFull": "https://upload.wikimedia.org/wikipedia/commons/c/cc/ShoshanTzachor-2-wiki-Zachi-Evenor.jpg", "imageLinkThumbnail": "https://upload.wikimedia.org/wikipedia/commons/thumb/c/cc/ShoshanTzachor-2-wiki-Zachi-Evenor.jpg/500px-ShoshanTzachor-2-wiki-Zachi-Evenor.jpg", "link": "https://en.wikipedia.org/wiki/File:ShoshanTzachor-2-wiki-Zachi-Evenor.jpg" }, { "description": "Photo of Lilium candidum at VanDusen Botanical Garden", "imageLinkFull": "https://upload.wikimedia.org/wikipedia/commons/3/30/Lilium_candidum_1.jpg", "imageLinkThumbnail": "https://upload.wikimedia.org/wikipedia/commons/thumb/3/30/Lilium_candidum_1.jpg/960px-Lilium_candidum_1.jpg", "link": "https://en.wikipedia.org/wiki/File:Lilium_candidum_1.jpg" } ], "hasFile": true, "name": "Lily", "scenario": "general.botanicExample", "scientificName": "L. candidum", "link": "https://en.wikipedia.org/wiki/Lilium_candidum", "description": "Lilium candidum, the Madonna lily or white lily, is a plant in the true lily family. It is native to the Balkans and Middle East, and naturalized in other parts of Europe, including France, Italy, and Ukraine, and in North Africa, the Canary Islands, Mexico, and other regions. It has been cultivated since antiquity, for at least 3,000 years, and has great symbolic value since then for many cultures. It is susceptible to several virus diseases common to lilies, and especially to Botrytis fungus. One technique to avoid problems with viruses is to grow plants from seed instead of bulblets.", "createdAt": "2026-12-05T12:21:40+00:00", "updatedAt": "2026-12-05T12:21:40+00:00" }, "file": { "contentLength": 115168, "extension": "jpg", "mimeType": "image/jpeg", "hash": { "sha256": "ee066b93ae72c719f863a428f03c86ecd28e52818528eacf4d4e32acb4b4b37c" } }, "metadata": { "score": 3.0498557 } } ], "debug": [ { "input": { "type": "elasticsearch-query-dsl-mixin", "query": { "match": { "description": "lily" } }, "parameters": { "nodeTypes": [ "Plant" ], "pageSize": 3, "stepResults": [] } }, "step-handler": "elasticsearch-query-dsl-mixin (App\\EventSystem\\SearchStep\\EventListener\\ElasticsearchQueryDslMixinSearchStepEventListener)", "start": 1796473377.210894, "indices": "node_plant", "combinedQuery": { "_source": [ "_id" ], "from": 0, "size": 3, "query": { "bool": { "must": [ { "match": { "description": "lily" } } ], "filter": [ { "bool": { "should": [ { "terms": { "_groupsWithSearchAccess.keyword": [] } }, { "term": { "_usersWithSearchAccess.keyword": { "value": "02IiNr0GOoKiPMM5A0eq9jHk2upaJezsVtWjL" } } } ], "minimum_should_match": 1 } } ] } } }, "end": 1796473377.220724, "duration": 0.00983 }, { "input": { "type": "element-hydration", "query": null, "parameters": { "stepResults": [ { "elements": [ { "id": "02IiNr0GOoKiPMLPDlPbKrlR4vnBQsvSBSkU5", "type": "Plant", "metadata": { "score": 4.001134 } }, { "id": "02IiNr0GOoKiPMN3kwX8zU4CDN8SlR7WlvzLO", "type": "Plant", "metadata": { "score": 3.2452915 } }, { "id": "02IiNr0GOoKiPMLO9dQSP9Mmvy5E3YmZXDsBP", "type": "Plant", "metadata": { "score": 3.0498557 } } ], "totalHits": 8, "maxScore": 4.001134 } ] } }, "step-handler": "element-hydration (App\\EventSystem\\SearchStep\\EventListener\\ElementHydrationSearchStepEventListener)", "start": 1796473377.221027, "accessibleElementIds": [ "02IiNr0GOoKiPMLPDlPbKrlR4vnBQsvSBSkU5", "02IiNr0GOoKiPMN3kwX8zU4CDN8SlR7WlvzLO", "02IiNr0GOoKiPMLO9dQSP9Mmvy5E3YmZXDsBP" ], "end": 1796473377.23253, "duration": 0.011503 } ]}Access-Control-Allow-Headers: *Access-Control-Allow-Methods: OPTIONS, POSTAccess-Control-Allow-Origin: *Access-Control-Expose-Headers: ETag, LocationAllow: OPTIONS, POSTCache-Control: no-cache, privateContent-Type: application/json; charset=utf-8Date: Sat, 21 Nov 2026 10:43:15 GMTTransfer-Encoding: chunkedX-Powered-By: Ember Nexus APIExamples
Example
Request
{ "debug": true, "steps": [ { "type": "element-hydration", "query": { "elementIds": [ "02IiNr0GOoKiPMLPDlPbKrlR4vnBQsvSBSkU5", "02IiNr0GOoKiPMLVYC87gam9dbmx8E6khf0g8", "02IiNr0GOoKiPMMBnI2aIF8Qd4GH33FIAozo7" ] } } ]}curl \ -H 'Authorization: Bearer secret-token:PIPeJGUt7c00ENn8a5uDlc' \ -H 'Content-Type: application/json' \ --data-binary @payload.json \ https://api.example.com/searchResponse
[ { "input": { "type": "element-hydration", "query": { "elementIds": [ "02IiNr0GOoKiPMLPDlPbKrlR4vnBQsvSBSkU5", "02IiNr0GOoKiPMLVYC87gam9dbmx8E6khf0g8", "02IiNr0GOoKiPMMBnI2aIF8Qd4GH33FIAozo7" ] }, "parameters": { "stepResults": [] } }, "step-handler": "element-hydration (App\\EventSystem\\SearchStep\\EventListener\\ElementHydrationSearchStepEventListener)", "start": 1796299633.878396, "accessibleElementIds": [ "02IiNr0GOoKiPMLPDlPbKrlR4vnBQsvSBSkU5", "02IiNr0GOoKiPMLVYC87gam9dbmx8E6khf0g8", "02IiNr0GOoKiPMMBnI2aIF8Qd4GH33FIAozo7" ], "end": 1796299633.896722, "duration": 0.018326 }]{ "type": "_SearchResultResponse", "results": [ { "type": "Plant", "id": "02IiNr0GOoKiPMLPDlPbKrlR4vnBQsvSBSkU5", "data": { "images": [ { "description": "", "imageLinkFull": "https://upload.wikimedia.org/wikipedia/commons/f/fe/Flame_lily.png", "imageLinkThumbnail": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/fe/Flame_lily.png/500px-Flame_lily.png", "link": "https://en.wikipedia.org/wiki/File:Flame_lily.png" }, { "description": "Gloriosa superba at Mabvuku, Harare, Zimbabwe", "imageLinkFull": "https://upload.wikimedia.org/wikipedia/commons/b/bc/Gloriosa_superba_1.jpg", "imageLinkThumbnail": "https://upload.wikimedia.org/wikipedia/commons/thumb/b/bc/Gloriosa_superba_1.jpg/960px-Gloriosa_superba_1.jpg", "link": "https://en.wikipedia.org/wiki/File:Gloriosa_superba_1.jpg" } ], "hasFile": true, "name": "Flame Lily", "scientificName": "G. superba", "scenario": "general.botanicExample", "link": "https://en.wikipedia.org/wiki/Gloriosa_superba", "description": "Gloriosa superba is a species of flowering plant in the family Colchicaceae. Common names include flame lily, climbing lily, creeping lily, glory lily, gloriosa lily, tiger claw, and fire lily.", "createdAt": "2026-12-03T12:05:26+00:00", "updatedAt": "2026-12-03T12:05:26+00:00" }, "file": { "contentLength": 90681, "extension": "jpg", "mimeType": "image/jpeg", "hash": { "sha256": "72e3e3770db795b2f04f0b5bb0be43e74df70de4faa0bf83a706bbde29e4ea0b" } } }, { "type": "Plant", "id": "02IiNr0GOoKiPMLVYC87gam9dbmx8E6khf0g8", "data": { "images": [ { "description": "Flower of Nelumbo nucifera, bean of India.", "imageLinkFull": "https://upload.wikimedia.org/wikipedia/commons/e/ed/Sacred_lotus_Nelumbo_nucifera.jpg", "imageLinkThumbnail": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/ed/Sacred_lotus_Nelumbo_nucifera.jpg/960px-Sacred_lotus_Nelumbo_nucifera.jpg", "link": "https://en.wikipedia.org/wiki/File:Sacred_lotus_Nelumbo_nucifera.jpg" }, { "description": "Nelumbo nucifera", "imageLinkFull": "https://upload.wikimedia.org/wikipedia/commons/3/34/Nelumbo_nucifera1romainguy.jpg", "imageLinkThumbnail": "https://upload.wikimedia.org/wikipedia/commons/thumb/3/34/Nelumbo_nucifera1romainguy.jpg/500px-Nelumbo_nucifera1romainguy.jpg", "link": "https://en.wikipedia.org/wiki/File:Nelumbo_nucifera1romainguy.jpg" } ], "hasFile": true, "name": "Lotus", "scientificName": "N. nucifera", "scenario": "general.botanicExample", "link": "https://en.wikipedia.org/wiki/Nelumbo_nucifera", "description": "Nelumbo nucifera, also known as Padma (Sanskrit: \\u092a\\u0926\\u094d\\u092e, romanized: Padm\\u0101, lit.\\u2009'Lotus') or Kamala (Sanskrit: \\u0915\\u092e\\u0932, lit. 'Lotus'), sacred lotus, pink lotus, Indian lotus, or simply lotus, is one of two extant species of aquatic plant in the family Nelumbonaceae. It is sometimes colloquially called a water lily, though this more often refers to members of the family Nymphaeaceae. The lotus belongs in the order Proteales.", "createdAt": "2026-12-03T12:05:26+00:00", "updatedAt": "2026-12-03T12:05:26+00:00" }, "file": { "contentLength": 63295, "extension": "jpg", "mimeType": "image/jpeg", "hash": { "sha256": "a46657ef9ece1a7e0939ee5edcc4358f23a3b8b7871c6eba4ad2ce0f30cf4e9f" } } }, { "type": "Plant", "id": "02IiNr0GOoKiPMMBnI2aIF8Qd4GH33FIAozo7", "data": { "images": [ { "description": "in Seoul Forest, South Korea", "imageLinkFull": "https://upload.wikimedia.org/wikipedia/commons/7/7b/Tulips_in_Seoul_Forest%2C_South_Korea1.jpg", "imageLinkThumbnail": "https://upload.wikimedia.org/wikipedia/commons/thumb/7/7b/Tulips_in_Seoul_Forest%2C_South_Korea1.jpg/500px-Tulips_in_Seoul_Forest%2C_South_Korea1.jpg", "link": "https://en.wikipedia.org/wiki/File:Tulips_in_Seoul_Forest,_South_Korea1.jpg" }, { "description": "A Yonina cultivar (Division 6) tulip at the Tulip Fest in Albany, New York, United States.", "imageLinkFull": "https://upload.wikimedia.org/wikipedia/commons/7/7b/Yonina_Tulip.jpg", "imageLinkThumbnail": "https://upload.wikimedia.org/wikipedia/commons/thumb/7/7b/Yonina_Tulip.jpg/960px-Yonina_Tulip.jpg", "link": "https://en.wikipedia.org/wiki/File:Yonina_Tulip.jpg" }, { "description": "Tulipa orphanidea, garden plant", "imageLinkFull": "https://upload.wikimedia.org/wikipedia/commons/c/c4/Tulipa_orphanidea_060506.jpg", "imageLinkThumbnail": "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c4/Tulipa_orphanidea_060506.jpg/500px-Tulipa_orphanidea_060506.jpg", "link": "https://en.wikipedia.org/wiki/File:Tulipa_orphanidea_060506.jpg" } ], "hasFile": true, "name": "Tulip", "scientificName": "Tulipa", "scenario": "general.botanicExample", "link": "https://en.wikipedia.org/wiki/Tulip", "description": "Tulips are spring-blooming perennial herbaceous bulbiferous geophytes in the Tulipa genus. Their flowers are usually large, showy, and brightly coloured, generally red, orange, pink, yellow, or white. They often have a different coloured blotch at the base of the tepals, internally. Because of a degree of variability within the populations and a long history of cultivation, classification has been complex and controversial. The tulip is a member of the lily family, Liliaceae, along with 14 other genera, where it is most closely related to Amana, Erythronium, and Gagea in the tribe Lilieae.", "createdAt": "2026-12-03T12:05:26+00:00", "updatedAt": "2026-12-03T12:05:26+00:00" }, "file": { "contentLength": 105488, "extension": "jpg", "mimeType": "image/jpeg", "hash": { "sha256": "c4c242897c43a74e9e4a8b5bf89e6b2cb1cbd99f8d621f33eea175cbf6dfab97" } } } ], "debug": [ { "input": { "type": "element-hydration", "query": { "elementIds": [ "02IiNr0GOoKiPMLPDlPbKrlR4vnBQsvSBSkU5", "02IiNr0GOoKiPMLVYC87gam9dbmx8E6khf0g8", "02IiNr0GOoKiPMMBnI2aIF8Qd4GH33FIAozo7" ] }, "parameters": { "stepResults": [] } }, "step-handler": "element-hydration (App\\EventSystem\\SearchStep\\EventListener\\ElementHydrationSearchStepEventListener)", "start": 1796299633.878396, "accessibleElementIds": [ "02IiNr0GOoKiPMLPDlPbKrlR4vnBQsvSBSkU5", "02IiNr0GOoKiPMLVYC87gam9dbmx8E6khf0g8", "02IiNr0GOoKiPMMBnI2aIF8Qd4GH33FIAozo7" ], "end": 1796299633.896722, "duration": 0.018326 } ]}Access-Control-Allow-Headers: Authorization, Content-Type, PreferAccess-Control-Allow-Methods: OPTIONS, POSTAccess-Control-Allow-Origin: *Access-Control-Expose-Headers: Preference-AppliedAllow: OPTIONS, POSTCache-Control: no-cache, privateContent-Type: application/json; charset=utf-8Date: Thu, 03 Dec 2026 12:24:50 GMTTransfer-Encoding: chunkedVary: Prefer, Accept-EncodingX-Powered-By: Ember Nexus API