npms-io / npms-analyzer

The analyzer behind https://npms.io
MIT License
319 stars 38 forks source link

exact-name matching boost should apply to scoped modules as well #174

Open isaacs opened 7 years ago

isaacs commented 7 years ago

Scroll up for through twitter conversation here: https://twitter.com/izs/status/905120512879165440

If searching for foo-bar, a module named exactly "foo-bar" will rank higher than "@username/foo-bar", even if it is lower quality. This is surprising to users who think of the bit after the / as the "name" portion of a scoped module.

Suggestion: apply exact-name boost if the bit after the / in the name matches the search string exactly.

cc @rgrove @brianleroux

satazor commented 7 years ago

It sounds like a bug, will need to investigate. Will post updates here.

adrianpraja commented 6 years ago

+1

another example search term: dynamodb returns a package with a score of 16

when:

exact-name matching receives too much boost that wipes the value in scoring

satazor commented 6 years ago

@isaacs doing what you suggest has one possible side-effect that can be exploited: users can create dummy packages, e.g.: @my-user/react, and take advantage of this in order to just mess around with the top results for certain searches. Do you have any idea how can we get around this?