about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-08-04 10:02:48 +0000
committerEric Wong <e@80x24.org>2021-08-04 23:47:15 +0000
commit2e1a7378395af3c1db61f26b106befbc42876622 (patch)
tree3e7be6e288599f6f6a5de0f8bade7aa872a96567 /t
parent00fdf28595247e14fe82dbc0b61f778a0f4b41f7 (diff)
downloadpublic-inbox-2e1a7378395af3c1db61f26b106befbc42876622.tar.gz
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 <konstantin@linuxfoundation.org>
Link: https://public-inbox.org/meta/20210802204058.vscbxs5q7xyolyu2@nitro.local/
Diffstat (limited to 't')
-rw-r--r--t/extsearch.t12
1 files changed, 12 insertions, 0 deletions
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)],