chore: search cleanup
This commit is contained in:
parent
be2d74bfd7
commit
71eaab3a36
3 changed files with 19 additions and 4 deletions
|
@ -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);
|
||||
});
|
||||
})();
|
||||
});
|
||||
});
|
||||
|
|
Reference in a new issue