mirror of
https://github.com/suitenumerique/messages.git
synced 2026-09-26 11:44:55 +02:00
The previous implementation indexed each thread and message with individual OpenSearch HTTP calls and triggered N+1 DB queries for accesses, recipients and sender lookups. This rewrites reindex_all to batch documents via opensearchpy.helpers.bulk and prefetch related objects in a single queryset, drastically reducing both DB round-trips and HTTP overhead.