[PATCH] add headers cc: bcc: and to: (as exactto:) to search index

Austin Clements amdragon at gmail.com
Sun Dec 12 11:39:27 PST 2010


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én-Franck <
joel.borggren.franck at gmail.com> wrote:

> On Sun, Dec 12, 2010 at 7:41 AM, Austin Clements <amdragon at gmail.com>
> 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 "bcc"
> > 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20101212/eca43bc0/attachment.html>


More information about the notmuch mailing list