summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKalev Lember <klember@redhat.com>2018-11-27 11:56:05 +0100
committerKalev Lember <klember@redhat.com>2018-11-27 12:07:50 +0100
commit660c509619c7d068b9d479231d1e50ad45587674 (patch)
treec1518f2cd30578bb38625cbcc2d369d7a64087fd
parent89d3d99c10e58f7a312ff15f2ade20d584f21d7e (diff)
downloadappstream-glib-660c509619c7d068b9d479231d1e50ad45587674.tar.gz
app: Tokenize the ID when adding search tokens
This allows the search to match on e.g. "eog" for an app that has the ID of "org.gnome.org".
-rw-r--r--libappstream-glib/as-app.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libappstream-glib/as-app.c b/libappstream-glib/as-app.c
index 01f6d5b..2210caa 100644
--- a/libappstream-glib/as-app.c
+++ b/libappstream-glib/as-app.c
@@ -5929,8 +5929,12 @@ as_app_create_token_cache_target (AsApp *app, AsApp *donor)
/* add all the data we have */
if (priv->search_match & AS_APP_SEARCH_MATCH_ID) {
if (priv->id_filename != NULL) {
+ /* add the whole ID */
as_app_add_token (app, priv->id_filename, FALSE,
AS_APP_SEARCH_MATCH_ID);
+ /* tokenize and add individual parts */
+ as_app_add_tokens (app, priv->id_filename, "C", FALSE,
+ AS_APP_SEARCH_MATCH_ID);
}
}
locales = g_get_language_names ();