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

Filter Files to Index

Restrict an index to a subset of your workspace files.


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. For details, see Edit an Index. Changing the filter does not re-index files that were already indexed.

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 /.

To clear the filter, open the Settings tab of the disabled index and clear the Prefixes field in the File Name Prefix Filter section.

Set or Clear Filters with the API​

To set or clear the prefix filter

with the REST API, see Filter Files to Index with the REST API.