« get me outta code hell

search: allow passing options into makeSearchIndexes - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-05-02 14:17:53 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-05-31 12:11:48 -0300
commit4c068743b70f85159821ac0b739cc50840a59ee7 (patch)
tree3c1cdb0ebab15afc0ded87494c361334fe66398d
parent04a683494b762f6fc6ed8a237874d2009ba5bee1 (diff)
search: allow passing options into makeSearchIndexes
-rw-r--r--src/util/searchSchema.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/util/searchSchema.js b/src/util/searchSchema.js
index d4e1a8c0..dffd1c1f 100644
--- a/src/util/searchSchema.js
+++ b/src/util/searchSchema.js
@@ -1,10 +1,11 @@
 // Index structures shared by client and server.
 
-export function makeSearchIndexes(FlexSearch) {
-  const doc = config =>
+export function makeSearchIndexes(FlexSearch, documentOptions = {}) {
+  const doc = documentSchema =>
     new FlexSearch.Document({
       id: 'reference',
-      ...config,
+      ...documentOptions,
+      ...documentSchema,
     });
 
   const indexes = {