user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: Re: [PATCH] searchidx: fix -Lmedium for IDs and filenames
Date: Sat, 13 Mar 2021 18:43:42 -0400	[thread overview]
Message-ID: <YE1AHi7jJ+ocpMBm@dcvr> (raw)
In-Reply-To: <20210313154027.GA27788@dcvr>

Eric Wong <e@80x24.org> wrote:
>  sub index_headers ($$) {
>  	my ($self, $smsg) = @_;
> -	my @x = (from => 'A', # Author
> -		subject => 'S', to => 'XTO', cc => 'XCC');
> +	my @x = (from => 'A', to => 'XTO', cc => 'XCC'); # A: Author
> +	while (my ($field, $pfx) = splice(@x, 0, 2)) {
> +		my $val = $smsg->{$field};
> +		next if $val eq '';
> +		# include "(comments)" after the address, too, so not using
> +		# PublicInbox::Address::names or pairs
> +		index_text($self, $val, 1, $pfx);
> +
> +		# we need positional info for email addresses since they
> +		# can be considered phrases
> +		if ($self->{indexlevel} eq 'medium') {
> +			for my $addr (PublicInbox::Address::emails($val)) {
> +				index_phrase($self, $addr, 1, $pfx);
> +			}
> +		}
> +	}

I forgot to note email addresses are also handled as phrases
unconditionally.  In any case, pushed as
commit 64b557420689476493d752968d99ab8ae62bad9a

    searchidx: fix -Lmedium for IDs and filenames

    This fixes "m:", "l:", "f:", "t:", "c:", "dfn:", and "n:" search
    prefixes under indexlevel=medium when mixed with indexlevel=full
    inboxish.  We need positional data for Message-IDs, List-Id,
    email addresses and filenames for exact matches, though we still
    want to support wildcards.

    Fortunately the storage cost is still small as these prefixes
    tend to be small compared to message bodies.  These are NOT
    boolean terms since wildcard support and partial matching is
    desired.

      reply	other threads:[~2021-03-13 22:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-13 15:40 Eric Wong
2021-03-13 22:43 ` Eric Wong [this message]

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://public-inbox.org/README

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

  git send-email \
    --in-reply-to=YE1AHi7jJ+ocpMBm@dcvr \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    --subject='Re: [PATCH] searchidx: fix -Lmedium for IDs and filenames' \
    /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

Code repositories for project(s) associated with this inbox:

	https://80x24.org/public-inbox.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).