Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does npmsearch.com do sorting? #26

Open
pketh opened this issue Jan 26, 2016 · 2 comments
Open

How does npmsearch.com do sorting? #26

pketh opened this issue Jan 26, 2016 · 2 comments

Comments

@pketh
Copy link

pketh commented Jan 26, 2016

The closest I've been able to get is with sort=rating:desc
http://npmsearch.com/query?q=async&fields=name,description,version,keywords,homepage&size=15&sort=rating:desc, but if you compare the results with http://npmsearch.com/?q=async, the site search returns much better results.

How are searches sorted by the site?
Thanks

@pketh
Copy link
Author

pketh commented Jan 26, 2016

It seems like keywords are being weighted more than the actual package name?

@pketh
Copy link
Author

pketh commented Jan 27, 2016

in server.js I see the request body is

  var body = {
    fields: ['name','description','keywords','author','modified','homepage','version','license','rating'],
    query: search,
    sort: [{'rating' : "desc"}],
    highlight: {
      fields: {
        description : {}
      }
    }
  };

but I'm not seeing the difference still

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant