« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/static/js
diff options
context:
space:
mode:
Diffstat (limited to 'src/static/js')
-rw-r--r--src/static/js/client.js21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/static/js/client.js b/src/static/js/client.js
index 075448a8..650a3925 100644
--- a/src/static/js/client.js
+++ b/src/static/js/client.js
@@ -7,6 +7,9 @@
 
 import {accumulateSum, atOffset, empty, filterMultipleArrays, stitchArrays}
   from '../shared-util/sugar.js';
+
+import FlexSearch from '../lib/flexsearch/flexsearch.bundle.module.min.js';
+
 import {fetchWithProgress} from './xhr-util.js';
 
 const clientInfo = window.hsmusicClientInfo = Object.create(null);
@@ -3419,25 +3422,9 @@ clientSteps.addPageListeners.push(addArtistExternalLinkTooltipPageListeners);
 // Internal search functionality --------------------------
 
 async function initSearch() {
-  const {FlexSearch} = window;
 
   // Copied directly from server search.js
-  const indexes = {
-    albums: new FlexSearch.Document({
-      id: "reference",
-      index: ["name", "groups"],
-    }),
-
-    tracks: new FlexSearch.Document({
-      id: "reference",
-      index: ["name", "album", "artists", "directory", "additionalNames"],
-    }),
-
-    artists: new FlexSearch.Document({
-      id: "reference",
-      index: ["names"],
-    }),
-  };
+  const indexes = makeSearchIndexes(FlexSearch);
 
   window.indexes = indexes;