[gnome-software/1620-search-results-should-priorize-full-matches] gs-appstream: Remove the ID token from the search match value



commit 49d28062ec3c1ce00cbec62010e2c71aee423f7d
Author: Milan Crha <mcrha redhat com>
Date:   Thu Feb 24 16:00:45 2022 +0100

    gs-appstream: Remove the ID token from the search match value
    
    The AS_SEARCH_TOKEN_MATCH_ID is the highest value of the match_value,
    but it's (probably) the lowest match for consideration, because there
    can be many apps matching words like "GNOME", "Element" and others,
    which are part of the app IDs (org.gnome....), thus drop this value
    from the match_value, which prioritizes match in the name, as it's
    the send highest value in the AsSearchTokenMatch flags.
    
    Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1620

 lib/gs-appstream.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/lib/gs-appstream.c b/lib/gs-appstream.c
index 0334447c4..50f117c49 100644
--- a/lib/gs-appstream.c
+++ b/lib/gs-appstream.c
@@ -1403,7 +1403,7 @@ gs_appstream_search (GsPlugin *plugin,
                                continue;
                        }
                        g_debug ("add %s", gs_app_get_unique_id (app));
-                       gs_app_set_match_value (app, match_value);
+                       gs_app_set_match_value (app, match_value & (~AS_SEARCH_TOKEN_MATCH_ID));
                        gs_app_list_add (list, app);
 
                        if (gs_app_get_kind (app) == AS_COMPONENT_KIND_ADDON) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]