-
Notifications
You must be signed in to change notification settings - Fork 252
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
"nuget.exe list [search terms]" - behavior changed with nuget.org search improvements of August 2019 #8622
Comments
Not sure this has to do with the nuget.exe version. I downloaded a couple of older versions, and the same behavior exists there now. So maybe a problem with the search API at nuget.org? |
@alphaleonis Hmm, possibly, though that's not what I'm getting. On my dev and build machines I can consistently reproduce it after 5.0.2 but 5.0.2 is fine. My build machines automatically fetch an updated But yeah, it may be a coincidence that it appears consistent for me. |
It's strange... Accessing the API URL displayed when running in verbose mode also seems to return pretty much all packages, so my bet would still be on the nuget.org site: Example (skip 1000 first result, get 30): |
(nuget 4.8.1.5435) |
I've also noticed this problem. This seems to be specifically related to nuget.org. Our office's repo doesn't seem to be affected. |
@joelverhagen / @karann-msft - can you take a quick look at this. Known issue? Plan? |
tl;dr: if you want to find a single package on nuget.org using Request for people in this threadCould you respond back to this issue and tell us what purpose you are using Longer explanation
When we revamped our search algorithm, we started included a lot more things in the search. Because of the sorting, this means for a package ID with a generic token in it, you will get a lot of matches and it's very likely your specific package is not on the first many pages. One extreme example which hopefully can illustrate the change ("microsoft" and "aspnet" get tokenized and match some results albeit with a rather low score compared to the proper "microsoft.aspnet.mvc" query): To know how many results
So seeing many more packages in the results of search is expected. And, as @alphaleonis mentioned, There is a search syntax on nuget.org that allows you to do more specific searches. They work in I totally agree for Note that when you type |
Awesome. Thanks Joel. |
Thanks @joelverhagen.
The packageid trick works fine unless you're using multiple sources which include a v2 feed, or a file system source, in which case it doesn't work. It would be nice to have some kind of -packageid switch available directly in the list command, so we don't have to use api specific syntax. I'm trying to use Please let me know if you need more details. |
@matthewjones555, this helps a lot, thanks!. I think for the short term the best option for the mutli-feed environment is to run multiple invocations of nuget.exe list:
This is not elegant but perhaps it's a workaround you can use for now so I thought I would call it out.
Yes, this sounds like a good idea. There is an documented API today for looking up individual packages on V3 feed: This has a V2 API equivalent ( It would just be a matter of lighting up this option in nuget.exe list (or perhaps a new top level command) and calling this API instead of the search resource. In NuGet client code, there is one resource that has an implementation on V2, V3, and file-based sources that could handle this case very easily: One ongoing effort is to put new experiences in the .NET CLI (in addition or in lieu of nuget.exe) so it's not clear to me where a new switch should go moving forward. My expertise is on the nuget.org server side so I'll defer to people that focus on NuGet client: @rrelyea, @aortiz-msft - should we re-open this issue to track a different issue for command-line based package ID lookup? |
Not sure why the issue is closed and Microsoft is closing issues that mention this as if it is fixed. 2023-11-15 and I still cannot search for a package like "OpenCvSharp4.runtime" in Visual Studio 17.9.0 Preview 1.0 without getting every single package This seems to be an obvious bug that clearly still exists. Is it being tracked somewhere else with intentions to fix? My issue is exactly the one reported on this Visual Studio Developer Community which got marked as a duplicate for this issue and was closed (locked even.)
|
nuget list [search terms]
functionality allows searching for NuGet packages from the command line. This worked well upto 5.0.2, but in the version after that the list method ignores the search terms and will go on to list every single package in every package source.Details about Problem
Product: NuGet.exe
NuGet version: 5.3.0
OS version: Windows 10
Worked before? If so, with which NuGet version:
Yes, last worked in v5.0.2.
Detailed repro steps so we can see the same problem
nuget.exe list Microsoft.Extensions.Configuration.Json
With v5.0.2 that will return immediately with about a dozen hits on the given package name. With any later version, this will list every package in the public repo, ignoring the search term.
The text was updated successfully, but these errors were encountered: