Compare commits

..

2 Commits

Author SHA1 Message Date
Akbar Rahman
fa8840d25e
Update indexsearch.js 2024-11-13 12:14:19 +00:00
Akbar Rahman
07ece47980
fix indexsearch.js using wrong variable 2024-11-13 12:13:40 +00:00

View File

@ -6,7 +6,7 @@ const TITLE = "title"
const SEARCH_TIMEOUT_MS = 100 const SEARCH_TIMEOUT_MS = 100
var SEARCH_TIMEOUT_ID = -1 var SEARCH_TIMEOUT_ID = -1
const fuse = new Fuse(data, { const fuse = new Fuse(search_data, {
keys: [ 'title' ], keys: [ 'title' ],
ignoreLocation: true, ignoreLocation: true,
threshhold: 0.4, threshhold: 0.4,
@ -30,7 +30,7 @@ function updateResults() {
console.log("updating results") console.log("updating results")
resultsDiv.innerHTML = '' resultsDiv.innerHTML = ''
if (searchBar.value) results = fuse.search(searchBar.value, { limit: RESULTS_MAX }).map(r => r.item) if (searchBar.value) results = fuse.search(searchBar.value, { limit: RESULTS_MAX }).map(r => r.item)
else results = data else results = search_data
results.forEach(r => { results.forEach(r => {
wrapper = document.createElement('li') wrapper = document.createElement('li')