« 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/clientSearch.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/static/clientSearch.js')
-rw-r--r--src/static/clientSearch.js45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/static/clientSearch.js b/src/static/clientSearch.js
deleted file mode 100644
index a10d3855..00000000
--- a/src/static/clientSearch.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/* eslint-env browser */
-
-async function initSearch() {
-  const {FlexSearch} = window;
-
-  // Copied directly from server search.js
-  window.indexes = {
-    albums: new FlexSearch.Document({
-      id: "reference",
-      index: ["name", "groups"],
-    }),
-
-    tracks: new FlexSearch.Document({
-      id: "reference",
-      index: ["track", "album", "artists", "directory", "additionalNames"],
-    }),
-
-    artists: new FlexSearch.Document({
-      id: "reference",
-      index: ["names"],
-    }),
-  };
-
-  const searchData =
-    await fetch('/search-data/index.json')
-      .then(resp => resp.json());
-
-  for (const [indexName, indexData] of Object.entries(searchData)) {
-    for (const [key, value] of Object.entries(indexData)) {
-      window.indexes[index_key].import(key, value);
-    }
-  }
-}
-
-function searchAll(query, options = {}) {
-  const results = {};
-
-  for (const [indexName, index] of Object.entries(window.indexes)) {
-    results[indexName] = index.search(query, options);
-  }
-
-  return results;
-}
-
-document.addEventListener('DOMContentLoaded', initSearch);