Improved search syntax on nuget.org and in NuGet Visual Studio extension

Avatar

Luan Nguyen

The NuGet team recently deployed a new and very useful search capability on nuget.org, which allows you to narrow your search to a pariticular attribute of a NuGet package. For example, if you want to search for packages which contain ‘elmah’ within the Id, you type ‘id:elmah‘. (Note that this will execute a ‘contains’ search, not an exact match search. Which means it will return elmah, elmah.corelibrary, etc.)

Similarly you can use the same syntax to search for other attributes in the package metadata. Here’s the complete list of supported attributes:

AttributeExample
idid:jQuery
titletitle:Validation
descriptiondescription:dependency injection
authorsauthors:Outercurve Foundation
ownersowners:dotnetjunky
tagstags:silverlight

Note that when a search query contains spaces, the gallery will perform an OR search against words in the query. AND search is currently not supported.

Even better, this feature is automatically available for any NuGet client that calls the Search service method from nuget.org. This can be seen in the Visual Studio Package Manager dialog as shown below.

Happy searching!

Avatar
Luan Nguyen

Follow Luan Nguyen   

0 comments

    Leave a comment

    Your email address will not be published. Required fields are marked *