npms-io / npms-api

The https://npms.io API
MIT License
189 stars 30 forks source link

Sorting options #32

Closed amilajack closed 8 years ago

amilajack commented 8 years ago

Support for sorting search results by quality or popularity by default would be a nice addition to the noms-api. It will encourage people to make their packages better in order to appear higher in results.

satazor commented 8 years ago

At the moment, sorting is done using a mix of relevance+quality+popularity+maintenance. All these factors are being take into account.

You may specify the weights of each of these factors as query parameters, see: https://github.com/npms-io/npms-api/blob/master/lib/controllers/search.js#L32. Default values are here: https://github.com/npms-io/npms-api/blob/master/config/default.json5#L10

Is that sufficient for you?

amilajack commented 8 years ago

I've realized that the repo's are not sorted by the score number (I think). But I realized later that the current sorting method suits my needs. Thanks! But one of the things that i've noticed about noms.io is that some of the packages lead to a 404 (probably because they've been deleted). Wonder if npms.io could check monthly or so whether the repos still exist

amilajack commented 8 years ago

Here's one example of when the search doesn't work properly: screen shot 2016-07-03 at 9 49 16 pm

satazor commented 8 years ago

Exact matches always appear first for now, but that might change.

Regarding the repositories, modules are always re-analyzed each 15 days but I guess I'm not deleting the repo link if it is unavailable. Could you create a separate issue for this (in the npms-analyzer)?

Thanks

satazor commented 8 years ago

Just a heads up regarding the advanced query params: the names will soon change, as well as the response body. You may "preview" how they will look like in https://api-docs.npms.io/#api-module-get_info and you may follow the merge + deploy process in #36

amilajack commented 8 years ago

Got it. Thanks!

spdaly commented 8 years ago

@satazor The first link you mentioned on Jul 3 is a 404. Can you repost the URL?

satazor commented 8 years ago

I've updated my comment, thanks for the heads up.