Re: [PATCH] add headers cc: bcc: and to: (as exactto:) to search index
authorAustin Clements <amdragon@gmail.com>
Sun, 12 Dec 2010 19:39:27 +0000 (14:39 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:37:40 +0000 (09:37 -0800)
d7/fbbf4b7408c3b85397f5ebe2f10f024c1d4ab8 [new file with mode: 0644]

diff --git a/d7/fbbf4b7408c3b85397f5ebe2f10f024c1d4ab8 b/d7/fbbf4b7408c3b85397f5ebe2f10f024c1d4ab8
new file mode 100644 (file)
index 0000000..72c6777
--- /dev/null
@@ -0,0 +1,152 @@
+Return-Path: <amdragon@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id F2B99431FB6\r
+       for <notmuch@notmuchmail.org>; Sun, 12 Dec 2010 11:39:29 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.798\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.798 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id QnFEX9rjqioN for <notmuch@notmuchmail.org>;\r
+       Sun, 12 Dec 2010 11:39:29 -0800 (PST)\r
+Received: from mail-qw0-f53.google.com (mail-qw0-f53.google.com\r
+       [209.85.216.53])\r
+       by olra.theworths.org (Postfix) with ESMTP id 559A6431FB5\r
+       for <notmuch@notmuchmail.org>; Sun, 12 Dec 2010 11:39:29 -0800 (PST)\r
+Received: by qwe5 with SMTP id 5so5992414qwe.26\r
+       for <notmuch@notmuchmail.org>; Sun, 12 Dec 2010 11:39:27 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=domainkey-signature:mime-version:received:received:in-reply-to\r
+       :references:date:message-id:subject:from:to:cc:content-type;\r
+       bh=bgGWwMT4fngRF8Lz4DKjiU8sWhjQb1SRfjX7CrCeyCY=;\r
+       b=v7wgYdP7x8Vh3Kw5szoaXhWdLf26hmcMEgkb6IeLRcPefL87eczMnwYagw9BQMVM1e\r
+       1Oa9KxVCKw9Ci/UhI+Sj6DT/t78t3/GSdFD6NxXBUp5JFbvt6CaYq6EDZJM9APdwu3im\r
+       h7HtH2bo+sG04q81nqWkwNrNDLnvL8a+gsq4c=\r
+DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;\r
+       h=mime-version:in-reply-to:references:date:message-id:subject:from:to\r
+       :cc:content-type;\r
+       b=m1zxNtXjrDczRhsrHh0mH7UosdgL1/b7EgOyoqd7NLWCwggfvmjF0USzDpo37Hryl1\r
+       nQmOE5X6EoJ0B5P7lr3MuAceGkm4srnSCESFvt3O5A8ETHxtH8iZTuLApi4SeVT0OOzg\r
+       EXgYhNJu22KAG++eKAYLDgIhhokC8U2NBumxQ=\r
+MIME-Version: 1.0\r
+Received: by 10.229.95.193 with SMTP id e1mr2989002qcn.277.1292182767489; Sun,\r
+       12 Dec 2010 11:39:27 -0800 (PST)\r
+Received: by 10.229.224.202 with HTTP; Sun, 12 Dec 2010 11:39:27 -0800 (PST)\r
+In-Reply-To: <AANLkTik2ADv1fb4kD+=EOhQ+rkkQBVzRMnpyE5Z+7TJs@mail.gmail.com>\r
+References: <1291235635-16523-1-git-send-email-joel.borggren.franck@gmail.com>\r
+       <AANLkTinX_07ZucHbf6kVAsy-quauY+N9hMhJwKjMt1Dk@mail.gmail.com>\r
+       <AANLkTik2ADv1fb4kD+=EOhQ+rkkQBVzRMnpyE5Z+7TJs@mail.gmail.com>\r
+Date: Sun, 12 Dec 2010 14:39:27 -0500\r
+Message-ID: <AANLkTikDQgpeM-Ari2woxUgwpuAH3VVq-O-vQvOGU-hO@mail.gmail.com>\r
+Subject: Re: [PATCH] add headers cc: bcc: and to: (as exactto:) to search\r
+ index\r
+From: Austin Clements <amdragon@gmail.com>\r
+To: =?ISO-8859-1?Q?Joel_Borggr=E9n=2DFranck?= <joel.borggren.franck@gmail.com>\r
+Content-Type: multipart/alternative; boundary=0016368325acd752ae04973bbe6c\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 12 Dec 2010 19:39:30 -0000\r
+\r
+--0016368325acd752ae04973bbe6c\r
+Content-Type: text/plain; charset=ISO-8859-1\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+Add the "exactto", "cc", and "bcc" terms just like you do but *remove*\r
+the "to" term altogether.  Then in notmuch_database_open, after it's added\r
+the usual probabilistic prefixes, do something like\r
+  notmuch->query_parser->add_prefix ("to", _find_prefix ("exactto"));\r
+  notmuch->query_parser->add_prefix ("to", _find_prefix ("cc"));\r
+  notmuch->query_parser->add_prefix ("to", _find_prefix ("bcc"));\r
+I haven't tried this, but I believe the effect will be that a query of the\r
+form to:x will be expanded by the query parser to (exactto:x OR cc:x OR\r
+bcc:x), which should achieve what you want without any database overhead.\r
+ You might also want\r
+  notmuch->query_parser->add_prefix ("to", "XTO");\r
+to maintain some form of backwards compatibility.\r
+\r
+On Sun, Dec 12, 2010 at 5:43 AM, Joel Borggr=E9n-Franck <\r
+joel.borggren.franck@gmail.com> wrote:\r
+\r
+> On Sun, Dec 12, 2010 at 7:41 AM, Austin Clements <amdragon@gmail.com>\r
+> wrote:\r
+> > Short of full header indexing, wouldn't a better way to achieve this be\r
+> to\r
+> > store only the "to" header as "XTO", the "cc" header "XCC", and the "bc=\r
+c"\r
+> > header as "XBCC" and use Xapian's multi-prefix support to map the "to:"\r
+> > query prefix to "XTO", "XCC", and "XBCC"?  That way you're not storing\r
+> twice\r
+> > as many copies of  every address.\r
+> >\r
+>\r
+> Probably. I know nothing of Xapian, how would you solve it?\r
+>\r
+> cheers\r
+> /Joel\r
+>\r
+\r
+--0016368325acd752ae04973bbe6c\r
+Content-Type: text/html; charset=ISO-8859-1\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+Add the=A0&quot;exactto&quot;, &quot;cc&quot;, and &quot;bcc&quot; terms ju=\r
+st like you do but *remove* the=A0&quot;to&quot; term altogether. =A0Then i=\r
+n notmuch_database_open, after it&#39;s added the usual probabilistic prefi=\r
+xes, do something like<div>\r
+=A0=A0notmuch-&gt;query_parser-&gt;add_prefix (&quot;to&quot;, _find_prefix=\r
+ (&quot;exactto&quot;));</div><div><meta http-equiv=3D"content-type" conten=\r
+t=3D"text/html; charset=3Dutf-8">=A0=A0notmuch-&gt;query_parser-&gt;add_pre=\r
+fix (&quot;to&quot;, _find_prefix (&quot;cc&quot;));</div>\r
+<div><meta http-equiv=3D"content-type" content=3D"text/html; charset=3Dutf-=\r
+8">=A0=A0notmuch-&gt;query_parser-&gt;add_prefix (&quot;to&quot;, _find_pre=\r
+fix (&quot;bcc&quot;));<br>I haven&#39;t tried this, but I believe the effe=\r
+ct will be that a query of the form to:x will be expanded by the query pars=\r
+er to (exactto:x OR cc:x OR bcc:x), which should achieve what you want with=\r
+out any database overhead. =A0You might also want</div>\r
+<div><meta http-equiv=3D"content-type" content=3D"text/html; charset=3Dutf-=\r
+8">=A0=A0notmuch-&gt;query_parser-&gt;add_prefix (&quot;to&quot;, &quot;XTO=\r
+&quot;);</div><div>to maintain some form of backwards compatibility.</div><=\r
+div><br>\r
+<div class=3D"gmail_quote">On Sun, Dec 12, 2010 at 5:43 AM, Joel Borggr=E9n=\r
+-Franck <span dir=3D"ltr">&lt;<a href=3D"mailto:joel.borggren.franck@gmail.=\r
+com">joel.borggren.franck@gmail.com</a>&gt;</span> wrote:<br><blockquote cl=\r
+ass=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;p=\r
+adding-left:1ex;">\r
+<div class=3D"im">On Sun, Dec 12, 2010 at 7:41 AM, Austin Clements &lt;<a h=\r
+ref=3D"mailto:amdragon@gmail.com">amdragon@gmail.com</a>&gt; wrote:<br>\r
+&gt; Short of full header indexing, wouldn&#39;t a better way to achieve th=\r
+is be to<br>\r
+&gt; store only the &quot;to&quot; header as &quot;XTO&quot;, the &quot;cc&=\r
+quot; header &quot;XCC&quot;, and the &quot;bcc&quot;<br>\r
+&gt; header as &quot;XBCC&quot; and use Xapian&#39;s multi-prefix support t=\r
+o map the &quot;to:&quot;<br>\r
+&gt; query prefix to &quot;XTO&quot;, &quot;XCC&quot;, and &quot;XBCC&quot;=\r
+? =A0That way you&#39;re not storing twice<br>\r
+&gt; as many copies of =A0every address.<br>\r
+&gt;<br>\r
+<br>\r
+</div>Probably. I know nothing of Xapian, how would you solve it?<br>\r
+<br>\r
+cheers<br>\r
+<font color=3D"#888888">/Joel<br>\r
+</font></blockquote></div><br></div>\r
+\r
+--0016368325acd752ae04973bbe6c--\r