1 Return-Path: <amdragon@gmail.com>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 58BC8431FB6
\r
6 for <notmuch@notmuchmail.org>; Sat, 11 Dec 2010 22:41:20 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.798 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7]
\r
15 Received: from olra.theworths.org ([127.0.0.1])
\r
16 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id kwFQWFOED6bU for <notmuch@notmuchmail.org>;
\r
18 Sat, 11 Dec 2010 22:41:18 -0800 (PST)
\r
19 Received: from mail-qw0-f53.google.com (mail-qw0-f53.google.com
\r
21 by olra.theworths.org (Postfix) with ESMTP id DBC59431FB5
\r
22 for <notmuch@notmuchmail.org>; Sat, 11 Dec 2010 22:41:17 -0800 (PST)
\r
23 Received: by qwe5 with SMTP id 5so5614323qwe.26
\r
24 for <notmuch@notmuchmail.org>; Sat, 11 Dec 2010 22:41:16 -0800 (PST)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
\r
26 h=domainkey-signature:mime-version:received:received:in-reply-to
\r
27 :references:date:message-id:subject:from:to:cc:content-type;
\r
28 bh=llB8BCqwR/r5jhLhdb2Q6t7G6dKIXiNFXmrv3naNLkk=;
\r
29 b=m82jRWVNMKoO8lr85WEWPUrzMqpFS0MpQyJeheFnoKzDmRERT+fMHVoHtjwNkF3iWl
\r
30 +4W3I5bgH4CJhDUWEn/NhFXwjtgTbPCXLF1fMB9sZJlF0C59LJwRgG5p3AwG/2FFTkm9
\r
31 2faC7QpS9HUSr9o5lRQF+EIDXZ2PReWysGGmQ=
\r
32 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
\r
33 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
\r
35 b=WW84QZgBosom94dpMRGIPKavmXRKKiax4MbXMgeQNcWaNNyeF+5bn2RO/rrjvpxn2e
\r
36 4BD1GHdwW9UuWHNRr9yGLCMMuvZNwcIbz7T8J8iH8Ti/5eaBBbIVyXWRbd1AdT4EaGwH
\r
37 vtcM0E8Wag/97GeVaDGaKEBwV4CiO6ZkwGhb0=
\r
39 Received: by 10.229.235.4 with SMTP id ke4mr2483152qcb.201.1292136074473; Sat,
\r
40 11 Dec 2010 22:41:14 -0800 (PST)
\r
41 Received: by 10.229.224.202 with HTTP; Sat, 11 Dec 2010 22:41:14 -0800 (PST)
\r
43 <1291235635-16523-1-git-send-email-joel.borggren.franck@gmail.com>
\r
44 References: <1291235635-16523-1-git-send-email-joel.borggren.franck@gmail.com>
\r
45 Date: Sun, 12 Dec 2010 01:41:14 -0500
\r
46 Message-ID: <AANLkTinX_07ZucHbf6kVAsy-quauY+N9hMhJwKjMt1Dk@mail.gmail.com>
\r
47 Subject: Re: [PATCH] add headers cc: bcc: and to: (as exactto:) to search
\r
49 From: Austin Clements <amdragon@gmail.com>
\r
50 To: =?ISO-8859-1?Q?Joel_Borggr=E9n=2DFranck?= <joel.borggren.franck@gmail.com>
\r
51 Content-Type: multipart/alternative; boundary=0016e6465148b87303049730dfea
\r
52 Cc: notmuch@notmuchmail.org
\r
53 X-BeenThere: notmuch@notmuchmail.org
\r
54 X-Mailman-Version: 2.1.13
\r
56 List-Id: "Use and development of the notmuch mail system."
\r
57 <notmuch.notmuchmail.org>
\r
58 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
59 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
60 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
61 List-Post: <mailto:notmuch@notmuchmail.org>
\r
62 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
63 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
64 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
65 X-List-Received-Date: Sun, 12 Dec 2010 06:41:21 -0000
\r
67 --0016e6465148b87303049730dfea
\r
68 Content-Type: text/plain; charset=ISO-8859-1
\r
69 Content-Transfer-Encoding: quoted-printable
\r
71 Short of full header indexing, wouldn't a better way to achieve this be to
\r
72 store only the "to" header as "XTO", the "cc" header "XCC", and the "bcc"
\r
73 header as "XBCC" and use Xapian's multi-prefix support to map the "to:"
\r
74 query prefix to "XTO", "XCC", and "XBCC"? That way you're not storing twic=
\r
76 as many copies of every address.
\r
78 On Wed, Dec 1, 2010 at 3:33 PM, Joel Borggr=E9n-Franck <
\r
79 joel.borggren.franck@gmail.com> wrote:
\r
81 > From: Joel Borggr=E9n-Franck <jbf@codehouse.se>
\r
83 > Add headers cc: bcc: and to: to index. Real header to: is searched as
\r
84 > "exactto:foo@bar.baz" and search term "to:" is kept as a union of cc:,
\r
85 > bcc: and to: for backward compatibility. Use search term "cc:" resp.
\r
86 > "bcc:" to search those headers respectively.
\r
88 > lib/database.cc | 11 +++++++----
\r
89 > lib/index.cc | 9 +++++++++
\r
90 > 2 files changed, 16 insertions(+), 4 deletions(-)
\r
92 > diff --git a/lib/database.cc b/lib/database.cc
\r
93 > index 7a00917..68910f3 100644
\r
94 > --- a/lib/database.cc
\r
95 > +++ b/lib/database.cc
\r
96 > @@ -88,9 +88,9 @@ typedef struct {
\r
97 > * MESSAGE_ID: The unique ID of the mail mess (see "id" above)
\r
99 > * In addition, terms from the content of the message are added with
\r
100 > - * "from", "to", "attachment", and "subject" prefixes for use by the
\r
101 > - * user in searching. But the database doesn't really care itself
\r
102 > - * about any of these.
\r
103 > + * "from", "to", "exactto", "cc", "bbc", "attachment" and "subject"
\r
104 > + * prefixes for use by the user in searching. But the database doesn't
\r
105 > + * really care itself about any of these.
\r
107 > * The data portion of a mail document is empty.
\r
109 > @@ -204,7 +204,10 @@ static prefix_t PROBABILISTIC_PREFIX[]=3D {
\r
110 > { "from", "XFROM" },
\r
112 > { "attachment", "XATTACHMENT" },
\r
113 > - { "subject", "XSUBJECT"}
\r
114 > + { "subject", "XSUBJECT"},
\r
115 > + { "exactto", "XEXACTTO"},
\r
116 > + { "cc", "XCC"},
\r
117 > + { "bcc", "XBCC"},
\r
121 > diff --git a/lib/index.cc b/lib/index.cc
\r
122 > index 00478f8..d59c255 100644
\r
123 > --- a/lib/index.cc
\r
124 > +++ b/lib/index.cc
\r
125 > @@ -455,6 +455,15 @@ _notmuch_message_index_file (notmuch_message_t
\r
128 > _index_address_list (message, "from", addresses);
\r
130 > + addresses =3D g_mime_message_get_recipients (mime_message,
\r
131 > GMIME_RECIPIENT_TYPE_TO);
\r
132 > + _index_address_list (message, "exactto", addresses);
\r
134 > + addresses =3D g_mime_message_get_recipients (mime_message,
\r
135 > GMIME_RECIPIENT_TYPE_CC);
\r
136 > + _index_address_list (message, "cc", addresses);
\r
138 > + addresses =3D g_mime_message_get_recipients (mime_message,
\r
139 > GMIME_RECIPIENT_TYPE_BCC);
\r
140 > + _index_address_list (message, "bcc", addresses);
\r
142 > addresses =3D g_mime_message_get_all_recipients (mime_message);
\r
143 > _index_address_list (message, "to", addresses);
\r
148 > _______________________________________________
\r
149 > notmuch mailing list
\r
150 > notmuch@notmuchmail.org
\r
151 > http://notmuchmail.org/mailman/listinfo/notmuch
\r
154 --0016e6465148b87303049730dfea
\r
155 Content-Type: text/html; charset=ISO-8859-1
\r
156 Content-Transfer-Encoding: quoted-printable
\r
158 Short of full header indexing, wouldn't a better way to achieve this be=
\r
159 to store only the "to" header as "XTO", the "cc&q=
\r
160 uot; header "XCC", and the "bcc" header as "XBCC&q=
\r
161 uot; and use Xapian's multi-prefix support to map the "to:" q=
\r
162 uery prefix to "XTO", "XCC", and "XBCC"? =A0T=
\r
163 hat way you're not storing twice as many copies of =A0every address.<br=
\r
165 <br><div class=3D"gmail_quote">On Wed, Dec 1, 2010 at 3:33 PM, Joel Borggr=
\r
166 =E9n-Franck <span dir=3D"ltr"><<a href=3D"mailto:joel.borggren.franck@gm=
\r
167 ail.com">joel.borggren.franck@gmail.com</a>></span> wrote:<br><blockquot=
\r
168 e class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc sol=
\r
169 id;padding-left:1ex;">
\r
170 From: Joel Borggr=E9n-Franck <<a href=3D"mailto:jbf@codehouse.se">jbf@co=
\r
171 dehouse.se</a>><br>
\r
173 Add headers cc: bcc: and to: to index. Real header to: is searched as<br>
\r
174 "exactto:foo@bar.baz" and search term "to:" is kept as =
\r
175 a union of cc:,<br>
\r
176 bcc: and to: for backward compatibility. Use search term "cc:" re=
\r
178 "bcc:" to search those headers respectively.<br>
\r
180 =A0lib/database.cc | =A0 11 +++++++----<br>
\r
181 =A0lib/index.cc =A0 =A0| =A0 =A09 +++++++++<br>
\r
182 =A02 files changed, 16 insertions(+), 4 deletions(-)<br>
\r
184 diff --git a/lib/database.cc b/lib/database.cc<br>
\r
185 index 7a00917..68910f3 100644<br>
\r
186 --- a/lib/database.cc<br>
\r
187 +++ b/lib/database.cc<br>
\r
188 @@ -88,9 +88,9 @@ typedef struct {<br>
\r
189 =A0* =A0 =A0 MESSAGE_ID: =A0 =A0 The unique ID of the mail mess (see "=
\r
190 ;id" above)<br>
\r
192 =A0* In addition, terms from the content of the message are added with<br>
\r
193 - * "from", "to", "attachment", and "sub=
\r
194 ject" prefixes for use by the<br>
\r
195 - * user in searching. But the database doesn't really care itself<br>
\r
196 - * about any of these.<br>
\r
197 + * "from", "to", "exactto", "cc", =
\r
198 "bbc", "attachment" and "subject"<br>
\r
199 + * prefixes for use by the user in searching. But the database doesn't=
\r
201 + * really care itself about any of these.<br>
\r
203 =A0* The data portion of a mail document is empty.<br>
\r
205 @@ -204,7 +204,10 @@ static prefix_t PROBABILISTIC_PREFIX[]=3D {<br>
\r
206 =A0 =A0 { "from", =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"XFROM=
\r
208 =A0 =A0 { "to", =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"XTO=
\r
210 =A0 =A0 { "attachment", =A0 =A0 =A0 =A0 =A0 =A0"XATTACHMENT=
\r
212 - =A0 =A0{ "subject", =A0 =A0 =A0 =A0 =A0 =A0 =A0 "XSUBJECT&=
\r
214 + =A0 =A0{ "subject", =A0 =A0 =A0 =A0 =A0 =A0 =A0 "XSUBJECT&=
\r
216 + =A0 =A0{ "exactto", =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"XEXACT=
\r
218 + =A0 =A0{ "cc", =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "XC=
\r
220 + =A0 =A0{ "bcc", =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"XB=
\r
225 diff --git a/lib/index.cc b/lib/index.cc<br>
\r
226 index 00478f8..d59c255 100644<br>
\r
227 --- a/lib/index.cc<br>
\r
228 +++ b/lib/index.cc<br>
\r
229 @@ -455,6 +455,15 @@ _notmuch_message_index_file (notmuch_message_t *messag=
\r
232 =A0 =A0 _index_address_list (message, "from", addresses);<br>
\r
234 + =A0 =A0addresses =3D g_mime_message_get_recipients (mime_message, GMIME_R=
\r
235 ECIPIENT_TYPE_TO);<br>
\r
236 + =A0 =A0_index_address_list (message, "exactto", addresses);<br>
\r
238 + =A0 =A0addresses =3D g_mime_message_get_recipients (mime_message, GMIME_R=
\r
239 ECIPIENT_TYPE_CC);<br>
\r
240 + =A0 =A0_index_address_list (message, "cc", addresses);<br>
\r
242 + =A0 =A0addresses =3D g_mime_message_get_recipients (mime_message, GMIME_R=
\r
243 ECIPIENT_TYPE_BCC);<br>
\r
244 + =A0 =A0_index_address_list (message, "bcc", addresses);<br>
\r
246 =A0 =A0 addresses =3D g_mime_message_get_all_recipients (mime_message);<br=
\r
248 =A0 =A0 _index_address_list (message, "to", addresses);<br>
\r
249 <font color=3D"#888888"><br>
\r
253 _______________________________________________<br>
\r
254 notmuch mailing list<br>
\r
255 <a href=3D"mailto:notmuch@notmuchmail.org">notmuch@notmuchmail.org</a><br>
\r
256 <a href=3D"http://notmuchmail.org/mailman/listinfo/notmuch" target=3D"_blan=
\r
257 k">http://notmuchmail.org/mailman/listinfo/notmuch</a><br>
\r
258 </font></blockquote></div><br>
\r
260 --0016e6465148b87303049730dfea--
\r