# AI indexes

Index field values to help agents match abbreviations in questions to actual data.

使用指南 · 模块: data · 使用者 · 部署形态：资料未说明 · 已确认产品版本：资料未说明 · 来源：现有文档

Users ask questions with abbreviations and everyday language, while databases store full names. An AI index turns a column's distinct values into a searchable table, so “Mate 40” in a question can match the actual database value “HUAWEI Mate 40 Pro 5G”.

This is useful only for string fields. Enable it only when needed: building indexes takes time, and each data source has a limit on indexed fields.

## Before you start

| Item         | Requirement                                                                                                                                             |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Permissions  | Project owner or administrator                                                                                                                          |
| Prerequisite | The data source is available; self-hosted deployments must deploy aisearch first. See [Deploy AI search](https://docs.asktable.com/en/deploy/ai-search) |
| Entry point  | Main navigation on the left → “More” → “Data sources” → open a data source card → select a table in the left tree                                       |

## Steps

**Enable indexing for a field**

The “Field structure” table has no index column. Click a field row to expand its detail panel. The AI index switch is at the top left, with a note explaining that enabling it builds an index from the column's values to improve answer accuracy.

After enabling the switch, a status icon appears to its right.

**Check the status icon**

There are two icons:

| Icon            | Meaning            |
| --------------- | ------------------ |
| Green checkmark | Indexing succeeded |
| Red cross       | Indexing failed    |

Click the icon to open “AI index details”.

**Inspect index details**

The “AI index details” dialog lists:

- Field name
- Status: success or failure
- Total record count
- Indexed value count
- Distinct value count

On success, the bottom explains how many distinct values the field contains and that it meets AI indexing requirements. On failure, it explains that the field is outside the supported range and gives the specific rejection reason.

**Rebuild indexes for the whole source (optional)**

After changing the selected fields or making major data changes, click “Settings” in the data source header, then the button on the “Build Value Index” row under “Index maintenance”.

The system selects fields again for indexing. A notification confirms that building has started, and the new indexes take effect automatically when complete. The button is disabled when the data source is unavailable.

The same section has “Rebuild Embedding”, which fills in missing field semantic vectors. This is separate from value indexing.

## Key constraints

| Item                            | Value or default                                                                                        | Where to change it                                                                           |
| ------------------------------- | ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| Indexed field types             | Strings (varchar / string / char); long text, dates, and numbers are not indexed                        | —                                                                                            |
| Value-indexed fields per source | 10 by default; whole-source builds stop at the limit                                                    | Avatar menu → “Settings” → “Data sources” → Value index field limit                          |
| Distinct values per field       | 50000 by default; exceeding this makes indexing fail with a distinct-count limit reason                 | Avatar menu → “Settings” → “Data sources” → Unique value index limit per field               |
| Average field length            | Maximum 196 bytes; exceeding this makes indexing fail with an average-length limit reason               | —                                                                                            |
| Individual value length         | Values longer than 256 characters are not indexed                                                       | —                                                                                            |
| Numeric and date values         | Not indexed                                                                                             | —                                                                                            |
| Whole-source build prerequisite | Data source must be available                                                                           | “Settings” → “Index maintenance”                                                             |
| Self-hosting prerequisite       | Configure AISEARCH\_HOST and AISEARCH\_MASTER\_KEY; AISEARCH\_MASTER\_KEY must match MEILI\_MASTER\_KEY | Deployment parameters; see [Deploy AI search](https://docs.asktable.com/en/deploy/ai-search) |
| Enterprise edition              | Without authorization, enabling the switch is rejected with an Enterprise requirement message           | Contact an administrator to upgrade                                                          |

These values are defaults and can be adjusted in the administration console.

## Troubleshooting

| Symptom                            | How to identify it                                                    | What to do                                                                                                                            |
| ---------------------------------- | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| Red cross after enabling           | “AI index details” shows failure and a rejection reason at the bottom | If distinct values exceed the limit, choose a lower-cardinality field; if average length exceeds the limit, choose a short-text field |
| Immediate error when enabling      | Enterprise edition is required                                        | Upgrade to Enterprise                                                                                                                 |
| Enabling does not succeed          | aisearch has not been deployed in the self-hosted environment         | Configure the two environment variables in [Deploy AI search](https://docs.asktable.com/en/deploy/ai-search), then restart            |
| “Build Value Index” is disabled    | Data source is not available                                          | Wait for metadata synchronization or resolve the synchronization failure first                                                        |
| Indexed value count is 0           | Details show 0 indexed values                                         | The column has no indexable values: all are numbers, dates, or overly long text; choose another field                                 |
| Abbreviations still do not match   | AI indexing is off for the target field                               | Enable it; if the field limit is reached, disable unused fields first                                                                 |
| Build does not seem to take effect | Building has started, but detail values have not changed              | Building runs in the background; wait for completion. The page refreshes status automatically                                         |

## Next steps

- Indexes supplement descriptions; field meaning still needs explanations: [Table and field descriptions](https://docs.asktable.com/en/data/semantics)
- Hide or mask sensitive columns first: [Field hiding and masking](https://docs.asktable.com/en/data/hidden-fields)
- Enable this capability when self-hosting: [Deploy AI search](https://docs.asktable.com/en/deploy/ai-search)
- Try a question with an abbreviation: [Conversations](https://docs.asktable.com/en/conversation)
