> ## Documentation Index
> Fetch the complete documentation index at: https://docs.soriaanalytics.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search

> Search across all Soria dashboards and news stories using full-text, conceptual, and entity-based queries.

Soria's search covers your entire data platform in one query — dashboards and news stories together. You can search by exact title, by concept, or by entity name, and results are ranked by relevance with match context showing you exactly why each result appeared.

## Searching with the `search` tool

```python theme={null}
search(query="star ratings")
# Searches both dashboards and news

search(query="health insurance enrollment", scope="dashboards")
# Dashboards only

search(query="UnitedHealthcare merger", scope="news")
# News only
```

### Parameters

| Parameter     | Type    | Description                                                          |
| ------------- | ------- | -------------------------------------------------------------------- |
| `query`       | string  | Your search text.                                                    |
| `scope`       | string  | `"dashboards"`, `"news"`, or omit to search both.                    |
| `tag`         | string  | Filter dashboard results by tag slug (e.g., `"medicare-advantage"`). |
| `limit`       | integer | Max results per scope. Default is `20`.                              |
| `environment` | string  | Workspace ID to scope dashboard results to a specific workspace.     |

### Query types

* **Exact match** — `"MA Market Share"` finds pages with that exact phrase in the title or description.
* **Conceptual query** — `"health insurance enrollment trends"` surfaces related dashboards even if no title matches word-for-word.
* **Entity match** — `"United Healthcare"` surfaces enrollment dashboards that reference that company, even if the page title says something different.

### Search results

Each result includes a relevance score, path, tags, and match context showing where in the document the match occurred:

```
Dashboards (3 results):

1. MA Enrollment by County (score: 0.9312)
   Path: medicare_advantage/enrollment_by_county
   Tags: medicare-advantage, enrollment
   Match (semantic): column_description [county_name] — County-level Medicare Advantage enrollment...

2. Star Ratings Summary (score: 0.8740)
   Path: medicare_advantage/star_ratings
   Tags: medicare-advantage, star-ratings
   Match (exact): title — Star Ratings Summary
```

### Filtering by tag

Pass a tag slug to restrict dashboard results to a specific tag. Tag slugs are lowercase, hyphenated versions of the tag name.

```python theme={null}
search(
    query="enrollment",
    scope="dashboards",
    tag="medicare-advantage",
)
```

### Workspace-scoped search

Pass `environment` to search dashboard pages in a specific workspace instead of production:

```python theme={null}
search(
    query="star ratings",
    scope="dashboards",
    environment="ws_test_pipeline_58d28fca",
)
```

## Managing the search index

<Note>
  The following operations are for administrators managing the search index. Most users only need the `search` tool above.
</Note>

Use `search_manage` to reindex content, purge stale documents, and manage synonyms.

### Reindexing

Trigger a background reindex of dashboards, news, or both:

```python theme={null}
search_manage(reindex=["dashboards", "news"])
# Full reindex of all content

search_manage(reindex=["dashboards"])
# Dashboards only

search_manage(reindex=["dashboards"], environments=["ws_test_pipeline_58d28fca"])
# Reindex dashboards for a specific workspace
```

Reindexing runs in the background. Check server logs for progress.

### Purging and rebuilding

To reset the index completely and rebuild from scratch:

```python theme={null}
search_manage(purge=True, reindex=["dashboards", "news"])
```

<Warning>
  `purge=True` deletes all indexed documents before reindexing. Search results will be unavailable until the reindex completes.
</Warning>

## Synonyms

Synonyms let you map common abbreviations and alternate names to their canonical forms so that searches for any variant surface the same results.

### Adding synonyms

```python theme={null}
search_manage(
    add_synonyms={
        "name": "UHC",
        "synonyms": ["united healthcare", "uhc", "unitedhealth group", "unh"],
    }
)
```

The `name` field is the display label for the synonym group. The `synonyms` list must contain at least two terms, all lowercase.

### Listing synonyms

```python theme={null}
search_manage(list_synonyms=True)

# Example output:
# Synonym groups:
#   uhc: united healthcare, uhc, unitedhealth group, unh
#   cms: centers for medicare & medicaid services, cms
```

### Removing synonyms

Pass the synonym group ID (the lowercase slug shown in the list) to remove it:

```python theme={null}
search_manage(remove_synonyms="uhc")
```
