From: Eric Wong Date: Fri, 3 Sep 2021 08:54:26 +0000 (+0000) Subject: lei_xsearch: avoid false-positives on externals w/ L: and kw: X-Git-Tag: v1.7.0~449 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=a3ad598c92039fae4a78354be9c33fff5328d7db;p=public-inbox.git lei_xsearch: avoid false-positives on externals w/ L: and kw: 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. --- diff --git a/lib/PublicInbox/LeiXSearch.pm b/lib/PublicInbox/LeiXSearch.pm index b9f0d692..b6d7bf2b 100644 --- a/lib/PublicInbox/LeiXSearch.pm +++ b/lib/PublicInbox/LeiXSearch.pm @@ -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);