Performance: resolve index-write permissions and effective content in bulk (#13869)

* fix(search): resolve index-write permissions and effective content in bulk

Add WriteBatch.add_or_update_ids() and use it in bulk_update_documents
and trash restore, cutting index writes from ~8 queries per document
to a constant handful per batch

* Always these new ones with xdist, try a better condition
This commit is contained in:
Trenton H
2026-09-07 14:43:13 -07:00
committed by GitHub
parent d52cc1b609
commit f5ff18326d
4 changed files with 233 additions and 5 deletions
+1 -2
View File
@@ -5469,8 +5469,7 @@ class TrashView(ListModelMixin, PassUserMixin):
from documents.search import get_backend
with get_backend().batch_update() as batch:
for doc in restored:
batch.add_or_update(doc)
batch.add_or_update_ids([doc.pk for doc in restored])
elif action == "empty":
if doc_ids is None:
doc_ids = [doc.id for doc in docs]