Exact keyword matching
This example uses Elasticsearch’s term to retrieve all elements whose name has the exact same content as the provided query, “Bluebell”, and are accessible to the user.
Results are then , i.e. transformed into a collection response.
Note: Instead of querying the Elasticsearch property name directly, we use name.keyword for a more efficient lookup. The .keyword suffix is part of Elasticsearch’s automatic schema generation process. Manually managed schemas might differ. See their for details.
curl -X POST \ -H 'Authorization: Bearer secret-token:PIPeJGUt7c00ENn8a5uDlc' \ -H 'Content-Type: application/json' \ -d '{ "debug": true, "steps": [ { "type": "elasticsearch-query-dsl-mixin", "query": { "term": { "name.keyword": { "value": "Bluebell" } } } }, { "type": "element-hydration" } ] }' \ https://api.example.com/search[ { "input": { "type": "elasticsearch-query-dsl-mixin", "query": { "term": { "name.keyword": { "value": "Bluebell" } } }, "parameters": { "stepResults": [] } }, "step-handler": "elasticsearch-query-dsl-mixin (App\\EventSystem\\SearchStep\\EventListener\\ElasticsearchQueryDslMixinSearchStepEventListener)", "start": 1796473117.558425, "indices": "*", "combinedQuery": { "_source": [ "_id" ], "from": 0, "size": 25, "query": { "bool": { "must": [ { "term": { "name.keyword": { "value": "Bluebell" } } } ], "filter": [ { "bool": { "should": [ { "terms": { "_groupsWithSearchAccess.keyword": [] } }, { "term": { "_usersWithSearchAccess.keyword": { "value": "02IiNr0GOoKiPMM5A0eq9jHk2upaJezsVtWjL" } } } ], "minimum_should_match": 1 } } ] } } }, "end": 1796473117.567481, "duration": 0.009056 }, { "input": { "type": "element-hydration", "query": null, "parameters": { "stepResults": [ { "elements": [ { "id": "02IiNr0GOoKiPMM95MrKH8ljX349BOQ3hyMlZ", "type": "Plant", "metadata": { "score": 3.895893 } } ], "totalHits": 1, "maxScore": 3.895893 } ] } }, "step-handler": "element-hydration (App\\EventSystem\\SearchStep\\EventListener\\ElementHydrationSearchStepEventListener)", "start": 1796473117.567805, "accessibleElementIds": [ "02IiNr0GOoKiPMM95MrKH8ljX349BOQ3hyMlZ" ], "end": 1796473117.62833, "duration": 0.060525 }]{ "type": "_SearchResultResponse", "results": [ { "type": "Plant", "id": "02IiNr0GOoKiPMM95MrKH8ljX349BOQ3hyMlZ", "data": { "images": [ { "description": "Mertensia virginica Virginia Bluebell seen in Brooklyn Botanic Garden", "imageLinkFull": "https://upload.wikimedia.org/wikipedia/commons/3/31/Mertensia_virginica.bbg.jpg", "imageLinkThumbnail": "https://upload.wikimedia.org/wikipedia/commons/thumb/3/31/Mertensia_virginica.bbg.jpg/960px-Mertensia_virginica.bbg.jpg", "link": "https://en.wikipedia.org/wiki/File:Mertensia_virginica.bbg.jpg" }, { "description": "Virginia Bluebells along the Rocky River in Berea, OH. Photo by Geoffrey A. Landis", "imageLinkFull": "https://upload.wikimedia.org/wikipedia/commons/6/6f/Virginia_Bluebells_at_Rocky_River.jpg", "imageLinkThumbnail": "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6f/Virginia_Bluebells_at_Rocky_River.jpg/960px-Virginia_Bluebells_at_Rocky_River.jpg", "link": "https://en.wikipedia.org/wiki/File:Virginia_Bluebells_at_Rocky_River.jpg" } ], "hasFile": true, "name": "Bluebell", "scenario": "general.botanicExample", "scientificName": "M. virginica", "link": "https://en.wikipedia.org/wiki/Mertensia_virginica", "description": "Mertensia virginica (common names Virginia bluebells, Virginia cowslip, lungwort oysterleaf, Roanoke bells) is a spring ephemeral plant in the Boraginaceae (borage) family with bell-shaped sky-blue flowers, native to eastern North America.", "createdAt": "2026-12-05T12:16:05+00:00", "updatedAt": "2026-12-05T12:16:05+00:00" }, "file": { "contentLength": 82651, "extension": "jpg", "mimeType": "image/jpeg", "hash": { "sha256": "527fa0ca5006ae3c888c06c3e208db64aa0214b31ce9f26a1ccd5fa7cdf91c3b" } }, "metadata": { "score": 3.895893 } } ], "debug": [ { "input": { "type": "elasticsearch-query-dsl-mixin", "query": { "term": { "name.keyword": { "value": "Bluebell" } } }, "parameters": { "stepResults": [] } }, "step-handler": "elasticsearch-query-dsl-mixin (App\\EventSystem\\SearchStep\\EventListener\\ElasticsearchQueryDslMixinSearchStepEventListener)", "start": 1796473117.558425, "indices": "*", "combinedQuery": { "_source": [ "_id" ], "from": 0, "size": 25, "query": { "bool": { "must": [ { "term": { "name.keyword": { "value": "Bluebell" } } } ], "filter": [ { "bool": { "should": [ { "terms": { "_groupsWithSearchAccess.keyword": [] } }, { "term": { "_usersWithSearchAccess.keyword": { "value": "02IiNr0GOoKiPMM5A0eq9jHk2upaJezsVtWjL" } } } ], "minimum_should_match": 1 } } ] } } }, "end": 1796473117.567481, "duration": 0.009056 }, { "input": { "type": "element-hydration", "query": null, "parameters": { "stepResults": [ { "elements": [ { "id": "02IiNr0GOoKiPMM95MrKH8ljX349BOQ3hyMlZ", "type": "Plant", "metadata": { "score": 3.895893 } } ], "totalHits": 1, "maxScore": 3.895893 } ] } }, "step-handler": "element-hydration (App\\EventSystem\\SearchStep\\EventListener\\ElementHydrationSearchStepEventListener)", "start": 1796473117.567805, "accessibleElementIds": [ "02IiNr0GOoKiPMM95MrKH8ljX349BOQ3hyMlZ" ], "end": 1796473117.62833, "duration": 0.060525 } ]}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:49 GMTTransfer-Encoding: chunkedVary: Prefer, Accept-EncodingX-Powered-By: Ember Nexus APIAs only a single element has the name “Bluebell”, the search response is almost empty.