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

Allow control of Sorting when searching on the V3 search API #7992

Open
donnie-msft opened this issue May 13, 2020 · 3 comments
Open

Allow control of Sorting when searching on the V3 search API #7992

donnie-msft opened this issue May 13, 2020 · 3 comments

Comments

@donnie-msft
Copy link
Contributor

Is your feature request related to a problem? Please describe.

NuGet Client request to allow sorting on the Browse tab will require Server changes as well.

Describe the solution you'd like

What changes would be necessary on Server to handle such a feature? Perhaps it should be limited to a single source?

Additional context

NuGet/Home#2585

@loic-sharma
Copy link
Contributor

loic-sharma commented May 13, 2020

What changes would be necessary on Server to handle such a feature?

Cost-wise, it seems this feature would be similar to the package type filter feature. We would need to update:

  1. The protocol to declare whether the server supports sort ordering
  2. The search API to request different sort orders
  3. The search index to support ordering on the desired fields

We should figure out the sortable fields we'd like as some are easier than others. For example, it was suggested here that we support sorting by number of dependents. This information isn't in search today and would need to be added. In case you're interested, you can find the search index definition here. I would suggest we start with easy things like sort by "relevance", "downloads", "newest package", and "latest updated".

Perhaps it should be limited to a single source?

Could you explain this a little bit more?

How would the client handle two sources, one which supports ordering and another that does not?

@joelverhagen
Copy link
Member

This has been a long time ask from customers. The pre-existing issue is here: #2636. It reads as specific to nuget.org but the implementation would have to go as deep as the search service and therefore be low hanging fruit for V3 API addition.

Let's merge this issue into the existing one and include the information mentioned here. It's clearer for users if there's a single issue to upvote and provide comments on. It's really one feature, which multiple stages/entry points.

When we implement it for nuget.org, we will consider both how it works on the website as well as how it is shaped in the V3 API (which PM UI would call).

Regarding the sorting, if you can detect that all sources support sorting (perhaps a new search @type in the service index), you can merge the results on client side, assuming the sort key is in the result set.

@joelverhagen
Copy link
Member

Re-opening since the pre-existing issue was implemented without updating the official V3 API (which PM UI could leverage).

@joelverhagen joelverhagen reopened this Aug 13, 2020
@joelverhagen joelverhagen changed the title Allow control of Sorting when searching from PMUI Allow control of Sorting when searching on the V3 search API Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants