chore: search cleanup

This commit is contained in:
Cory Dransfeldt 2024-10-19 18:05:39 -07:00
parent be2d74bfd7
commit 71eaab3a36
No known key found for this signature in database
3 changed files with 19 additions and 4 deletions

View file

@ -96,6 +96,21 @@ window.addEventListener("load", () => {
const miniSearch = new MiniSearch({
fields: ["title", "description", "tags", "type"],
idField: "id",
storeFields: [
"id",
"title",
"url",
"description",
"type",
"tags",
"total_plays",
],
searchOptions: {
boost: { title: 2, tags: 1.5 },
prefix: true,
fuzzy: 0.3,
},
});
const $form = document.querySelector(".search__form");
const $input = document.querySelector(".search__form--input");
@ -280,4 +295,4 @@ window.addEventListener("load", () => {
updateSearchResults(nextResults);
});
})();
});
});