Skip to content

Commit efdec8b

Browse files
committed
perf(search): Prevent loading the text index if already populated
1 parent a2ddd98 commit efdec8b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

frontend/src/lib/components/search/search.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,10 @@ export function load({
321321

322322
searchEngine.itemsEngine = itemsjs(processedCorpus, searchConfig);
323323

324+
if (searchEngine.flexIndex?.reg?.size > 0) {
325+
return;
326+
}
327+
324328
const aggregationKeys = Object.keys(searchConfig.aggregations);
325329

326330
for (const item of processedCorpus) {

0 commit comments

Comments
 (0)