Index: src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs
===================================================================
--- src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs	(revision 5085)
+++ src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs	(working copy)
@@ -52,7 +52,7 @@
         // NOTE: Whenever there is a change in ANY of the database schema,
         //       this version MUST be incremented and a migration method
         //       MUST be supplied to match the new version number
-        protected const int CURRENT_VERSION = 25;
+        protected const int CURRENT_VERSION = 26;
         protected const int CURRENT_METADATA_VERSION = 5;
         
 #region Migration Driver
@@ -592,6 +592,16 @@
         
 #endregion
 
+#region Version 26
+
+        [DatabaseVersion (26)]
+        private bool Migrate_26 ()
+        {
+            return Migrate_23 ();
+        }
+        
+#endregion
+
 #pragma warning restore 0169
         
 #region Fresh database setup
Index: src/Libraries/Hyena/Hyena/StringUtil.cs
===================================================================
--- src/Libraries/Hyena/Hyena/StringUtil.cs	(revision 5085)
+++ src/Libraries/Hyena/Hyena/StringUtil.cs	(working copy)
@@ -183,14 +183,18 @@
             val = val.ToLower ();
             StringBuilder sb = new StringBuilder ();
             UnicodeCategory category;
-            bool previous_was_latin = false;
+            bool previous_was_latin = false, previous_was_space = false;
             
+
             // Normalizing to KD splits into (base, combining) so we can check for Latin
             // characters and then strip off any NonSpacingMarks following them
-            foreach (char c in val.Normalize (NormalizationForm.FormKD)) {
+            foreach (char c in val.Normalize (NormalizationForm.FormKD).Trim ()) {
                 category = Char.GetUnicodeCategory (c);
 
-                if (ignored_special_cases.ContainsKey (c)) {
+                if (c == ' ') {
+                    if (!previous_was_space)
+                        sb.Append (c);
+                } else if (ignored_special_cases.ContainsKey (c)) {
                     sb.Append (ignored_special_cases[c]);
                 } else if (category == UnicodeCategory.OtherPunctuation) {
                     // Skip punctuation
@@ -200,6 +204,8 @@
 
                 // Can ignore A-Z because we've already lowercased the char
                 previous_was_latin = (c >= 'a' && c <= 'z');
+
+                previous_was_space = (c == ' ');
             }
             
             return sb.ToString ().Normalize (NormalizationForm.FormKC);
Index: src/Libraries/Hyena/Hyena.Query/Tests/QueryTests.cs
===================================================================
--- src/Libraries/Hyena/Hyena.Query/Tests/QueryTests.cs	(revision 5085)
+++ src/Libraries/Hyena/Hyena.Query/Tests/QueryTests.cs	(working copy)
@@ -217,7 +217,19 @@
                 MimeTypeField.ToSql (StringQueryValue.Contains, val)
             );
         }
-		
+
+        [Test] // http://bugzilla.gnome.org/show_bug.cgi?id=573484
+        public void TrimMultipleSpaces ()
+        {
+            QueryValue val = new StringQueryValue ();
+            val.ParseUserQuery ("   Testing  Spaces  "); //yes, there are some spaces in purpose
+
+            Assert.AreEqual (
+                "(CoreArtists.NameLowered LIKE '%testing spaces%' ESCAPE '\\' AND CoreArtists.NameLowered IS NOT NULL)",
+                ArtistField.ToSql (StringQueryValue.Contains, val)
+            );
+        }
+
         [Test]
         // Test behavior issues described in
         // http://bugzilla.gnome.org/show_bug.cgi?id=547078
