From 4c068743b70f85159821ac0b739cc50840a59ee7 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Thu, 2 May 2024 14:17:53 -0300 Subject: search: allow passing options into makeSearchIndexes --- src/util/searchSchema.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') 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 = { -- cgit 1.3.0-6-gf8a5