From fcc45e386df65c68969391c7b113b6232c76c82a Mon Sep 17 00:00:00 2001 From: Gio Date: Tue, 26 Mar 2024 18:35:21 -0500 Subject: search: tidying, fix client --- src/static/js/client.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/static') diff --git a/src/static/js/client.js b/src/static/js/client.js index 3df0d585..075448a8 100644 --- a/src/static/js/client.js +++ b/src/static/js/client.js @@ -3422,7 +3422,7 @@ async function initSearch() { const {FlexSearch} = window; // Copied directly from server search.js - window.indexes = { + const indexes = { albums: new FlexSearch.Document({ id: "reference", index: ["name", "groups"], @@ -3430,7 +3430,7 @@ async function initSearch() { tracks: new FlexSearch.Document({ id: "reference", - index: ["track", "album", "artists", "directory", "additionalNames"], + index: ["name", "album", "artists", "directory", "additionalNames"], }), artists: new FlexSearch.Document({ @@ -3439,13 +3439,15 @@ async function initSearch() { }), }; + window.indexes = indexes; + 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); + window.indexes[indexName].import(key, value); } } } -- cgit 1.3.0-6-gf8a5