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<div>
  notmuch->query_parser->add_prefix ("to", _find_prefix ("exactto"));</div><div><meta http-equiv="content-type" content="text/html; charset=utf-8">  notmuch->query_parser->add_prefix ("to", _find_prefix ("cc"));</div>
<div><meta http-equiv="content-type" content="text/html; charset=utf-8">  notmuch->query_parser->add_prefix ("to", _find_prefix ("bcc"));<br>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</div>
<div><meta http-equiv="content-type" content="text/html; charset=utf-8">  notmuch->query_parser->add_prefix ("to", "XTO");</div><div>to maintain some form of backwards compatibility.</div><div><br>
<div class="gmail_quote">On Sun, Dec 12, 2010 at 5:43 AM, Joel Borggrén-Franck <span dir="ltr"><<a href="mailto:joel.borggren.franck@gmail.com">joel.borggren.franck@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Sun, Dec 12, 2010 at 7:41 AM, Austin Clements <<a href="mailto:amdragon@gmail.com">amdragon@gmail.com</a>> wrote:<br>
> Short of full header indexing, wouldn't a better way to achieve this be to<br>
> store only the "to" header as "XTO", the "cc" header "XCC", and the "bcc"<br>
> header as "XBCC" and use Xapian's multi-prefix support to map the "to:"<br>
> query prefix to "XTO", "XCC", and "XBCC"?  That way you're not storing twice<br>
> as many copies of  every address.<br>
><br>
<br>
</div>Probably. I know nothing of Xapian, how would you solve it?<br>
<br>
cheers<br>
<font color="#888888">/Joel<br>
</font></blockquote></div><br></div>