Reference
db.set_rabitq_rerank
Change the rerank factor of a RaBitQ database.
db.set_rabitq_rerank(rerank: int) -> NoneParameters
Section titled “Parameters”- rerank : int
Candidates per result rescored against the full vectors.
0turns rerank off and returns estimated scores.
Returns
Section titled “Returns”None. Later searches use the new factor.
Raises
Section titled “Raises”- ValueError
The database is not in RaBitQ mode, or
rerankis above 1 000 000.
- Higher values give higher recall and slower searches. The setting is recorded by the next
save(). - Thread safety: a database object is safe to share between threads. This method releases the GIL and takes the write lock, so it waits for running searches.
Examples
Section titled “Examples”import srvdb
db = srvdb.create("./vectors", dimension=128, index="rabitq", bits=1)db.set_rabitq_rerank(80)db.set_rabitq_rerank(0)print("ok")# okSee also
Section titled “See also”srvdb.create: Create a new database with its index and options.
Was this page helpful? Tell us in Discussions.