Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] visually distinguish search results between exact match and soft match #475

Open
gravistech412 opened this issue Mar 27, 2024 · 6 comments

Comments

@gravistech412
Copy link

I search using the FF ext lots. It would be nice to visually distinguish between the exact string results and soft matches. I think something simple like a slight background color would suffice.

@perry-mitchell
Copy link
Member

How would you define a weak/strong match in this sense? When searching everything is treated the same. The only difference I can think of is the URL-based results vs the user search term results.

Search by term works by checking several fields in the entry - all of its properties - but all searching is done more or less automatically internally using a search library that fuzzy matches against all of the properties.

@gravistech412
Copy link
Author

Can you point me to the library used to fuzzy match?

@perry-mitchell
Copy link
Member

@gravistech412 It's fuse.js

@gravistech412
Copy link
Author

gravistech412 commented Apr 2, 2024

GPT cause I don't know fuse.js
https://www.fusejs.io/api/options.html#includescore
To get Fuse.js to return results along with information about how close each match was, you can use the includeScore option. When set to true, this option includes a score with each search result, where the score is a number between 0 and 1 that indicates how well each result matches the search query. A score of 0 indicates a perfect match, and the score gets closer to 1 as the match becomes less exact.

You can then use this score to provide feedback about how close each match was to the original query.

@perry-mitchell
Copy link
Member

I like the idea. Let's see about the design. Either some kind of icon/indicator or something similar might work.

@gravistech412
Copy link
Author

I just think a color distinction. Maybe a different background color for exact matches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants