mirror of
https://github.com/owncloud/ocis
synced 2026-04-25 17:25:21 +02:00
Replace the per-file Search() call in IndexSpace with a direct Lookup() using Bleve's DocIDQuery. The old approach parsed a KQL query string, compiled it, and ran a full-text search for each file — taking 600-950ms per file on large indexes. The new approach does an O(1) document lookup by ID and compares mtime/Extracted fields in memory. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
591 B
591 B
Bugfix: Use O(1) document lookup instead of full search during reindexing
The IndexSpace bulk reindexer was using a full KQL search query per file
to check whether re-extraction was needed. On large indexes this query
took 600–950ms each, making a 61,000-file space take ~13.5 hours just to
walk. Replaced the per-file Search() call with an O(1) Lookup() using
Bleve's DocIDQuery, then comparing mtime and extraction status in memory.
This reduces per-file check time from ~800ms to <1ms.
https://github.com/owncloud/ocis/pull/12096 https://github.com/owncloud/ocis/issues/12093