From 2e1a7378395af3c1db61f26b106befbc42876622 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 4 Aug 2021 10:02:48 +0000 Subject: extindex: fix boost with partial runs Boost relies on knowledge of all inboxes in a given config file to work properly. So while we support indexing a subset of inboxes, we must still account for boost in inboxes we're not indexing. So split internal inbox groups into "known" and "active", where previously we only cared for inboxes which were being actively indexed. Furthermore, boost checks need to be applied when a message arrives in different inboxes across multiple invocations. Reported-by: Konstantin Ryabitsev Link: https://public-inbox.org/meta/20210802204058.vscbxs5q7xyolyu2@nitro.local/ --- t/extsearch.t | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 't') diff --git a/t/extsearch.t b/t/extsearch.t index d933b948..b03adc17 100644 --- a/t/extsearch.t +++ b/t/extsearch.t @@ -86,6 +86,18 @@ if ('with boost') { like($v2[0], qr/\Av2\.example.*?\b\Q$smsg->{blob}\E\b/, 'smsg->{blob} respects boost after reindex'); + # high boost added later + my $b2 = "$home/extindex-bb"; + ok(run_script([qw(-extindex), $b2, "$home/v1test"]), + 'extindex with low boost inbox only'); + ok(run_script([qw(-extindex), $b2, "$home/v2test"]), + 'extindex with high boost inbox only'); + $es = PublicInbox::ExtSearch->new($b2); + $smsg = $es->over->get_art(1); + $xref3 = $es->over->get_xref3($smsg->{num}); + like($v2[0], qr/\Av2\.example.*?\b\Q$smsg->{blob}\E\b/, + 'smsg->{blob} respected boost across 2 index runs'); + xsys([qw(git config --unset publicinbox.v1test.boost)], { GIT_CONFIG => $cfg_path }); xsys([qw(git config --unset publicinbox.v2test.boost)], -- cgit v1.2.3-24-ge0c7