npmsearch icon indicating copy to clipboard operation
npmsearch copied to clipboard

Searching titles as phrases

Open mattdesl opened this issue 11 years ago • 2 comments

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.

mattdesl avatar Nov 12 '14 17:11 mattdesl

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)

2014-12-30_14h04_15

and

2014-12-30_15h19_43

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!

tmpvar avatar Dec 30 '14 23:12 tmpvar

Maybe an instant answers approach, sort of like DuckDuckGo displays for possible meanings, wikipedia entries, and github repos.


And here's a great test case - "react" (there are currently 35-36 entries before the actual "react" entry)

metasean avatar Jun 29 '16 00:06 metasean