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
When there are no matches, appstreamcli returns all items instead of none
#237
Comments
|
Returning all items is the default behavior in case the search string is invalid (e.g. when it contains only invalid characters, is too short or has a length of zero). The intent of this behavior is to give a hint to the user to refine the search by specifying it (since a ton of results will be shown at random). It may make sense to leave the decision to the client though, especially with the new search behavior that just landed in master. |
|
Hmm, when a search returns no results, I think the better hint to the user that they need to refine the search parameters is actually returning no results. :) But yes, as a compromise, returning all results only for invalid input would make sense though, assuming "invalid" is broad enough. For our use case in KDE, we'd want "2+2" to be considered valid and return no results (unless of course there's an app called 2+2 lol. |
Depends on how you look at it, I guess... This behavior was copied over from the old Ubuntu Software Center in the very early days of AppStream, and I guess it made sense back then. After thinking about it some more, I changed the code now to match all the things on a very broad query (as in "one letter searches") and in any other case when we can not acquire enough tokens from a search query do the expected thing and match nothing. |
|
Thanks @ximion! We'll see if that's enough. I'm a little worried that "return everything for one letter queries" will still be a problem because it means the moment the user types a single character into KRunner, the results list will become packed with apps that all disappear once a second character is typed. |
KDE's KRunner has an AppStream runner that searches for apps matching the user's query, which may not even have anything to to with apps. Because of this bug, when there are no AppStream matches (e.g. because the search term is a mathematical expression), we get back all items it knows about instead of none, causing a performance bottleneck for other KRunner runners that has resulted in user bug reports. See https://bugs.kde.org/show_bug.cgi?id=406384.
Version:
The text was updated successfully, but these errors were encountered: