After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 619504 - don't clean-up search terms before querying tracker-store
don't clean-up search terms before querying tracker-store
Status: RESOLVED FIXED
Product: tracker
Classification: Core
Component: Search Tool
git master
Other Linux
: Normal normal
: ---
Assigned To: tracker-search-tool
Jamie McCracken
Depends on:
Blocks:
 
 
Reported: 2010-05-24 11:38 UTC by Tshepang Lekhonkhobe
Modified: 2010-05-27 14:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
a fix (1.39 KB, patch)
2010-05-24 11:43 UTC, Tshepang Lekhonkhobe
none Details | Review
there was a mistake in the other patch + I have added string normalization (1.86 KB, patch)
2010-05-25 07:42 UTC, Tshepang Lekhonkhobe
needs-work Details | Review

Description Tshepang Lekhonkhobe 2010-05-24 11:38:00 UTC
Query with the raw string the user has entered (IE, don't duplicate functionality already contained in the parser).
Comment 1 Tshepang Lekhonkhobe 2010-05-24 11:43:57 UTC
Created attachment 161853 [details] [review]
a fix
Comment 2 Aleksander Morgado 2010-05-24 11:48:32 UTC
Seems ok the patch.
Comment 3 Tshepang Lekhonkhobe 2010-05-25 07:42:45 UTC
Created attachment 161914 [details] [review]
there was a mistake in the other patch + I have added string normalization
Comment 4 Aleksander Morgado 2010-05-27 08:51:56 UTC
Review of attachment 161914 [details] [review]:

After some discussion in IRC, we believe that the history items shouldn't be modified, apart from these two things:
 * removal of leading and trailing whitespaces
 * normalization

Could you then remove the deletion of leading and trailing non-alphanumeric and non-underscore chars? The rules to know if a given word will give results or not are in the parser, and those rules shouldn't be duplicated anywhere, not even for the history items.


@@ -86,6 +86,8 @@ class TrackerSearchEntry  : ComboBoxEntry implements Gtk.Activatable
-             /* remove leading non-alphanumeric chars */
-             while(!txt[0].isalnum())
-                if txt[0] == '_'
-                    break
-                 txt = txt.slice(1, len--)
-                 if len < 3
-                     return false
@@ -93,6 +95,8 @@ class TrackerSearchEntry  : ComboBoxEntry implements Gtk.Activatable
-             /* remove trailing non-alphanumeric chars */
-             if(!txt[len - 1].isalnum())
-                 while(!txt[len - 2].isalnum())
-                    if txt[len - 2] == '_'
-                        break
-                     txt = txt.slice(0, len - 2)
-                     len--
-                     if len < 3
-                        return false
Comment 5 Aleksander Morgado 2010-05-27 14:57:34 UTC
This bug is now obsolete. See bug 619826.
Comment 6 Martyn Russell 2010-05-27 14:58:01 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.