]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
searchidx: fix --split-shards with SWIG Xapian.pm master
authorEric Wong <e@80x24.org>
Mon, 24 Nov 2025 20:04:34 +0000 (20:04 +0000)
committerEric Wong <e@80x24.org>
Mon, 24 Nov 2025 20:22:13 +0000 (20:22 +0000)
SWIG Xapian.pm is stricter about types and won't automatically
stringify integer scalars whereas the old XS Search::Xapian
supported more Perl-like behavior.  So we'll stringify manually
to appease the SWIG binding.

Reported-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Tested-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
lib/PublicInbox/SearchIdx.pm

index 13bf4544c5710bed52aeb05ab35cc20ab9856d20..a705b6acdb5deea28f6c889da55685ed718245d7 100644 (file)
@@ -255,7 +255,7 @@ EOM
                        $self->{-opt}->{'split-at'} = $cur;
                } else {
                        $cur ||= $new // $SHARD_SPLIT_AT;
-                       $xdb->set_metadata('split-at', $cur);
+                       $xdb->set_metadata('split-at', "$cur");
                        $self->{-do_join_splits} = 1;
                }
                $self->{-doc_max} = $xdb->get_lastdocid || $cur;