jeffalo/is.wasteof.money

33, 65, 129, 257 etc searches cause fuzzy search issues

Closed this issue · 12 comments

multiples like 33, 65, 129, 257, 513, etc... letter words return a list of all(?) possible similar results.

this appears to be a bug in fuse.js, however it probably could be fixed on our end.

they claim it's been fixed but it doesn't seem like it has.

How about replacing https://github.com/JeffaloBob/is.wasteof.money/blob/9efcaa03543a5071d03c1be583c168567d670f63/index.html#L42-L53 with

 const generateFuseMessage = term => { 
     term = term.toLowerCase(); 
  
     if (term.length < 3) 
         return "Not found yet... keep trying?"; 
      
     const fuseResults = fuse.search(term); 
     if (term.length == 33) fuseResults = [];
     getHtml = item => `<strong><a href=# onclick="fill('${item}')">${item}</strong></a>`; 
     let matched = fuseResults.map(x => getHtml(x.item.name)).join("<br>"); 
  
     return matched? `Did you mean:<br>${matched}`: "Not found yet... keep trying?"; 
 } 

this would prevent any results if the length is 33 characters? i guess this is a hacky fix but i dont think there is a better way...?

this would prevent any results if the length is 33 characters? i guess this is a hacky fix but i dont think there is a better way...?

Yeah, I think it's the best thing to do.

ok i'll add this as soon as i can

@BoomerScratch i added this fix, but it happens again with 65 letter words...

why don't you set it to anything 33 words or above

@BoomerScratch i added this fix, but it happens again with 65 letter words...

Use

<input oninput="check()" spellcheck="false" id="input" type="text" autofocus maxlength="32">

in https://github.com/JeffaloBob/is.wasteof.money/blob/7bfe0521001761dd8fc0e098c3b1ec5f5f5d9f12/index.html#L25 then? (That's what @Nagol12344 means)

it is what I mean

that's just the easiest fix to me

hmm, seems like a kinda hacky fix, we won't be able to have long item names

fixed by updating fuse.js