Merge lp:~cyphermox/unity-lens-applications/lessfuzz into lp:unity-lens-applications

Proposed by Mathieu Trudel-Lapierre
Status: Merged
Approved by: Mathieu Trudel-Lapierre
Approved revision: 332
Merged at revision: 333
Proposed branch: lp:~cyphermox/unity-lens-applications/lessfuzz
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:~cyphermox/unity-lens-applications/lessfuzz
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Didier Roche-Tolomelli Approve
Review via email: mp+158972@code.launchpad.net

Commit message

Tighten fuzzy matching rules so less nonrelevant matches are returned.

Description of the change

Tighten fuzzy matching rules so less nonrelevant matches are returned.

To post a comment you must log in.
332. By Mathieu Trudel-Lapierre

Tighten fuzzy matching rules so less nonrelevant matches are returned.

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

please approve once tested, similar to what I've tested few days ago.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

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-15 16:34:26 +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+ */
27 val = xdoc.get_value(XAPIAN_VALUE_EXENAME);
28- if(!val.empty())
29+ if(!val.empty()) {
30 cdoc.addText(exenameField, val.c_str());
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