X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=lib%2Fsup%2Fxapian_index.rb;fp=lib%2Fsup%2Fxapian_index.rb;h=e1cfe65a0c1266d6280d79d5e5fda8c310bd0508;hb=3f08a0191a824c5d6e7731a3d25106d1a0c3931e;hp=1395601367ef49fdebb9ef5019a82a07a0c83ca3;hpb=9a3d7fa7473b5852bc65a562fa3e8d8964d16c0e;p=sup diff --git a/lib/sup/xapian_index.rb b/lib/sup/xapian_index.rb index 1395601..e1cfe65 100644 --- a/lib/sup/xapian_index.rb +++ b/lib/sup/xapian_index.rb @@ -16,6 +16,13 @@ class XapianIndex < BaseIndex MIN_DATE = Time.at 0 MAX_DATE = Time.at(2**31-1) + HookManager.register "custom-search", < s) || s + subs = subs.gsub(/\b(to|from):(\S+)\b/) do field, name = $1, $2 if(p = ContactManager.contact_for(name)) [field, p.email]