Bug 469026 - Searching for "iso" doesn't find "Popsicle"
Summary: Searching for "iso" doesn't find "Popsicle"
Status: RESOLVED FIXED
Alias: None
Product: Discover
Classification: Applications
Component: discover (show other bugs)
Version: 5.27.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-26 20:49 UTC by Nate Graham
Modified: 2023-11-03 15:52 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2023-04-26 20:49:54 UTC
STEPS TO REPRODUCE
1. Run `appstreamcli search iso | grep -i popsicle` in a terminal window to make sure Popsicle is available and AppStream sees it
2. Launch Discover with only its PackageKit and Flatpak backends by running `plasma-discover --backends flatpak,packagekit` in a terminal window
3. Search for "iso"


OBSERVED RESULT
Popsicle isn't in the search results


EXPECTED RESULT
Popsicle is in the search results


SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 37
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.106.0
AppStream version: 0.16.1
Qt Version: 5.15.9
Kernel Version: 6.2.12-200.fc37.x86_64 (64-bit)
Graphics Platform: Wayland
Comment 1 Marco Martin 2023-11-03 15:52:11 UTC
Git commit 786243247a9b661c3fdc910df5cc8d5250267f1e by Marco Martin.
Committed on 03/11/2023 at 16:51.
Pushed by mart into branch 'master'.

Relevance sorting heuristics for search

Search also in appstreamId(): weird but only way to make gimp come up
when searching for gimp, there is also appstream searchTokens but they
are abused and lead to a lot of garbage results.

Do a new sortRole default when there is a search. This relevance role
combines:

* rating
* a measure based on The Levenshtein distance between search string and
  app name
* an exact match with the name or a sub-word of the name

It makes sortings much more "expected" than any of the other sortings.
Related: bug 399502, bug 475844
FIXED-IN: 6.0

![image](/uploads/05fae0a2b90bebb70f3aa6da78e04c4e/image.png)

M  +26   -2    discover/qml/ApplicationsListPage.qml
M  +6    -2    libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp
M  +87   -38   libdiscover/resources/ResourcesProxyModel.cpp
M  +2    -10   libdiscover/resources/ResourcesProxyModel.h

https://invent.kde.org/plasma/discover/-/commit/786243247a9b661c3fdc910df5cc8d5250267f1e