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

Indexes

Indexes preprocess your files and store them in a document store of your choice. You can reuse indexes across your query pipelines.


What's an Index​

An index is a data structure that provides your pipelines with fast, efficient access to your large-scale datasets. Think of it as a book index that helps you find topics without reading the entire book.

How Indexes Work​

Indexes work on the files uploaded to Haystack Enterprise Platform. Indexes use configurable components connected together with each one performing a single task on your files, such as conversion, cleaning, or splitting. They clean the files and chunk them into smaller passages called documents. Then, they write the cleaned documents in a database called document store from which the pipeline retrieves them at query time.

Indexes are optional, meaning that if you have a query pipeline that queries files in an existing database, like Snowflake, or uses the model's knowledge, you don't need an index.

Indexes are specific to a workspace. Deleting a workspace deletes all the indexes in this workspace.

Indexing​

The files in Haystack Enterprise Platform are indexed once when an index is enabled. New files uploaded after you enable an index are indexed individually and added to the enabled index. For details on how changes to files are processed, see File Updates in Indexes.

To see how an index converted and split a specific file, reindex the file with an indexing trace. For details, see Capture an Indexing Trace When Reindexing a File.

If the Files tab lists a file more than once, the file is still indexed only once. Several of its documents share split_id 0, which repeats the entry. To show it once, see Why a File Appears More Than Once.

Core and Integration Indexes​

A document store is where your index writes the data and where your pipelines access it. Core indexes write files into the OpenSearchDocumentStore, which is the core document store of Haystack Enterprise Platform. This means Haystack Platform manages its infrastructure, authorization, and has access to the indexing information.

Integration indexes use one of the integrated document stores, such as Pinecone, Weaviate, or others. For these document stores, you must manage the infrastructure yourself. Haystack Enterprise Platform also doesn't have access to the indexing information. For details, see Document Stores.

Indexes and Pipelines​

To run searches on files in Haystack Enterprise Platform, a pipeline must be connected to an index. You do this by adding a document store to a query pipeline and choosing the index you want this document store to use.

The document store card with an index selected

Multiple pipelines can use a single index; one pipeline can use multiple indexes. An index must be enabled to be used in a query pipeline.

To use multiple indexes in a single query pipeline, create a separate document store for each index. Then, assign a retriever to each document store, since a retriever can only be connected to one document store at a time.

Building Indexes​

Haystack Enterprise Platform provides curated index templates for various file types. You can use one of them or start from scratch.

Indexes are built the same way as query pipelines. You drag components to the canvas in Pipeline Builder and connect them so that the output of the preceding component matches the input type of the next component. For details, check How do pipelines work in Pipelines.

Input​

Indexes always start with an Input component. When in Builder, add the Input component at the beginning of an index.

The FilesInput component from the Inputs group in Builder added as the first component of an index

Outputs​

Indexes return a list of Document objects, usually written into the document store by the DocumentWriter component, which is often the last component in an index.

Body​

The index body defines how your files are processed. For hints and best practices, see PreProcessing Data with Pipeline Components.

Enabling and Deleting Indexes​

To start indexing, you enable an index from the Indexes page. An enabled index is in view-only mode, so you can't edit it. The exception is the indexing pod size, which you can change while the index is enabled. For details, see Set the Indexing Instance Size. To make changes, you disable the index first. However, you can't disable an index that's used by a deployed pipeline. In this case, you can duplicate the index and update the copy.

To deploy a query pipeline, you must enable all indexes it uses.

You can delete an index you no longer need at any time, even if pipelines still use it. Deleting an index is permanent, and the pipelines that use it lose access to its data. Before you confirm the deletion, Haystack Platform lists the deployed and undeployed pipelines that use the index, so you can see what the deletion affects. References to the index inside agent tools may also stop working, and they aren't listed. If no pipeline uses the index, you only confirm the deletion. For steps, see Delete an Index.

Index Settings​

You change index settings on the Settings tab of the Index Details page.

GPU Acceleration​

Indexes use CPU by default. Turn on GPU support when your index includes components that run better on a GPU, such as DoclingConverter, SentenceTransformersDocumentEmbedder, or custom components that use AI models. If GPU support is off, those components run on the CPU, which can slow down processing and cause timeouts. For details, see Configure Index Settings.

Scaling​

You can set the number of replicas for your index in index settings. This is useful if you want to increase the availability of your index.

Pod Size​

The pod size controls how much compute an index gets when it processes your files. If an index converts large files and runs slowly or runs out of resources, set a larger size with the instance_size field of the index API. The available sizes are small, medium, large, and xl.

The new size applies the next time the index pod is deployed, even if you change it while the index is enabled. For steps, see Set the Indexing Instance Size.

Haystack Version​

By default, an index runs on the Haystack version that Haystack Platform provides. To use a specific haystack-ai version or extra packages, pin them with a top-level dependencies block in the index YAML. For instructions, see Pin a Haystack Version for an Index.