]> git.notmuchmail.org Git - sup/commitdiff
only use the first 255 characters of a message id (ferret bug workaround)
authorWilliam Morgan <wmorgan-sup@masanjin.net>
Mon, 25 Feb 2008 04:53:23 +0000 (20:53 -0800)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Mon, 25 Feb 2008 04:53:23 +0000 (20:53 -0800)
Apparently, constructing a TermQuery object with a field value of more than
255 characters never successfully matches.

This is not a good long-term solution. A good one would be to take the SHA1
of every message id instead. That will require an index rebuild, so I will
save that patch until later.

lib/sup/message.rb

index c06a03fa547a3d6c96dd19945fae0934b907c925..6a2a9c47a021e69003af0cad6a2f076fc9a1dd4a 100644 (file)
@@ -148,7 +148,7 @@ class Message
     @source.fn_for_offset @source_info
   end
 
-  def sanitize_message_id mid; mid.gsub(/\s/, "") end
+  def sanitize_message_id mid; mid.gsub(/\s+/, "")[0..254] end
 
   def save index
     return unless @dirty