[gnome-software/wip/hughsie/libxmlb-stem] Stem the search text before running the query



commit 2239807505d5a11a1e6b53a70c67ae45095f7986
Author: Richard Hughes <richard hughsie com>
Date:   Wed Nov 7 14:33:51 2018 +0000

    Stem the search text before running the query
    
    This allows us to match 'games' for a search term of 'gaming' and 'pony' for
    'ponies' -- which increases the quality of search results.
    
    We already depend on libxmlb from master, although if using a subproject it
    may need to be updated manually.

 plugins/core/gs-appstream.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/plugins/core/gs-appstream.c b/plugins/core/gs-appstream.c
index 4a2742b6..62fef53c 100644
--- a/plugins/core/gs-appstream.c
+++ b/plugins/core/gs-appstream.c
@@ -1014,13 +1014,13 @@ gs_appstream_search (GsPlugin *plugin,
                AsAppSearchMatch         match_value;
                const gchar             *xpath;
        } queries[] = {
-               { AS_APP_SEARCH_MATCH_MIMETYPE, "mimetypes/mimetype[text()~=?]" },
-               { AS_APP_SEARCH_MATCH_PKGNAME,  "pkgname[text()~=?]" },
-               { AS_APP_SEARCH_MATCH_COMMENT,  "summary[text()~=?]" },
-               { AS_APP_SEARCH_MATCH_NAME,     "name[text()~=?]" },
-               { AS_APP_SEARCH_MATCH_KEYWORD,  "keywords/keyword[text()~=?]" },
-               { AS_APP_SEARCH_MATCH_ID,       "id[text()~=?]" },
-               { AS_APP_SEARCH_MATCH_ORIGIN,   "../components[@origin~=?]" },
+               { AS_APP_SEARCH_MATCH_MIMETYPE, "mimetypes/mimetype[text()~=stem(?)]" },
+               { AS_APP_SEARCH_MATCH_PKGNAME,  "pkgname[text()~=stem(?)]" },
+               { AS_APP_SEARCH_MATCH_COMMENT,  "summary[text()~=stem(?)]" },
+               { AS_APP_SEARCH_MATCH_NAME,     "name[text()~=stem(?)]" },
+               { AS_APP_SEARCH_MATCH_KEYWORD,  "keywords/keyword[text()~=stem(?)]" },
+               { AS_APP_SEARCH_MATCH_ID,       "id[text()~=stem(?)]" },
+               { AS_APP_SEARCH_MATCH_ORIGIN,   "../components[@origin~=stem(?)]" },
                { AS_APP_SEARCH_MATCH_NONE,     NULL }
        };
 


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