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 711640 - gdesktopappinfo: Rank Keywords matches higher than GenericName
gdesktopappinfo: Rank Keywords matches higher than GenericName
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-11-07 22:46 UTC by Florian Müllner
Modified: 2013-11-14 15:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gdesktopappinfo: Rank Keywords matches higher than GenericName (1.24 KB, patch)
2013-11-07 22:46 UTC, Florian Müllner
needs-work Details | Review
gdesktopappinfo: Rank Keywords matches higher than GenericName (1.74 KB, patch)
2013-11-08 17:28 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2013-11-07 22:46:37 UTC
See patch.
Comment 1 Florian Müllner 2013-11-07 22:46:39 UTC
Created attachment 259230 [details] [review]
gdesktopappinfo: Rank Keywords matches higher than GenericName

It makes sense to match on GenericName in case an application does
not provide any keywords, but the Keywords field has been added
to explicitly support the search case, while GenericName was used
to be displayed in menus, so it makes more sense to consider
Keywords more (or equally) relevant for search.
Comment 2 Colin Walters 2013-11-07 23:01:03 UTC
I'm kind of dubious about having something as design-sensitive as search hardcoded inside GLib...but eh, we'll see what happens.
Comment 3 Allison Karlitskaya (desrt) 2013-11-08 15:03:56 UTC
Review of attachment 259230 [details] [review]:

Colin makes a good point.  Can you please add a comment to the public API doc to the effect of "the algorithm for determining matches is undefined and subject to change at any time"?
Comment 4 Colin Walters 2013-11-08 15:06:45 UTC
(In reply to comment #3)
> Review of attachment 259230 [details] [review]:
> 
> Colin makes a good point.  Can you please add a comment to the public API doc
> to the effect of "the algorithm for determining matches is undefined and
> subject to change at any time"?

I haven't looked at the search code at all, but would it make sense to add a GAppCompareFunc to the API or something, and passing NULL gives you an unspecified default?
Comment 5 Allison Karlitskaya (desrt) 2013-11-08 15:12:56 UTC
We had this at one point -- the way that it worked was sorting the sublists and leaving the toplevel list alone (ie: could be used to change the ranking within categories but not across them).

We took it out in favour of just returning the list-of-lists because you can easily sort that for yourself when you're done, in whatever way you like.
Comment 6 Florian Müllner 2013-11-08 17:28:47 UTC
Created attachment 259290 [details] [review]
gdesktopappinfo: Rank Keywords matches higher than GenericName

It makes sense to match on GenericName in case an application does
not provide any keywords, but the Keywords field has been added
to explicitly support the search case, while GenericName was used
to be displayed in menus, so it makes more sense to consider
Keywords more (or equally) relevant for search.
Comment 7 Allison Karlitskaya (desrt) 2013-11-14 15:43:40 UTC
Review of attachment 259290 [details] [review]:

OK.  Thanks.
Comment 8 Florian Müllner 2013-11-14 15:47:49 UTC
Attachment 259290 [details] pushed as 2fb8901 - gdesktopappinfo: Rank Keywords matches higher than GenericName

Ack'ed on IRC.