# Search for concepts by ECL query

| Steps                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | References                                                                                                                                                                                                                                                                                                                                                                                                   |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p>When in text search mode (default on opening <em>Task View - Search</em> tab), press <code>Switch to ECL</code>.<br></p><p>If previously switched to template search mode, press <code>Switch to Text</code>, then press <code>Switch to ECL</code>.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | <div><figure><img src="/files/IIiivak0aD1RwyblX9BG" alt=""><figcaption></figcaption></figure></div><div><figure><img src="/files/KcU4RCc4ROTd7Xe2btCx" alt=""><figcaption></figcaption></figure></div>                                                                                                                                                                                                       |
| Enter an ECL expression into the search query box.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | <div><figure><img src="/files/SCHHgjpmh8iVS25uhN1D" alt=""><figcaption></figcaption></figure></div>                                                                                                                                                                                                                                                                                                          |
| <p>Press the \<i class""fa-magnifying-glass">:magnifying-glass: <code>Search</code> button to the right of the query box, or press <code>Enter</code> on the keyboard.<br></p><p>Whilst the search is running, the results panel shows "Searching...".<br></p><div data-gb-custom-block data-tag="hint" data-style="success" class="hint hint-success"><p><strong>Complex ECL queries</strong><br></p><p>Complex ECL expressions which require analysis of many hundreds or even thousands of nodes may take some time to execute - from a few seconds to a minute or perhaps longer for extreme cases (for instance searching for all leaf nodes in SNOMED CT can take up to a minute).</p></div><div data-gb-custom-block data-tag="hint" data-style="success" class="hint hint-success"><p><strong>Working with ECL search results</strong><br></p><p>ECL search results are formatted and presented in the same way as text search results.<br></p><p>See <a href="/pages/vkWlg5cBea7WEshoMoPz">Work with large concept search results sets</a> and <a href="/pages/XvrhZN43IJ31c6Pzj65m">Act on concept search results</a> for more information.</p></div> | <div><figure><img src="/files/b0XQYVu1ySdNC6kfTDHH" alt=""><figcaption></figcaption></figure></div><div><figure><img src="https://github.com/SNOMED-Documents/snomed-authoring-userguide/blob/main/images/100893685.png" alt=""><figcaption></figcaption></figure></div>                                                                                                                                     |
| <p>After obtaining ECL expression search results, the results set can be refined by entering an additional term filter in the query box below the expression.<br></p><p>For example the ECL expression <code>>!\*</code> returns all concepts that are leaf nodes.<br></p><p>By adding an additional term filter a particular set of matching leaf nodes can be found, such as all leaf nodes containing the word "limb" in their FSN.<br></p><div data-gb-custom-block data-tag="hint" data-style="success" class="hint hint-success"><p><strong>Changing ECL search parameters triggers the search</strong><br></p><p>Whenever the ECL expression or additional term filter is modified, or the Inferred / Fully Defined / All or All / Primitive / Fully Defined options are changed, a new search will be triggered.</p></div>                                                                                                                                                                                                                                                                                                                              | <div><figure><img src="/files/5Vup7B6SSX3DsUlCGjHA" alt=""><figcaption></figcaption></figure></div><div><figure><img src="/files/UNc4kuwzaLYcbxGC7phB" alt=""><figcaption></figcaption></figure></div>                                                                                                                                                                                                       |
| ECL search results can be switched between the `Inferred` (default) and `Stated` view.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | <div><figure><img src="/files/4zumdTusyMSsTzpJAidy" alt=""><figcaption></figcaption></figure></div><div><figure><img src="/files/uJpY7UqDgtHI0N04TkBe" alt=""><figcaption></figcaption></figure></div>                                                                                                                                                                                                       |
| <p>ECL search results can also be filtered by their Definition Status:<br></p><ul><li><code>All</code> (Primitive and Fully Defined)</li><li><code>Primitive</code></li><li><code>Fully Defined</code></li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | <div><figure><img src="/files/HmqMUTcZotYVrsx2dznX" alt=""><figcaption></figcaption></figure></div><div><figure><img src="/files/gq0BhBFbKYfxyKIUVDTX" alt=""><figcaption></figcaption></figure></div><div><figure><img src="/files/mP1A0plYtLIRtCaMMCC5" alt=""><figcaption></figcaption></figure></div><div><figure><img src="/files/epsYTZJFO1XAb86wV13G" alt=""><figcaption></figcaption></figure></div> |

<a href="https://docs.google.com/forms/d/e/1FAIpQLScTmbZIf0UEQwYDkY27EEWBkaiYkHSbR0_9DmFrMLXoQLyL7Q/viewform?usp=pp_url&#x26;entry.1767247133=AP+UG&#x26;entry.670899847=Search%20for%20concepts%20by%20ECL%20query" class="button primary">Provide Feedback</a>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.snomed.org/snomed-ct-user-guides/authoring-user-guide/how-to/task-taxonomy-and-concept-search/search-for-concepts-by-ecl-query.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
