Files
ocis/changelog/unreleased/fix-search-indexspace-docid-lookup.md
Paul Faure eb357f820d perf(search): use O(1) DocID lookup instead of full search in IndexSpace
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>
2026-03-12 07:45:15 +01:00

591 B
Raw Permalink Blame History

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 600950ms 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