From 7f8445b138cc323555c3d4aedd78a47a02dc7c5f Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Sun, 31 May 2020 22:22:09 +0200 Subject: [PATCH] Create index for fuse --- editor/src/fuse.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/editor/src/fuse.js b/editor/src/fuse.js index c705b38..7343c52 100644 --- a/editor/src/fuse.js +++ b/editor/src/fuse.js @@ -7,7 +7,9 @@ function createTitleSearch() { const options = { keys: ['title'], } - let fuse = new Fuse(documents, options) + + const fuseIndex = Fuse.createIndex(options.keys, documents) + let fuse = new Fuse(documents, options, fuseIndex) resolve({ documents,