diff options
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 |
commit | 4c068743b70f85159821ac0b739cc50840a59ee7 (patch) | |
tree | 3c1cdb0ebab15afc0ded87494c361334fe66398d /src | |
parent | 04a683494b762f6fc6ed8a237874d2009ba5bee1 (diff) |
search: allow passing options into makeSearchIndexes
Diffstat (limited to 'src')
-rw-r--r-- | src/util/searchSchema.js | 7 |
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 = { |