From 592f8239dceb6604e538fd51e62bcce50d6e1972 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 17 Jul 2020 06:31:55 +0000 Subject: search: simplify unindexing Since over.sqlite3 seems here to stay, we no longer need to do Message-ID lookups against Xapian and can simply rely on the docid <=> NNTP article number equivalancy SCHEMA_VERSION=15 gave us. This rids us of the closure-using batch_do sub in the v1 code path and vastly simplifies both v1 and v2 unindexing. --- t/search.t | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 't') diff --git a/t/search.t b/t/search.t index 82caf9e4..aa6f94bf 100644 --- a/t/search.t +++ b/t/search.t @@ -397,7 +397,9 @@ $ibx->with_umask(sub { $ibx->with_umask(sub { my $amsg = eml_load 't/search-amsg.eml'; - ok($rw->add_message($amsg), 'added attachment'); + my $oid = ('0'x40); + my $smsg = bless { blob => $oid }, 'PublicInbox::Smsg'; + ok($rw->add_message($amsg, $smsg), 'added attachment'); $rw_commit->(); $ro->reopen; my $n = $ro->query('n:attached_fart.txt'); @@ -418,7 +420,7 @@ $ibx->with_umask(sub { $art = $ro->{over_ro}->next_by_mid($mid, \$id, \$prev); ok($art, 'article exists in OVER DB'); } - $rw->unindex_blob($amsg); + $rw->unindex_eml($oid, $amsg); $rw->commit_txn_lazy; SKIP: { skip('$art not defined', 1) unless defined $art; -- cgit v1.2.3-24-ge0c7