unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Austin Clements <amdragon@gmail.com>
To: "Joel Borggrén-Franck" <joel.borggren.franck@gmail.com>
Cc: notmuch@notmuchmail.org
Subject: Re: [PATCH] add headers cc: bcc: and to: (as exactto:) to search index
Date: Sun, 12 Dec 2010 01:41:14 -0500	[thread overview]
Message-ID: <AANLkTinX_07ZucHbf6kVAsy-quauY+N9hMhJwKjMt1Dk@mail.gmail.com> (raw)
In-Reply-To: <1291235635-16523-1-git-send-email-joel.borggren.franck@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3145 bytes --]

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.

On Wed, Dec 1, 2010 at 3:33 PM, Joel Borggrén-Franck <
joel.borggren.franck@gmail.com> wrote:

> From: Joel Borggrén-Franck <jbf@codehouse.se>
>
> Add headers cc: bcc: and to: to index. Real header to: is searched as
> "exactto:foo@bar.baz" and search term "to:" is kept as a union of cc:,
> bcc: and to: for backward compatibility. Use search term "cc:" resp.
> "bcc:" to search those headers respectively.
> ---
>  lib/database.cc |   11 +++++++----
>  lib/index.cc    |    9 +++++++++
>  2 files changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/lib/database.cc b/lib/database.cc
> index 7a00917..68910f3 100644
> --- a/lib/database.cc
> +++ b/lib/database.cc
> @@ -88,9 +88,9 @@ typedef struct {
>  *     MESSAGE_ID:     The unique ID of the mail mess (see "id" above)
>  *
>  * In addition, terms from the content of the message are added with
> - * "from", "to", "attachment", and "subject" prefixes for use by the
> - * user in searching. But the database doesn't really care itself
> - * about any of these.
> + * "from", "to", "exactto", "cc", "bbc", "attachment" and "subject"
> + * prefixes for use by the user in searching. But the database doesn't
> + * really care itself about any of these.
>  *
>  * The data portion of a mail document is empty.
>  *
> @@ -204,7 +204,10 @@ static prefix_t PROBABILISTIC_PREFIX[]= {
>     { "from",                  "XFROM" },
>     { "to",                    "XTO" },
>     { "attachment",            "XATTACHMENT" },
> -    { "subject",               "XSUBJECT"}
> +    { "subject",               "XSUBJECT"},
> +    { "exactto",                "XEXACTTO"},
> +    { "cc",                     "XCC"},
> +    { "bcc",                    "XBCC"},
>  };
>
>  int
> diff --git a/lib/index.cc b/lib/index.cc
> index 00478f8..d59c255 100644
> --- a/lib/index.cc
> +++ b/lib/index.cc
> @@ -455,6 +455,15 @@ _notmuch_message_index_file (notmuch_message_t
> *message,
>
>     _index_address_list (message, "from", addresses);
>
> +    addresses = g_mime_message_get_recipients (mime_message,
> GMIME_RECIPIENT_TYPE_TO);
> +    _index_address_list (message, "exactto", addresses);
> +
> +    addresses = g_mime_message_get_recipients (mime_message,
> GMIME_RECIPIENT_TYPE_CC);
> +    _index_address_list (message, "cc", addresses);
> +
> +    addresses = g_mime_message_get_recipients (mime_message,
> GMIME_RECIPIENT_TYPE_BCC);
> +    _index_address_list (message, "bcc", addresses);
> +
>     addresses = g_mime_message_get_all_recipients (mime_message);
>     _index_address_list (message, "to", addresses);
>
> --
> 1.7.3.2
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
>

[-- Attachment #2: Type: text/html, Size: 4205 bytes --]

  parent reply	other threads:[~2010-12-12  6:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-01 20:33 [PATCH] add headers cc: bcc: and to: (as exactto:) to search index Joel Borggrén-Franck
2010-12-02 17:48 ` Dirk Hohndel
2010-12-03  5:49   ` Xavier Maillard
2010-12-12  6:41 ` Austin Clements [this message]
2010-12-12 10:43   ` Joel Borggrén-Franck
2010-12-12 19:39     ` Austin Clements
2010-12-12 22:01       ` servilio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTinX_07ZucHbf6kVAsy-quauY+N9hMhJwKjMt1Dk@mail.gmail.com \
    --to=amdragon@gmail.com \
    --cc=joel.borggren.franck@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).