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

Fixed search functionality to search entire description, lowered typo threshold #548

Closed
wants to merge 4 commits into from

Conversation

nectarine0
Copy link
Contributor

Before, searching for words like "groceries" would not work properly (e.g. Scotty's Market wouldn't show up). This was due to the fact that the default location distance was 60, so the search for "groceries" would only be performed on the first 60 characters of the Scotty's Market description. This pull request fixes this issue.

Additionally, the previous threshold of 0.3 meant that "Italian" spots on campus would appear in search results looking for "Asian" because of the similarity of "__alian" and "asian." To avoid this, I lowered the fuzzy search threshold to 0.1

Bug fix (non-breaking change which fixes an issue)

Copy link

vercel bot commented Feb 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
cmueats ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 2, 2025 3:44am

@GhostOf0days
Copy link
Member

can you please co-author changes you'll make for this with @cirex-web on #546 to avoid merge conflict?

@cirex-web
Copy link
Contributor

Hi @nectarine0! I've integrated your changes into #546 as the following:

const FUSE_OPTIONS: IFuseOptions<IReadOnlyLocation_FromAPI_PostProcessed> = {
	// keys to perform the search on
	keys: ['name', 'location', 'shortDescription', 'description'],
	ignoreLocation: true,
	threshold: 0.2,
};

Empirically, a threshold of 0.1 doesn't permit any typos while a threshold of .3 results in too many false matches. Open to changes.

If you want, you can close this PR.

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

Successfully merging this pull request may close these issues.

3 participants