Skip to main content

Module admin

Module admin 

Source
Expand description

POST /api/search/reindex — rebuilding one tenant’s index by hand.

The index maintains itself: every write path asks for the object it just wrote to be re-indexed, and crate::reindex sweeps weekly and on startup. This exists for the cases where waiting is not acceptable — an owner who suspects a write path forgot its search_index_object call and wants the answer now rather than on Sunday.

Gated by require_leader in cloudillo/src/routes/protected.rs: rebuilding your own tenant’s index is an ordinary owner operation, but a sweep re-reads every file, profile and action of that tenant, which is not something an ordinary member should be able to start. The scope is always the calling tenant — the whole-node sweep (crate::reindex::ReindexScope::All) is reachable only from the weekly recurring task, never from a request.

The 202 only says the sweep was scheduled. The outcome arrives separately, as a SEARCH_REINDEX_DONE message broadcast to the tenant’s WebSocket bus connections when the sweep ends — see crate::reindex.

Structs§

ReindexResponse

Functions§

post_reindex
POST /api/search/reindex — rebuild the calling tenant’s full-text index.