After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 623372 - searching should sort matches more sensibly
searching should sort matches more sensibly
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
2.31.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 656313 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-07-02 11:44 UTC by Jan Niklas Hasse (Account disabled)
Modified: 2011-10-13 15:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
app-system: Consider usage frequency in search results (5.11 KB, patch)
2011-10-05 23:47 UTC, Florian Müllner
committed Details | Review
shell-app: Improve prefix matches (1.76 KB, patch)
2011-10-05 23:53 UTC, Florian Müllner
committed Details | Review
shell-app: Ignore MATCH_MULTIPLE_{PREFIX,SUFFIX} (2.17 KB, patch)
2011-10-05 23:58 UTC, Florian Müllner
reviewed Details | Review
shell-app: Remove MATCH_MULTIPLE_{PREFIX,SUFFIX} (8.25 KB, patch)
2011-10-13 15:08 UTC, Florian Müllner
committed Details | Review

Description Jan Niklas Hasse (Account disabled) 2010-07-02 11:44:07 UTC
When I search for "Terminal" it gives me "Terminal-Server" before "Terminal". I think it should be the other way around.
Comment 1 Dan Winship 2010-07-02 13:30:33 UTC
It's not really that. The results are effectively in random order.

We need to prioritize exact matches over partial matches, and name matches over description matches.
Comment 2 Florian Müllner 2010-07-02 13:33:49 UTC
(In reply to comment #1)
> It's not really that. The results are effectively in random order.
> 
> We need to prioritize exact matches over partial matches, and name matches over
> description matches.

Part of this is in bug 610955
Comment 3 Izhar Firdaus 2011-04-05 01:55:01 UTC
sort by usage pattern ?

In gnome-do, there seems to be a learning mechanism which display the frequently loaded action for a particular search result first. 

eg: searching "messenger" displays gnome-phone-manager first, and then pidgin .. If I frequently loads pidgin for the result of "messenger", pidgin will appear first for subsequent searches for "messenger"
Comment 4 ahatomastarday 2011-08-18 13:16:03 UTC
*** Bug 656313 has been marked as a duplicate of this bug. ***
Comment 5 ahatomastarday 2011-08-18 13:19:13 UTC
It looks like the shell already tracks application usage (see bug 656313, which I opened myself and now marked as duplicate of this one). So I guess implementing this behavior shouldn't be very hard... and will save users a lot of frustration.
Comment 6 Hylke Bons 2011-08-21 19:15:40 UTC
It would be nice if gnome-shell would learn what the user types to launch something as well. Right now when I type "f" it gives me Adobe Flash Player first, even when I always launch Firefox.
Comment 7 Jakub Steiner 2011-10-04 22:10:53 UTC
Frequency is a simple metric that would work here, I think.
Comment 8 Florian Müllner 2011-10-05 23:47:54 UTC
Created attachment 198387 [details] [review]
app-system: Consider usage frequency in search results

Application search results are internally categorized in four sets,
multiple and single prefix matches and multiple and single substring
matches. Each set is currently sorted alphabetically by application
name when concatenating the sets to the final result.
Change the last step to sort each set by usage frequency instead,
which is more likely to favor the most relevant match than
"arbitrary" alphabetic order.


(In reply to comment #7)
> Frequency is a simple metric that would work here, I think.

I agree, but just using frequency over alphabetical order does not make too much of a difference for me; I'll attach some more patches which (at least for me) make results more relevant.
Comment 9 Florian Müllner 2011-10-05 23:53:22 UTC
Created attachment 198388 [details] [review]
shell-app: Improve prefix matches

Currently we use a very strict definition of "prefix", where the
search term has to match at the very beginning of the searched
criteria (application name, executable name). Use a more liberal
definition by including matches where the preceding character is
a space (application name) or hyphen (executable name) as well;
as many applications use a prefix, this should improve the quality
of results.


(Canonical examples:
 - matching "play" treats a match on "Movie Player" the same as any
   applications which mentions "play" in its description (e.g. every
   game); with the patch, "Movie Player" is considered a better match

 - XFCE's Terminal wins over gnome-terminal ("Terminal" matches multiple
   prefixes, gnome-terminal does not (as the executable is "gnome-terminal"));
   with the patch, both matches rank equally, which means that with the
   previous patch, the more frequently used one wins
Comment 10 Florian Müllner 2011-10-05 23:58:07 UTC
Created attachment 198389 [details] [review]
shell-app: Ignore MATCH_MULTIPLE_{PREFIX,SUFFIX}

We originally OR'ed search terms and favored results which matched
multiple times to get more relevant results. When changing search
to AND search terms, the semantics of "multiple matches" were
changed to refer to a single term matching multiple criteria (name,
executable), which seemed like a good idea at the time.

However in practice this just results in applications whose
user-visible name matches the executable name on disk being
favored over applications using a more generic name, which
isn't too useful (in particular when taking usage frequency
into account).


Example:
 - searching for "m" gives me "Mahjongg" (which I've never ever used) as
   first result, before totem ("Movie Player"), which I do use occasionally;
Comment 11 Colin Walters 2011-10-06 00:39:19 UTC
This sounds like good stuff but it's more 3.4 right?

I'm getting a bit worried about the amount of stuff piling up for 3.0.1...
Comment 12 Florian Müllner 2011-10-06 01:02:29 UTC
Yeah, probably. I consider it nice-to-have, but we have more important stuff in line for 3.2.1 ...
Comment 13 Matthias Clasen 2011-10-07 12:35:57 UTC
*** Bug 661136 has been marked as a duplicate of this bug. ***
Comment 14 Hylke Bons 2011-10-07 12:48:04 UTC
I don't know how feasible it is to get it in 3.2.1 but it would be a huge improvement. This is one of the most annoying things not working in GNOME 3 at the moment. So I'm all for having it in.
Comment 15 Colin Walters 2011-10-13 13:48:43 UTC
Review of attachment 198387 [details] [review]:

This looks good.
Comment 16 Colin Walters 2011-10-13 13:51:06 UTC
Review of attachment 198388 [details] [review]:

Looks good.
Comment 17 Colin Walters 2011-10-13 13:55:18 UTC
Review of attachment 198389 [details] [review]:

Ok...then why aren't we just removing MATCH_MULTIPLE?
Comment 18 Florian Müllner 2011-10-13 15:08:20 UTC
Created attachment 198943 [details] [review]
shell-app: Remove MATCH_MULTIPLE_{PREFIX,SUFFIX}

(In reply to comment #17)
> Ok...then why aren't we just removing MATCH_MULTIPLE?

Yeah, makes sense ...
Comment 19 Colin Walters 2011-10-13 15:45:49 UTC
Review of attachment 198943 [details] [review]:

Looks good, thanks.
Comment 20 Florian Müllner 2011-10-13 15:49:15 UTC
Attachment 198387 [details] pushed as da83ad5 - app-system: Consider usage frequency in search results
Attachment 198388 [details] pushed as c427bba - shell-app: Improve prefix matches
Attachment 198943 [details] pushed as aee3c6f - shell-app: Remove MATCH_MULTIPLE_{PREFIX,SUFFIX}

Thanks for the review!