[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sup-devel] [PATCH 2/4] index email addresses as text



This lets you search for an email address (or its component parts, since it's
indexed as a phrase) with no prefix.
---
 lib/sup/xapian_index.rb |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/lib/sup/xapian_index.rb b/lib/sup/xapian_index.rb
index c0b2f9f..6fa6c55 100644
--- a/lib/sup/xapian_index.rb
+++ b/lib/sup/xapian_index.rb
@@ -278,7 +278,8 @@ EOS
     'to_name' => 'TN',
     'name' => %w(FN TN),
     'attachment' => 'A',
-    '' => %w(S B FN TN A),
+    'email_text' => 'E',
+    '' => %w(S B FN TN A E),
   }
 
   # Unstemmed
@@ -459,6 +460,7 @@ EOS
     person_termer = lambda do |d|
       lambda do |p|
         doc.index_text p.name, PREFIX["#{d}_name"] if p.name
+        doc.index_text p.email, PREFIX['email_text']
         doc.add_term mkterm(:email, d, p.email)
       end
     end
-- 
1.6.5.2

_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel