Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/GuancheData/stage_3/llms.txt

Use this file to discover all available pages before exploring further.

The rebuild endpoint initiates a coordinated full reindex of all books across every node in the indexing cluster. It is intended for disaster recovery, after data corruption, or when index consistency needs to be fully restored from source data on disk. The HTTP call returns quickly, but the rebuild itself runs asynchronously and can take up to one hour to complete across all nodes.
This operation clears all distributed index state — the inverted index, book metadata, and the indexing registry — before re-indexing from disk. Any books that are not present on the local filesystem of at least one node will not be re-indexed. Do not trigger a rebuild unless you intend to fully reset index data.

Parameters

This endpoint takes no path parameters, query parameters, or request body.

Rebuild flow

1

Pause ingestion

The coordinating node publishes an INGESTION_PAUSE message to the ActiveMQ ingestion.control topic. This signals all ingestion nodes to stop adding new documents until the rebuild completes.
2

Broadcast rebuild command

CoordinateRebuild publishes a {"epoch": <timestampMs>} JSON message to the ActiveMQ topic index.rebuild.command. All indexing nodes receive this message via their RebuildMessageListener subscription.
3

Clear distributed state

Each node clears its portion of the distributed maps: "inverted-index", "bookMetadata", and the "indexingRegistry" ISet.
4

Re-index from filesystem

Each node reads every book file from its local filesystem and re-indexes it from scratch, rebuilding all index structures.
5

Resume ingestion

Once all nodes report completion, the coordinator publishes INGESTION_RESUME to the ingestion.control topic and normal ingestion resumes.
The HTTP call returns as soon as the rebuild has been initiated — before any node has finished re-indexing. The actual rebuild continues in the background. Search results may be incomplete or unavailable during the rebuild window.
The maximum time allowed for all nodes to complete rebuilding is one hour. If a node does not finish within this timeout, the coordinator proceeds with resuming ingestion regardless.

Request

curl -X POST http://localhost:7002/index/rebuild

Response

HTTP 200 — rebuild initiated

{
  "status": "success",
  "message": "Rebuild initiated successfully"
}

HTTP 500 — error starting rebuild

{
  "status": "error",
  "message": "Failed to coordinate rebuild"
}

Build docs developers (and LLMs) love