-
-
Notifications
You must be signed in to change notification settings - Fork 69
Description
Issue
I've noticed that some of my search results aren't appearing in the spotlight search results. They're actually returned as dependencyQueryResults, which can be confirmed in alpinejs devtools, but they don't make it through Fuse to appear in the spotlight result list. By default, Fuse places importance on the beginning of the field that is being searched. Since the match is towards the end of the searched string, it is being ignored.
Example
String being searched: "TTU/JH COMM COLLEGE DESIGN CATALOG SAMPLES O# 492026578-7,8,9"
if my input search query is "492026578", this result doesn't make it to the result list. It IS however, part of the query results, but Fuse skips over it because the query string is at the end of the searched string.
Solution
Provide a way to customize the Fuse fuzzy matching options like location, distance, ignoreLocation, and threshold.
If I manually edit the spotlight.js file and set ignoreLocation to true, then the result shows on the page as expected.
I could attempt a PR, but may take a while.
I understand if you don't want to start tying your package down to the Fuse fuzzy search implementation, but maybe there's a way to add options that can be translated to those Fuse options. Then again, you may not want spotlight to be concerned with that stuff at all. If so, I understand.
Thanks for this great component.