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

# Global Search

> Global Search lets users search across your app's data, and your app can query the same results through the GraphQL API. You turn it on per environment, then choose which tables and fields are searchable and add row filters.

**Global Search** is a [Core Service](https://archie.com/docs/backend/app-services.md) that makes your app's data searchable. You decide which tables users can search, which fields are indexed, and which rows are included.

## Turn Global Search on

Global Search is off until you activate it, and it's configured per [environment](https://archie.com/docs/backend/environments.md).

1. Go to **Backend → Core Services → Global Search**.
2. Turn on the switch in the top-right corner of the page header.

Until you turn it on, the **Data Model** card under **Search Scope** reads "Enable global search to configure tables" and **Configure** stays unavailable. After you turn it on, Archie provisions indexes for eligible tables, and the card shows how many tables are enabled.

![The Global Search page with the switch on and the Data Model card showing "15 of 15 tables enabled" with a Configure button.](https://mintcdn.com/archie-e998dbf6/FcInvfd50seksJIy/images/29-global-search-enabled.png?fit=max\&auto=format\&n=FcInvfd50seksJIy\&q=85\&s=abeec3730777c6451ba9365748fe3a2c)

## Configure the search scope

Click **Configure** on the **Data Model** card to open the **Configure Search Scope** drawer. Use it to choose what users can search.

![The Configure Search Scope drawer listing tables with checkboxes, a Search data table field, and Cancel and Save buttons.](https://mintcdn.com/archie-e998dbf6/FcInvfd50seksJIy/images/30-global-search-configure-scope.png?fit=max\&auto=format\&n=FcInvfd50seksJIy\&q=85\&s=3c96affd7d9edfacb865706ad95d21db)

* **Search data table** filters the list by table name.
* **Show enabled only** and **Show all** switch between all tables and only the enabled ones. A counter, such as "15 of 15 tables enabled", shows how many are on.
* Each table has a checkbox. Clear it to keep that table out of search.
* Some tables show **not searchable** with a reason, such as "no eligible text columns" or "no single scalar id column for re-fetch". They can't be enabled.

Click **Save** to apply your changes, or **Cancel** to close the drawer without saving.

### Choose fields and row filters

Click a table to expand it.

![The bugs table expanded in the Configure Search Scope drawer, with description and title selected under Searchable fields and an empty Row filter section.](https://mintcdn.com/archie-e998dbf6/FcInvfd50seksJIy/images/31-global-search-table-fields.png?fit=max\&auto=format\&n=FcInvfd50seksJIy\&q=85\&s=4ccba32491237514d6d613e72ef1a89d)

* **Searchable fields** lists the table's indexed text fields. Clear a checkbox to exclude a field from search.
* **Row filter** limits which rows are searchable. Click **Add condition**, then pick a field, an operator, and a value. Only rows that match all conditions are searchable. For example, use a filter to hide soft-deleted rows. With no conditions, the table shows "No filter — all rows searchable."

Row filter operators are **is null**, **is not null**, **equals**, **not equals**, **in**, and **not in**.

A table you changed from its defaults is marked **customized**.

## Search from your app

When Global Search is on in an environment, the GraphQL API for that environment exposes a `search` query. Pass the search term in the `query` argument. The query returns results only from the tables and fields enabled in your search scope.

```graphql theme={null}
query SearchRecords {
  search(query: "Hey!") {
    items {
      fields
      id
      rank
      table
    }
    totalCount
  }
}
```

The `search` result contains these fields:

* `items`: the matching records. Each item includes:
  * `table`: the table the result comes from.
  * `id`: the ID of the record.
  * `rank`: the relevance of the result. Higher values are more relevant.
  * `fields`: the field values of the matching record.
* `totalCount`: the total number of results.

You can try the query in the [GraphQL API Explorer](https://archie.com/docs/backend/graphql-api-explorer.md). Calls from your app authenticate the same way as the rest of the API, using your [API keys](https://archie.com/docs/backend/settings/api-keys.md).

## FAQ

> **Why can't I enable some tables?**
>
> Tables with no eligible text columns are marked **not searchable**. Global Search needs at least one text field to index.

> **Do my changes apply right away?**
>
> No. Changes in the drawer apply when you click **Save**.

> **What happens when I turn Global Search off?**
>
> The switch returns to its off state and **Configure** becomes unavailable again.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.