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

[Feature]: Search v3 ability to search by multiple tags #9234

Open
MangelMaxime opened this issue Sep 13, 2022 · 1 comment
Open

[Feature]: Search v3 ability to search by multiple tags #9234

MangelMaxime opened this issue Sep 13, 2022 · 1 comment
Labels
feature-request Customer feature request

Comments

@MangelMaxime
Copy link

Related Problem

Cannot search packages by using multiple tags in the query.

The Elevator Pitch

For Fable,
an F# to JavaScript, Python, Dart, etc. compiler we are hosting packages on NuGet.

Users have a hard time discovering what Fable packages are available. We have the idea of using tags like:

  • fable
  • fable-binding
  • fable-library
  • fable-javascript
  • fable-dart
  • fable-python

to make it possible to filter the packages that the user want to search.

The idea is that if the user want to search for a Fable package, we can search by the tag fable.

If he want all the library which works for both JavaScript and Dart, he can search using fable-library AND fable-javascript AND fable-dart.

However, right now the search API and NuGet.org only support by searching by one tag.

Taking the following package available on NuGet.org

image

If we search by fable AND fable-binding then we get 360 results instead of only 1. Searched value Tags:"fable" Tags:"fable-binding"

If we search by fable-binding AND fable then we get 1 results. Searched value Tags:"fable-binding" Tags:"fable"

This leads me to believe that only the first tag is actually used.

Additional Context and Details

No response

@MangelMaxime MangelMaxime added the feature-request Customer feature request label Sep 13, 2022
@joelverhagen
Copy link
Member

Currently field scoped queries (such as Tags:"fable" Tags:"fable-binding") are combined roughly with an OR logic. This basically Lucene behavior where a document (package) matching multiple search teams gets a boost but a document containing either is also matched but at a lower base score (tf-idf, etc.). The reason you're not seeing Glutinum.Fuse at the top (it matches both tags) is because the download count is very low compared to some packages that match just Tags:"fable". We use download count as a strong boost for packages in order for popular packages to be favored, generally. This has proven to be the best for the most users.

This behavior is in contrast with unscoped terms combining roughly with AND logic (after tokenization). Searching for fable binding returns a smaller result set because of this.

It sounds like you're asking for either #7195 or #3306 with a twist on field scope query behavior.

I agree that this is not a great status quo. Having "AND" logic for non-field scoped queries and "OR" for field scoped queries is inconsistent and hard to reason about. From our data, however, field scoped queries are a microscopic fraction of total search queries so it's hard to prioritize this work over other feature requests.

Some suggestions for the reader, while you wait.

  1. If these are not typical .NET dependency packages, consider a custom package type. You can do a strict filter this way: https://www.nuget.org/packages?packagetype=fable. Note that such packages are rejected by the Install button in Visual Studio package management UI so proceed with caution and testing.
  2. Consider a term that does not have a separator such as fablebinding. This will not be split by camelcase or hyphen to make the matching verbatim. Then use a non-field scoped query like fable fablebinding. Not great but an option.
  3. Create a proposal of new behavior (https://github.com/NuGet/Home/tree/dev/meta#how-do-i-create-a-proposal). Consider prototyping behavior with our Azure Search service project which is the backend for the search results: https://github.com/NuGet/NuGet.Jobs/tree/main/src/NuGet.Services.SearchService.Core.
  4. Help us prioritize this work properly by looking at other top issues (see https://github.com/NuGet/NuGetGallery/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc) and upvoting this if you feel that this is a priority.

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

No branches or pull requests

2 participants