GNOME Bugzilla – Bug 619504
don't clean-up search terms before querying tracker-store
Last modified: 2010-05-27 14:58:01 UTC
Query with the raw string the user has entered (IE, don't duplicate functionality already contained in the parser).
Created attachment 161853 [details] [review] a fix
Seems ok the patch.
Created attachment 161914 [details] [review] there was a mistake in the other patch + I have added string normalization
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
This bug is now obsolete. See bug 619826.
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.