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

# Discovery indexes

> The standard Discovery indexes, the attributes they carry, and how to find out what you can filter and sort on.

An **index** is a named collection of documents in [Discovery](/concepts/platform-surfaces/omneo-discovery) that is searched as a unit. The index name goes in the search path and in the `rules` object when you mint a token:

```bash theme={null}
POST https://discovery.[tenant].getomneo.com/indexes/profiles/search
```

## Attribute roles

Every attribute on an index falls into one or more of three roles.

| Role       | What it means                                                         |
| ---------- | --------------------------------------------------------------------- |
| Searchable | `q` is matched against it. Most attributes are searchable by default. |
| Filterable | It can appear in a `filter` expression and be requested as a facet.   |
| Sortable   | It can appear in `sort`.                                              |

Filterable and sortable attributes are configured per tenant when Discovery is provisioned, because indexing every attribute for filtering costs storage and slows writes. Which ones are enabled on your indexes is a provisioning decision, so confirm it with your Omneo account manager rather than assuming.

Each index also has a primary key that uniquely identifies a document. On the standard indexes this is `id`, carrying the Omneo ID of the underlying record.

## Discovering what an index holds

Two calls tell you most of what you need.

Run an empty search to see the shape of a document:

```json theme={null}
{ "q": "", "limit": 1 }
```

Then request an attribute as a facet to see the values it can take, and confirm it is filterable at the same time. A `400` means the attribute is not filterable on this index.

```json theme={null}
{ "q": "", "facets": ["status"], "limit": 0 }
```

## The `profiles` index

Holds one document per [Profile](/concepts/profiles/overview). This is the index behind staff profile lookup in Clienteling and behind any customer search box you build.

| Attribute                  | Description                                                                                                                                 |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`                       | Omneo Profile ID. Primary key.                                                                                                              |
| `first_name`               | Given name.                                                                                                                                 |
| `last_name`                | Family name.                                                                                                                                |
| `full_name`                | Full name. Also available as `fullName`.                                                                                                    |
| `email`                    | Email address.                                                                                                                              |
| `mobile_phone`             | Mobile number in international format.                                                                                                      |
| `mobile_phone_national`    | Mobile number in national format.                                                                                                           |
| `secondary_phone`          | Secondary contact number in international format.                                                                                           |
| `secondary_phone_national` | Secondary contact number in national format.                                                                                                |
| `identifiers`              | Array of every [Identity](/concepts/profiles/identities) identifier on the Profile, such as loyalty card numbers and external customer IDs. |
| `primary_identity`         | The identifier of the Profile's primary Identity.                                                                                           |
| `statuses`                 | Array of the Profile's [statuses](/concepts/profiles/tags-and-statuses).                                                                    |
| `preferred_location_id`    | ID of the Profile's preferred [Location](/concepts/commerce/locations).                                                                     |
| `joined_location_id`       | ID of the Location the Profile joined at.                                                                                                   |
| `created_at`               | When the Profile was created.                                                                                                               |
| `updated_at`               | When the Profile was last updated.                                                                                                          |

Searching a phone number or a loyalty card number works because `identifiers` and the phone attributes are searchable, so a single `q` covers name, email, phone, and card number without the caller deciding which one the user typed.

## The `products` index

Holds one document per [Product](/concepts/commerce/products).

| Attribute       | Description                                        |
| --------------- | -------------------------------------------------- |
| `id`            | Omneo Product ID. Primary key.                     |
| `title`         | Product title.                                     |
| `handle`        | Product handle.                                    |
| `brand`         | Brand name.                                        |
| `status`        | Product status.                                    |
| `external_id`   | ID of the product in the source commerce platform. |
| `variants`      | Array of the product's variants.                   |
| `images`        | Array of the product's images.                     |
| `tags`          | Array of the product's tags.                       |
| `custom_fields` | The product's custom fields.                       |
| `web_url`       | Storefront URL for the product.                    |
| `created_at`    | When the Product was created.                      |
| `updated_at`    | When the Product was last updated.                 |

## Other indexes

Two further indexes can be enabled on request. They are not part of a standard deployment.

### `locations`

One document per [Location](/concepts/commerce/locations), with `id`, `name`, `handle`, `type`, `external_id`, `external_code`, `is_published`, `is_permanently_closed`, `phone`, `email`, `timezone`, `tags`, and the address broken out as `address_line_1`, `suburb`, `state`, `postcode`, and `country`.

Locations also carry a `_geo` attribute holding `lat` and `lng`, which makes distance filtering and sorting available for store locators:

```json theme={null}
{
  "q": "",
  "filter": "_geoRadius(-33.8688, 151.2093, 10000)",
  "sort": ["_geoPoint(-33.8688, 151.2093):asc"]
}
```

The radius is in metres, and `_geoPoint` sorting returns nearest first.

### `product-lists`

One document per [Product List](/concepts/lists/overview), with `id`, `name`, `handle`, `item_count`, `items`, the owning `profile_id` alongside that Profile's `first_name`, `last_name`, and `email`, the [List Definition](/concepts/lists/list-definitions) as `definition_id`, `definition_name`, and `definition_handle`, plus `location_id`, `location_name`, `staff_id`, and `staff_full_name`.

## Custom attributes

The attributes written into an index are set by a mapping configured during provisioning. If your application needs an attribute that is not in the tables above, or needs one reshaped, ask your Omneo account manager to have the mapping changed.

<Warning>
  A mapping change must be agreed before an index is populated. Changing which attribute supplies the primary key after documents exist can overwrite unrelated records, because a document is identified by that key alone.
</Warning>

## Related

* [Running a search](/dev-guides/discovery/searching)
* [Minting search tokens](/dev-guides/discovery/search-tokens)
* [Schools index](/dev-guides/discovery/schools-index)
* [Profiles](/concepts/profiles/overview)
* [Products](/concepts/commerce/products)
