]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/V2Writable.pm
mbox: disable "&t" on existing Xapian until full reindex
[public-inbox.git] / lib / PublicInbox / V2Writable.pm
index 0a91a132bd93f9b373e400ae0d5a6c2afed06281..b0148dba4985d3e9a4d9534a559b10a0b32db5df 100644 (file)
@@ -1337,6 +1337,18 @@ sub index_sync {
                xapian_only($self, $opt, $sync, $art_beg);
        }
 
+       # --reindex on the command-line
+       if ($opt->{reindex} && !ref($opt->{reindex}) && $idxlevel ne 'basic') {
+               $self->lock_acquire;
+               my $s0 = PublicInbox::SearchIdx->new($self->{ibx}, 0, 0);
+               if (my $xdb = $s0->idx_acquire) {
+                       my $n = $xdb->get_metadata('has_threadid');
+                       $xdb->set_metadata('has_threadid', 1) if $n ne '1';
+               }
+               $s0->idx_release;
+               $self->lock_release;
+       }
+
        # reindex does not pick up new changes, so we rerun w/o it:
        if ($opt->{reindex}) {
                my %again = %$opt;