]> Sergey Matveev's repositories - public-inbox.git/commitdiff
v1: remove articles from overview DB
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Wed, 18 Apr 2018 09:13:06 +0000 (09:13 +0000)
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Wed, 18 Apr 2018 09:14:11 +0000 (09:14 +0000)
Otherwise articles show up again...

lib/PublicInbox/SearchIdx.pm
t/search.t

index f9b40b0db5a9968c0bdf11de0dfffa628ae08d95..fd76627791f681cb20ff545d0496ea10ccd35284 100644 (file)
@@ -385,11 +385,13 @@ sub remove_message {
        my $db = $self->{xdb};
        my $called;
        $mid = mid_clean($mid);
+       my $over = $self->{over};
 
        eval {
                batch_do($self, 'Q' . $mid, sub {
                        my ($ids) = @_;
                        $db->delete_document($_) for @$ids;
+                       $over->delete_articles($ids) if $over;
                        $called = 1;
                });
        };
index 516f5670b0156b889ea3f2b4016e715944b41436..48c2511c80723be2712e92ec9d1dc1c1fd749795 100644 (file)
@@ -409,8 +409,15 @@ sub filter_mids {
        my $txt = $ro->query('"inside another"');
        is($txt->[0]->mid, $res->[0]->mid,
                'search inside text attachments works');
+
+       my $mid = $n->[0]->mid;
+       my ($id, $prev);
+       my $art = $ro->next_by_mid($mid, \$id, \$prev);
+       ok($art, 'article exists in OVER DB');
+       $rw->unindex_blob($amsg);
+       $rw->commit_txn_lazy;
+       is($ro->lookup_article($art->{num}), undef, 'gone from OVER DB');
 }
-$rw->commit_txn_lazy;
 
 done_testing();