Rebuild a search index
POST/pipelines/:pipeline_id/search-indexers/:indexer_id/rebuild
Rebuilds the database indexes of a search index in the background, one after the other, with a concurrent reindex. Searches and document processing continue on the existing copy of each database index during the rebuild. A rebuild reclaims the space that the entries of deleted and replaced fragments occupy, and improves a vector index that was first built on few fragments. The request has no body.
The response returns as soon as the rebuild starts. While the rebuild runs, the rebuild field of the search index reports the database index, the phase and the progress, and the rebuild is complete when rebuild is null. Only one rebuild or distance index build runs on a search index at a time.
Permissions. Write on the pipeline.
Rebuild shows the request.
Request
Responses
- 202
- 400
- 401
- 404
- 409
The rebuild started. The body holds the identifier of the search index and the names of the database indexes that the rebuild replaces.
The search index has no database index to rebuild, such as a vector index without a distance index (Invalid parameter, with Search indexer <id> has no database indexes to rebuild in details.error).
The authentication headers are missing or invalid, or the API key is inactive or expired. Errors lists the messages.
No pipeline with this identifier exists or the key lacks write permission on the pipeline (Pipeline with id <id> not found), or the pipeline has no search index with this identifier (Search Indexer with id <id> not found).
A rebuild or a distance index build is running on the search index (Conflict, with The indexes of search indexer <id> are already being built or rebuilt in details.error).