Skip to main content
For the complete documentation index for agents and LLMs, see llms.txt.

Choose Files to Index

Choose which files your index processes. You can filter files by name prefix

. Only matching files are indexed.


About This Task

By default, an index processes all files in your workspace. You can restrict indexing to a subset of those files:

  • By file name prefix: Index only files whose names start with one of the prefixes you set. For example, legal* matches legal-contract.pdf and legal_memo.docx.

Only files that match your filters are indexed, counted, and listed on the Index Files tab. All other files are skipped.

You can update these filters only while the index is disabled. Disable the index first, then change the filters. Changing the filter does not re-index files that were already indexed.

Prerequisites

  • A disabled index. If the index is enabled, disable it before you change filters.

Set a File Name Prefix Filter

  1. In Haystack Enterprise Platform, go to Indexes and click the index you want to configure. This opens the Index in Builder.
  2. Open the Settings tab.
  3. In the File Name Prefix Filter section, type one or more prefixes in the Prefixes field.
    • Separate multiple prefixes with commas. A file is indexed if its name matches any of the prefixes.
    • You can end a prefix with * as a wildcard, for example doc* or contracts/.
    • Each prefix can include letters, digits, ., _, -, and /.

Clear the File Name Prefix Filter

  1. Open the Settings tab for the disabled index.
  2. Clear the Prefixes field in the File Name Prefix Filter section.

Set a File Name Prefix Filter with the API

Use the Update Index endpoint to set or clear the prefix filter.

Pass a comma-separated list of prefixes in file_name_prefix_filter. A file is indexed if its name starts with any of the prefixes. The trailing * is optional: docs/ and docs/* both match names that start with docs/.

To remove the prefix filter, set file_name_prefix_filter to null.

Example: Index files whose names start with legal or contracts/

PATCH /api/v1/workspaces/{workspace_name}/indexes/{index_name}

{
"file_name_prefix_filter": "legal*,contracts/"
}

What To Do Next

After you update the filters, enable the index so it applies the new conditions to incoming files.