chore: search cleanup
This commit is contained in:
parent
2cd835d31b
commit
55286f8c3b
3 changed files with 7 additions and 8 deletions
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "coryd.dev",
|
||||
"version": "1.5.10",
|
||||
"version": "1.5.11",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "coryd.dev",
|
||||
"version": "1.5.10",
|
||||
"version": "1.5.11",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@cdransf/api-text": "^1.5.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "coryd.dev",
|
||||
"version": "1.5.10",
|
||||
"version": "1.5.11",
|
||||
"description": "The source for my personal site. Built using 11ty (and other tools).",
|
||||
"type": "module",
|
||||
"engines": {
|
||||
|
|
|
@ -109,9 +109,8 @@ window.addEventListener("load", () => {
|
|||
searchOptions: {
|
||||
fields: ["title", "tags"],
|
||||
prefix: true,
|
||||
fuzzy: 0,
|
||||
boost: { title: 2, tags: 1.5 },
|
||||
sort: (a, b) => b.score - a.score,
|
||||
fuzzy: 0.1,
|
||||
boost: { title: 3, tags: 1.5 },
|
||||
},
|
||||
});
|
||||
const $form = document.querySelector(".search__form");
|
||||
|
@ -214,7 +213,7 @@ window.addEventListener("load", () => {
|
|||
|
||||
try {
|
||||
const response = await fetch(
|
||||
`https://coryd.dev/api/search?q=${query}&type=${typeQuery}&page=${page}&pageSize=${PAGE_SIZE}`
|
||||
`https://localhost:8787/api/search?q=${query}&type=${typeQuery}&page=${page}&pageSize=${PAGE_SIZE}`
|
||||
);
|
||||
const index = await response.json();
|
||||
const results = index.results || [];
|
||||
|
@ -297,4 +296,4 @@ window.addEventListener("load", () => {
|
|||
updateSearchResults(nextResults);
|
||||
});
|
||||
})();
|
||||
});
|
||||
});
|
Reference in a new issue