INNER CODE UNIT · Python
_load_bm25_startup_tenant_ids
skygazer42/MimirQ · app/main.py:325
def _load_bm25_startup_tenant_ids(db: Session) -> list[object]:
tenant_ids: list[object] = []
tenant_q = (
db.query(DocumentChunk.tenant_id)
.join(DBDocument)
.filter(DBDocument.status == "completed")
.filter(DBDocument.publication_status == "published")
.distinct()
.execution_options(stream_results=True)
.enable_eagerloads(False)
)
for row in tenant_q.yield_per(2000):
if row and row[0]:
tenant_ids.append(row[0])
return tenant_ids
def _build_bm25_startup_indexes() -> None: