Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @ryyppy, I noticed the discussion about the Package Index recently and took a quick look.
This PR contains a few tweaks that may help, see what you think.
Main change
The current Fuse.js options for
location
anddistance
favour terms near the start of search fields, but I suspect for the Package Index the location of the term is less important. So I've set theignoreLocation
prop totrue
and removedlocation
anddistance
.This small tweak seems to produce reasonable search results. E.g.
zora
andfast
are returning expected results. Plus a spot check of various terms seems to be working well.How does it look to you?
Other changes
[1] Remove
re-schema-form
frompackages_url_resources.json
. It looks like this package is available from npm now. Also fixes a React duplicate key error.[2] Remove duplicates in the keywords field. It looks like at least one npm package has duplicate keywords, so this fixes a React duplicate key error.