Merge lp:~pete-woods/hud/tweak-search-parameters into lp:hud/14.04

Proposed by Pete Woods
Status: Merged
Approved by: Antti Kaijanmäki
Approved revision: 385
Merged at revision: 378
Proposed branch: lp:~pete-woods/hud/tweak-search-parameters
Merge into: lp:hud/14.04
Prerequisite: lp:~pete-woods/hud/no-suggestions-for-legacy-queries
Diff against target: 227 lines (+44/-30)
8 files modified
CMakeLists.txt (+1/-1)
data/com.canonical.indicator.appmenu.hud.search.gschema.xml (+4/-4)
debian/control (+1/-1)
service/HardCodedSearchSettings.h (+2/-2)
service/ItemStore.cpp (+28/-17)
service/QGSettingsSearchSettings.cpp (+2/-2)
tests/integration/TestHud.cpp (+2/-2)
tests/unit/service/TestItemStore.cpp (+4/-1)
To merge this branch: bzr merge lp:~pete-woods/hud/tweak-search-parameters
Reviewer Review Type Date Requested Status
Charles Kerr (community) Needs Information
Antti Kaijanmäki (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Sebastien Bacher Needs Information
Review via email: mp+208087@code.launchpad.net

Commit message

Tweak search parameters following advice from Jussi

Description of the change

* Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)
  * Yes
 * Did you build your software in a clean sbuild/pbuilder chroot or ppa?
  * Yes
 * Did you build your software in a clean sbuild/pbuilder armhf chroot or ppa?
  * Yes
 * Has your component "TestPlan” been executed successfully on emulator, N4?
  * Yes
 * Has a 5 minute exploratory testing run been executed on N4?
  * Yes
 * If you changed the packaging (debian), did you subscribe a core-dev to this MP?
  * N/A
 * If you changed the UI, did you subscribe the design-reviewers to this MP?
  * No change
 * What components might get impacted by your changes?
  * Unity7
  * Unity8
 * Have you requested review by the teams of these owning components?
  * Yes

Check List:
https://wiki.ubuntu.com/Process/Merges/Checklists/hud

Test Plan:
https://wiki.ubuntu.com/Process/Merges/TestPlan/hud

Silo:
https://launchpad.net/~ci-train-ppa-service/+archive/landing-002/

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
Sebastien Bacher (seb128) wrote :

Thanks for the work, could you explain what issues you are trying to fix with the parameters tweaks? Could you give an example of a query which was considered buggy and what are the differences in the results now?

review: Needs Information
Revision history for this message
Pete Woods (pete-woods) wrote :

> Thanks for the work, could you explain what issues you are trying to fix with
> the parameters tweaks? Could you give an example of a query which was
> considered buggy and what are the differences in the results now?

The branch is not ready for merge, but is part of an investigation into the (now) linked bug. I expect there will additionally be changes made to libcolumbus. I will link the relevant columbus branch to this bug, also.

The test application is essentially GIMP. If you search for, for example, "crop to selection" (assuming you have something selected), you will see that you don't exactly get the results you'd expect. The same applies to the other cases I have been testing "fit canvas to layers" and "fit canvas to selection".

Revision history for this message
Sebastien Bacher (seb128) wrote :

the new parameters have regressions. One example, open gedit in french and type "pref" -> empty results, it used to list "préférence", adding a char "prefe" and it's still empty, you need to type "prefer" to get a result.

Revision history for this message
Pete Woods (pete-woods) wrote :

> the new parameters have regressions. One example, open gedit in french and
> type "pref" -> empty results, it used to list "préférence", adding a char
> "prefe" and it's still empty, you need to type "prefer" to get a result.

Hmm, that's annoying, the unit tests (http://bazaar.launchpad.net/~pete-woods/hud/tweak-search-parameters/view/head:/tests/unit/service/TestItemStore.cpp#L181) are clearly not strong enough for this regression!

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
375. By Pete Woods

Change GTK documentation so that it builds with the new glib version Fixes: 1287580

376. By PS Jenkins bot

Releasing 13.10.1+14.04.20140304-0ubuntu1

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Antti Kaijanmäki (kaijanmaki) wrote :

LGTM. Waiting for silo.

Revision history for this message
Antti Kaijanmäki (kaijanmaki) wrote :

 * Are any changes against your component pending/needed to land the MP under review in a functional state and are those called out explicitly by the submitter?
Yes.

 * Did you do exploratory testing related to the component you own with the MP changeset included?
Yes.

 * Has the submitter requested review by all the relevant teams/reviewres?
Yes.

 * If you are the reviewer owning the component the MP is against, have you checked that submitter has accurately filled out the submitter checklist and has taken no shortcut?
Yes.

review: Approve
Revision history for this message
Charles Kerr (charlesk) wrote :

I notice this approved and waiting for silo even though the only changes since seb's "préférence" regression are docs/packaging changes. Are we releasing with that regression? Is it fixed upstream in libcolumbus?

review: Needs Information
Revision history for this message
Pete Woods (pete-woods) wrote :

> I notice this approved and waiting for silo even though the only changes since
> seb's "préférence" regression are docs/packaging changes. Are we releasing
> with that regression? Is it fixed upstream in libcolumbus?

Don't worry! The history just looks funny because I rebased.

I specifically strengthen the test for what Seb was talking about in revision 384. I also installed the French language pack and checked the search manually.

Revision history for this message
Pete Woods (pete-woods) wrote :
Revision history for this message
Sebastien Bacher (seb128) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2014-02-10 12:13:59 +0000
+++ CMakeLists.txt 2014-03-14 14:07:40 +0000
@@ -163,9 +163,9 @@
163 check163 check
164 ${CMAKE_CTEST_COMMAND} --force-new-ctest-process --output-on-failure164 ${CMAKE_CTEST_COMMAND} --force-new-ctest-process --output-on-failure
165 )165 )
166 add_subdirectory(tests)
166endif()167endif()
167168
168add_subdirectory(tests)
169169
170add_subdirectory(tools-vala)170add_subdirectory(tools-vala)
171if(${ENABLE_DOCUMENTATION})171if(${ENABLE_DOCUMENTATION})
172172
=== modified file 'data/com.canonical.indicator.appmenu.hud.search.gschema.xml'
--- data/com.canonical.indicator.appmenu.hud.search.gschema.xml 2012-04-02 15:57:16 +0000
+++ data/com.canonical.indicator.appmenu.hud.search.gschema.xml 2014-03-14 14:07:40 +0000
@@ -15,7 +15,7 @@
15 </key>15 </key>
1616
17 <key type='u' name='add-penalty'>17 <key type='u' name='add-penalty'>
18 <default>10</default>18 <default>100</default>
19 <summary>Penalty for extra characters added to the search</summary>19 <summary>Penalty for extra characters added to the search</summary>
20 <description>20 <description>
21 The penalty for each extra character in the search string that does not appear in the text of a menu21 The penalty for each extra character in the search string that does not appear in the text of a menu
@@ -27,7 +27,7 @@
27 </key>27 </key>
2828
29 <key type='u' name='drop-penalty'>29 <key type='u' name='drop-penalty'>
30 <default>10</default>30 <default>100</default>
31 <summary>Penalty applied if a character is dropped</summary>31 <summary>Penalty applied if a character is dropped</summary>
32 <description>32 <description>
33 The penalty for each character dropped from the search string, as compared with the text of a menu item.33 The penalty for each character dropped from the search string, as compared with the text of a menu item.
@@ -39,7 +39,7 @@
39 </key>39 </key>
4040
41 <key type='u' name='end-drop-penalty'>41 <key type='u' name='end-drop-penalty'>
42 <default>1</default>42 <default>20</default>
43 <summary>Penalty applied if a character is dropped from the end</summary>43 <summary>Penalty applied if a character is dropped from the end</summary>
44 <description>44 <description>
45 The penalty for each missing character at the end of a search term.45 The penalty for each missing character at the end of a search term.
@@ -50,7 +50,7 @@
50 </key>50 </key>
5151
52 <key type='u' name='swap-penalty'>52 <key type='u' name='swap-penalty'>
53 <default>15</default>53 <default>150</default>
54 <summary>Penalty applied when the characters are not the same</summary>54 <summary>Penalty applied when the characters are not the same</summary>
55 <description>55 <description>
56 The penalty for each substituted character in the search term.56 The penalty for each substituted character in the search term.
5757
=== modified file 'debian/control'
--- debian/control 2014-02-10 12:13:59 +0000
+++ debian/control 2014-03-14 14:07:40 +0000
@@ -9,7 +9,7 @@
9 google-mock (>= 1.6.0+svn437),9 google-mock (>= 1.6.0+svn437),
10 gtk-doc-tools,10 gtk-doc-tools,
11 intltool,11 intltool,
12 libcolumbus1-dev,12 libcolumbus1-dev (>= 1.1.0),
13 libdbusmenu-glib-dev (>= 0.5.90),13 libdbusmenu-glib-dev (>= 0.5.90),
14 libdbusmenu-gtk3-dev (>= 0.5.90),14 libdbusmenu-gtk3-dev (>= 0.5.90),
15 libdbusmenu-jsonloader-dev (>= 0.5.90),15 libdbusmenu-jsonloader-dev (>= 0.5.90),
1616
=== modified file 'service/HardCodedSearchSettings.h'
--- service/HardCodedSearchSettings.h 2014-02-17 09:58:27 +0000
+++ service/HardCodedSearchSettings.h 2014-03-14 14:07:40 +0000
@@ -51,9 +51,9 @@
5151
52 uint m_dropPenalty = 100;52 uint m_dropPenalty = 100;
5353
54 uint m_endDropPenalty = 1;54 uint m_endDropPenalty = 20;
5555
56 uint m_swapPenalty = 5;56 uint m_swapPenalty = 150;
57};57};
5858
59}59}
6060
=== modified file 'service/ItemStore.cpp'
--- service/ItemStore.cpp 2014-03-14 14:07:39 +0000
+++ service/ItemStore.cpp 2014-03-14 14:07:40 +0000
@@ -29,6 +29,7 @@
29using namespace Columbus;29using namespace Columbus;
3030
31static const QRegularExpression SINGLE_AMPERSAND("(?<![&])[&](?![&])");31static const QRegularExpression SINGLE_AMPERSAND("(?<![&])[&](?![&])");
32static const QRegularExpression BAD_CHARACTERS("\\.\\.\\.|…");
32static const QRegularExpression WHITESPACE("\\s+");33static const QRegularExpression WHITESPACE("\\s+");
33static const QRegularExpression WHITESPACE_OR_SEMICOLON("[;\\s+]");34static const QRegularExpression WHITESPACE_OR_SEMICOLON("[;\\s+]");
3435
@@ -39,8 +40,9 @@
39 ErrorValues &errorValues(m_matcher.getErrorValues());40 ErrorValues &errorValues(m_matcher.getErrorValues());
40 errorValues.addStandardErrors();41 errorValues.addStandardErrors();
4142
42 connect(m_settings.data(), SIGNAL(changed()), this,43 m_matcher.getIndexWeights().setWeight(Word("context"), 0.5);
43 SLOT(settingChanged()));44
45 connect(m_settings.data(), SIGNAL(changed()), this, SLOT(settingChanged()));
44 settingChanged();46 settingChanged();
45}47}
4648
@@ -72,7 +74,9 @@
72 continue;74 continue;
73 }75 }
7476
75 QStringList text(convertActionText(action).split(WHITESPACE));77 QStringList text(
78 convertActionText(action).remove(BAD_CHARACTERS).split(
79 WHITESPACE));
7680
77 bool isParameterized(action->property("isParameterized").toBool());81 bool isParameterized(action->property("isParameterized").toBool());
7882
@@ -89,7 +93,7 @@
8993
90 WordList command;94 WordList command;
91 for (const QString &word : text) {95 for (const QString &word : text) {
92 command.addWord(Word(word.toStdString()));96 command.addWord(Word(word.toUtf8().constData()));
93 }97 }
94 document.addText(Word("command"), command);98 document.addText(Word("command"), command);
9599
@@ -102,7 +106,7 @@
102 context = stack;106 context = stack;
103 }107 }
104 for (const QString &word : context) {108 for (const QString &word : context) {
105 wordList.addWord(Word(word.toStdString()));109 wordList.addWord(Word(word.toUtf8().constData()));
106 }110 }
107 document.addText(Word("context"), wordList);111 document.addText(Word("context"), wordList);
108112
@@ -177,21 +181,28 @@
177 }181 }
178182
179 } else {183 } else {
184 QString cleanQuery(query);
185 cleanQuery.remove(BAD_CHARACTERS);
186
180 WordList queryList;187 WordList queryList;
181 for (const QString &word : query.split(WHITESPACE)) {188 for (const QString &word : cleanQuery.split(WHITESPACE)) {
182 queryList.addWord(word.toStdString());189 queryList.addWord(Word(word.toUtf8().constData()));
183 }190 }
184191
185 MatchResults matchResults(m_matcher.match(queryList));192 try {
186193 MatchResults matchResults(
187 int queryLength(query.length());194 m_matcher.onlineMatch(queryList, Word("command")));
188195
189 size_t maxResults = std::min(matchResults.size(), size_t(20));196 int queryLength(query.length());
190197
191 for (size_t i(0); i < maxResults; ++i) {198 size_t maxResults = std::min(matchResults.size(), size_t(20));
192 DocumentID id(matchResults.getDocumentID(i));199
193 double relevancy(matchResults.getRelevancy(i));200 for (size_t i(0); i < maxResults; ++i) {
194 addResult(id, stringMatcher, queryLength, relevancy, results);201 DocumentID id(matchResults.getDocumentID(i));
202 double relevancy(matchResults.getRelevancy(i));
203 addResult(id, stringMatcher, queryLength, relevancy, results);
204 }
205 } catch (std::invalid_argument &e) {
195 }206 }
196 }207 }
197208
198209
=== modified file 'service/QGSettingsSearchSettings.cpp'
--- service/QGSettingsSearchSettings.cpp 2014-02-15 10:23:45 +0000
+++ service/QGSettingsSearchSettings.cpp 2014-03-14 14:07:40 +0000
@@ -34,11 +34,11 @@
34}34}
3535
36uint QGSettingsSearchSettings::addPenalty() const {36uint QGSettingsSearchSettings::addPenalty() const {
37 return m_settings.get("addPenalty").toUInt() * 10;37 return m_settings.get("addPenalty").toUInt();
38}38}
3939
40uint QGSettingsSearchSettings::dropPenalty() const {40uint QGSettingsSearchSettings::dropPenalty() const {
41 return m_settings.get("dropPenalty").toUInt() * 10;41 return m_settings.get("dropPenalty").toUInt();
42}42}
4343
44uint QGSettingsSearchSettings::endDropPenalty() const {44uint QGSettingsSearchSettings::endDropPenalty() const {
4545
=== modified file 'tests/integration/TestHud.cpp'
--- tests/integration/TestHud.cpp 2014-01-24 14:25:22 +0000
+++ tests/integration/TestHud.cpp 2014-03-14 14:07:40 +0000
@@ -187,8 +187,8 @@
187 countChangedSpy.wait();187 countChangedSpy.wait();
188 }188 }
189 ASSERT_EQ(3, results.rowCount());189 ASSERT_EQ(3, results.rowCount());
190 EXPECT_EQ(ResultPair("swift sad", "piece hook"), result(results, 0));190 EXPECT_EQ(ResultPair("stray slash", "piece hook"), result(results, 0));
191 EXPECT_EQ(ResultPair("stray slash", "piece hook"), result(results, 1));191 EXPECT_EQ(ResultPair("swift sad", "piece hook"), result(results, 1));
192 EXPECT_EQ(ResultPair("bowl", "link"), result(results, 2));192 EXPECT_EQ(ResultPair("bowl", "link"), result(results, 2));
193}193}
194194
195195
=== modified file 'tests/unit/service/TestItemStore.cpp'
--- tests/unit/service/TestItemStore.cpp 2014-03-14 14:07:39 +0000
+++ tests/unit/service/TestItemStore.cpp 2014-03-14 14:07:40 +0000
@@ -222,8 +222,11 @@
222 QMenu root;222 QMenu root;
223223
224 QMenu file("File");224 QMenu file("File");
225 file.addAction("Banana");
226 file.addAction("Save All");
227 file.addAction("Save");
225 file.addAction("Save As...");228 file.addAction("Save As...");
226 file.addAction("Save");229 file.addAction("Apple");
227 root.addMenu(&file);230 root.addMenu(&file);
228231
229 store->indexMenu(&root);232 store->indexMenu(&root);

Subscribers

People subscribed via source and target branches