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

Probably. I know nothing of Xapian, how would you solve it?

cheers
/Joel

--0016368325acd752ae04973bbe6c--