image-builder icon indicating copy to clipboard operation
image-builder copied to clipboard

Should package search be case sensitive?

Open lucasgarfield opened this issue 3 years ago • 5 comments

Most package names are all lower case, but some package names do have capital letters. Consider the package NetworkManager. At the moment making a request for networkmanager will not yield NetworkManager in the response. I propose that the package search should be case insensitive.

lucasgarfield avatar Feb 23 '22 10:02 lucasgarfield

I like this idea, do you want to look into it?

ondrejbudai avatar Feb 23 '22 10:02 ondrejbudai

Yes, I will look into it and submit a PR and we can evaluate from there!

lucasgarfield avatar Feb 23 '22 10:02 lucasgarfield

One thing to keep in mind: ideally we would push the searching down to dnf eventually, rather than do it ourselves. So let's check that dnf supports whatever features we add, so that such a refactor would be transparent to the user.

teg avatar Feb 23 '22 11:02 teg

I think performing case insensitive search may actually bring us closer to dnf's behavior:

https://dnf.readthedocs.io/en/latest/command_ref.html#search-command

Search Command
Command: search
Aliases: se

dnf [options] search [--all] <keywords>...Search package metadata for keywords. Keywords are 
matched as case-insensitive substrings, globbing is supported. By default lists packages that 
match all requested keys (AND operation). Keys are searched in package names and summaries. 
If the “–all” option is used, lists packages that match at least one of the keys (an OR operation). 
In addition the keys are searched in the package descriptions and URLs. The result is sorted from 
the most relevant results to the least.

lucasgarfield avatar Feb 23 '22 14:02 lucasgarfield

Perfect! Thanks for checking :)

teg avatar Feb 23 '22 15:02 teg