npmsearch
npmsearch copied to clipboard
Searching titles as phrases
A lot of modules have really blunt and simple names that describe exactly the problem the user is trying to solve. Currently this tool doesn't really help us find those modules.
e.g. Try searching "point in polygon", and you get a lot of scattered/unrelated modules. The following two should be up at the very top, but they are very far down:
https://www.npmjs.org/package/point-in-polygon https://www.npmjs.org/package/robust-point-in-polygon
Other examples which will fail on common searches:
https://www.npmjs.org/package/is-undo-redo https://www.npmjs.org/package/parse-svg-path https://www.npmjs.org/package/get-image-pixels
Maybe just joining search with dashes and if it matches (or almost matches) a title, promote that a bit better.
I completely agree with you, these sorts of queries should be highly focused. The issue with your suggestion is mixing the queries will compute the same result.
For example, if we just do (point in polygon) OR point-in-polygon all of the results will be collected and sorted by rating. Resulting in the original problem.
simply quoting the input string seems to work way better, at least in terms of pruning down the result set to more expected results (in my limited testing)

and

perhaps this is a good way to do a sort of "optimal" package listing at the head of the results. I'll need to give this a bit more thought before committing to a direction. Open to suggestions!