about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/Search.pm3
-rw-r--r--lib/PublicInbox/SearchIdx.pm2
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm
index bc2b6985..82a6e541 100644
--- a/lib/PublicInbox/Search.pm
+++ b/lib/PublicInbox/Search.pm
@@ -41,7 +41,8 @@ use constant {
         # 12 - change YYYYMMDD value column to numeric
         # 13 - fix threading for empty References/In-Reply-To
         #      (commit 83425ef12e4b65cdcecd11ddcb38175d4a91d5a0)
-        SCHEMA_VERSION => 13,
+        # 14 - fix ghost root vivification
+        SCHEMA_VERSION => 14,
 
         # n.b. FLAG_PURE_NOT is expensive not suitable for a public website
         # as it could become a denial-of-service vector
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index 8a529c66..e4e3c81b 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -330,7 +330,7 @@ sub link_message {
                         merge_threads($self, $tid, $ptid);
                 }
         } else {
-                $tid = $self->next_thread_id;
+                $tid = defined $old_tid ? $old_tid : $self->next_thread_id;
         }
         $doc->add_term(xpfx('thread') . $tid);
 }