]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei_xsearch: avoid false-positives on externals w/ L: and kw:
authorEric Wong <e@80x24.org>
Fri, 3 Sep 2021 08:54:26 +0000 (08:54 +0000)
committerEric Wong <e@80x24.org>
Fri, 3 Sep 2021 08:57:35 +0000 (08:57 +0000)
We need to use LeiSearch->qparse_new to handle (and filter out)
"L:" and "kw:" search prefixes to avoid hitting false positives
when externals are involved.  Unfortunately, this doesn't work
for remote HTTP(S) externals, but those aren't enabled by
default.

lib/PublicInbox/LeiXSearch.pm

index b9f0d6924d4ca5c9617435e3d5081cc9c65db16e..b6d7bf2b9521573281a23fea68a4c6c42a573a5a 100644 (file)
@@ -161,6 +161,7 @@ sub query_one_mset { # for --threads and l2m w/o sort
        my ($srch, $over) = ($ibxish->search, $ibxish->over);
        my $dir = $ibxish->{inboxdir} // $ibxish->{topdir};
        return warn("$dir not indexed by Xapian\n") unless ($srch && $over);
+       bless $srch, 'PublicInbox::LeiSearch'; # for ->qparse_new
        my $mo = { %{$lei->{mset_opt}} }; # copy
        my $mset;
        my $each_smsg = $lei->{ovv}->ovv_each_smsg_cb($lei);