API version: dev

---

# Find tagged elements

This example finds all `Plant` nodes tagged `blue`, by matching the path `(:Plant)-[:HAS_TAG]->(:Tag {name: "blue"})`
against the graph in Neo4j.\
Results are then [hydrated](/reference/search/element-hydration.md), i.e. transformed into a collection response - since a
`Cypher Path` step returns full paths, the tag node itself is part of the result too, not just the tagged plants.

```bash
curl -X POST \
  -H 'Authorization: Bearer secret-token:PIPeJGUt7c00ENn8a5uDlc' \
  -H 'Content-Type: application/json' \
  -d '{
        "debug": true,
        "steps": [
          {
            "type": "cypher-path-subset",
            "query": "MATCH path=((:Plant)-[:HAS_TAG]->(:Tag {name: \"blue\"})) RETURN path"
          },
          {
            "type": "element-hydration"
          }
        ]
      }' \
  https://api.example.com/search
```

##### Response Body

```json
{
  "type": "_SearchResultResponse",
  "results": [
    {
      "type": "Plant",
      "id": "78dd0a4d-2b94-4997-b4a4-353de854047c",
      "data": {
        "images": [
          {
            "description": "Strelitzia reginae or Bird of Paradise",
            "imageLinkFull": "https://upload.wikimedia.org/wikipedia/commons/5/55/Bird_of_Paradise_flower.JPG",
            "imageLinkThumbnail": "https://upload.wikimedia.org/wikipedia/commons/thumb/5/55/Bird_of_Paradise_flower.JPG/960px-Bird_of_...",
            "link": "https://en.wikipedia.org/wiki/File:Bird_of_Paradise_flower.JPG"
          },
          {
            "description": "Portugal, Madeira, Botanical garden in Funchal",
            "imageLinkFull": "https://upload.wikimedia.org/wikipedia/commons/6/68/2010-03-05_13_16_21_Portugal-Jardim_Bot%C3%A2nic...",
            "imageLinkThumbnail": "https://upload.wikimedia.org/wikipedia/commons/thumb/6/68/2010-03-05_13_16_21_Portugal-Jardim_Bot%C3...",
            "link": "https://en.wikipedia.org/wiki/File:2010-03-05_13_16_21_Portugal-Jardim_Bot%C3%A2nico_da_Madeira.jpg"
          }
        ],
        "created": "2025-09-25T18:43:14+00:00",
        "updated": "2025-09-25T18:43:14+00:00",
        "name": "Bird of Paradise",
        "scenario": "general.botanicExample",
        "scientificName": "S. reginae",
        "link": "https://en.wikipedia.org/wiki/Strelitzia_reginae",
        "description": "Strelitzia reginae, commonly known as the crane flower, bird of paradise, or isigude in Nguni,[3] is..."
      }
    },
    {
      "type": "Tag",
      "id": "79ca27e5-93bb-43e6-a76b-096ea45e2e8e",
      "data": {
        "description": "Blue is one of the three primary colours in the RGB (additive) colour model, as well as in the RYB c...",
        "created": "2025-09-25T18:43:12+00:00",
        "updated": "2025-09-25T18:43:12+00:00",
        "name": "blue",
        "color": "#4363d8",
        "scenario": "general.botanicExample",
        "link": "https://en.wikipedia.org/wiki/Blue"
      }
    },
    {
      "type": "HAS_TAG",
      "id": "9200e5be-fbd6-4592-86bd-fdf40125a712",
      "start": "78dd0a4d-2b94-4997-b4a4-353de854047c",
      "end": "79ca27e5-93bb-43e6-a76b-096ea45e2e8e",
      "data": {
        "created": "2025-09-25T18:43:24+00:00",
        "updated": "2025-09-25T18:43:24+00:00",
        "scenario": "general.botanicExample"
      }
    },
    "... 10 more items omitted (shapes seen: type:Plant, type:Tag, type:HAS_TAG) ..."
  ],
  "debug": [
    {
      "input": {
        "type": "cypher-path-subset",
        "query": "MATCH path=((:Plant)-[:HAS_TAG]->(:Tag {name: \"blue\"})) RETURN path",
        "parameters": {
          "stepResults": []
        }
      },
      "step-handler": "cypher-path-subset (App\\EventSystem\\SearchStep\\EventListener\\CypherPathSearchStepEventListener)",
      "start": 1758825857.489016,
      "end": 1758825857.750409,
      "duration": 0.26139283180236816
    },
    {
      "input": {
        "type": "element-hydration",
        "query": null,
        "parameters": {
          "stepResults": [
            {
              "paths": [
                {
                  "nodeIds": [
                    "ad80a619-2b53-4f27-a4bd-56a316c15251",
                    "79ca27e5-93bb-43e6-a76b-096ea45e2e8e"
                  ],
                  "relationIds": [
                    "f096b595-d67b-4600-9b88-a0255d55db32"
                  ]
                },
                {
                  "nodeIds": [
                    "78dd0a4d-2b94-4997-b4a4-353de854047c",
                    "79ca27e5-93bb-43e6-a76b-096ea45e2e8e"
                  ],
                  "relationIds": [
                    "9200e5be-fbd6-4592-86bd-fdf40125a712"
                  ]
                },
                {
                  "nodeIds": [
                    "884dd581-bcdd-43f1-9dab-11524578d9e2",
                    "79ca27e5-93bb-43e6-a76b-096ea45e2e8e"
                  ],
                  "relationIds": [
                    "f63ef383-ad99-48c6-9699-9d71c7c9cd16"
                  ]
                },
                "... 3 more items omitted (shapes seen: nodeIds,relationIds) ..."
              ]
            }
          ]
        }
      },
      "step-handler": "element-hydration (App\\EventSystem\\SearchStep\\EventListener\\ElementHydrationSearchStepEventListener)",
      "start": 1758825857.75059,
      "element-hydration:redundantElementIds": {
        "message": "Removed 5 redundant elementIds.",
        "removedElementIds": [
          "79ca27e5-93bb-43e6-a76b-096ea45e2e8e"
        ]
      },
      "accessibleElementIds": [
        "78dd0a4d-2b94-4997-b4a4-353de854047c",
        "79ca27e5-93bb-43e6-a76b-096ea45e2e8e",
        "83b35321-4a91-4e9f-a49b-66d718c32ba7",
        "... 10 more items omitted (shapes seen: string) ..."
      ],
      "end": 1758825857.812404,
      "duration": 0.061814
    }
  ]
}
```

##### Response Headers

```http
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 graph view shows every plant tagged `blue`, all connected through the shared `blue` tag node - the relations
themselves (`HAS_TAG`) are part of the response as well, since a path always includes its nodes and relations.

---

Home: [Ember Nexus API docs](/index.md)

Full site map: [llms.txt](/llms.txt)

Previous: [Cypher path query](/reference/search/cypher-path-subset.md)

Next: [Find nested elements](/reference/search/cypher-path-subset/find-nested-elements.md)
