Merge lp:~jpakkane/unity-lens-applications/lessfuzz-test into lp:unity-lens-applications

Proposed by Jussi Pakkanen
Status: Merged
Merged at revision: 333
Proposed branch: lp:~jpakkane/unity-lens-applications/lessfuzz-test
Merge into: lp:unity-lens-applications
Diff against target: 52 lines (+18/-6)
1 file modified
src/unity-package-search.cc (+18/-6)
To merge this branch: bzr merge lp:~jpakkane/unity-lens-applications/lessfuzz-test
Reviewer Review Type Date Requested Status
Mathieu Trudel-Lapierre Needs Fixing
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+158299@code.launchpad.net

Commit message

Tighten fuzzy matching rules so less nonrelevant matches are returned.

Description of the change

Fuzzy matching is currently a bit loose, which turned out to be confusing for lots of users. This patch makes the search stricter by not indexing text other than the visible application name. This reduces the amount of matches users might consider non-relevant.

This patch is intended both for trunk and raring. Does it get to both from this or do I need to file this for a separate raring branch as well?

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

We can think at least EXENAME might be something the users expect to be matched against, while it does make some sense that SUMMARY could be confusing.

What did hud match against in Quantal? Can we compare and attempt to keep the same behavior, though with the somewhat stricter fuzzy-matching than it is now?

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/unity-package-search.cc'
2--- src/unity-package-search.cc 2013-03-05 10:34:21 +0000
3+++ src/unity-package-search.cc 2013-04-11 09:11:22 +0000
4@@ -96,22 +96,33 @@
5 std::string val;
6
7 val = xdoc.get_value(XAPIAN_VALUE_APPNAME);
8- if(!val.empty())
9+ if(!val.empty()) {
10 cdoc.addText(appnameField, val.c_str());
11+ }
12+ /* It turned out that fuzzy matching non-visible content
13+ * is confusing to users, so let's not index these at all.
14+ * In the future we might want to explore better ways
15+ * of exposing this info.
16 val = xdoc.get_value(XAPIAN_VALUE_SUMMARY);
17- if(!val.empty())
18+ if(!val.empty()) {
19 cdoc.addText(summaryField, val.c_str());
20+ }
21 val = xdoc.get_value(XAPIAN_VALUE_PKGNAME);
22- if(!val.empty())
23+ if(!val.empty()) {
24 cdoc.addText(pkgnameField, val.c_str());
25+ }
26 val = xdoc.get_value(XAPIAN_VALUE_EXENAME);
27- if(!val.empty())
28+ if(!val.empty()) {
29 cdoc.addText(exenameField, val.c_str());
30+ }
31+ */
32 c.addDocument(cdoc);
33 }
34 m->index(c);
35 m->getErrorValues().addStandardErrors();
36- m->getErrorValues().setSubstringMode();
37+ // Substring mode resulted in too many false positives,
38+ // so disable it for the time being.
39+ //m->getErrorValues().setSubstringMode();
40 m->getIndexWeights().setWeight(summaryField, 0.5);
41 }
42
43@@ -633,7 +644,8 @@
44 if(g_slist_length(xap_result->results) == 0 && (!has_category && col_query_str)) {
45 g_slice_free(UnityPackageSearchResult, xap_result);
46 col_query_str += 3;
47- return libcolumbus_search(searcher, col_query_str);
48+ UnityPackageSearchResult *res = libcolumbus_search(searcher, col_query_str);
49+ return res;
50 }
51 return xap_result;
52 }

Subscribers

People subscribed via source and target branches