added code to purge obsolete messages when a compound document (esp. mbox) is shortened and a partial update is performed (no general purge). Else the orphan docs remained in the index potentially forever (needed actual reindex of the file by a full pass to go away)

This commit is contained in:
Jean-Francois Dockes
2013-04-22 11:32:49 +02:00
parent b88c28b856
commit 906e58feff
7 changed files with 291 additions and 74 deletions
+41
View File
@@ -0,0 +1,41 @@
#!/bin/sh
topdir=`dirname $0`/..
. $topdir/shared.sh
initvariables $0
d=${tstdata}/partialpurge/
# Check that partial purge works: the message orphaned by shortening
# the mbox should not exist in the index any more
(
cp $d/longmbox $d/testmbox
recollindex -Zi $d/testmbox
echo Should have 2 results: testmbox and longmbox:
recollq -q deletedmessageuniqueterm
echo
echo Changing file and reindexing
cp $d/shortmbox $d/testmbox
recollindex -Zi $d/testmbox
echo Should have 1 result: longmbox:
recollq -q deletedmessageuniqueterm
echo
echo Purging whole test file
recollindex -e $d/testmbox
echo Should have 1 result: longmbox:
recollq -q deletedmessageuniqueterm
echo Should have 2 results: longmbox shortmbox:
recollq -q stablemessageuniqueterm
) 2> $mystderr | egrep -v '^Recoll query: ' > $mystdout
diff -w ${myname}.txt $mystdout > $mydiffs 2>&1
checkresult
+18
View File
@@ -0,0 +1,18 @@
Should have 2 results: testmbox and longmbox:
2 results
message/rfc822 [file:///home/dockes/projets/fulltext/testrecoll/partialpurge/longmbox] [This email goes: deletedmessageuniqueterm] 755 bytes
message/rfc822 [file:///home/dockes/projets/fulltext/testrecoll/partialpurge/testmbox] [This email goes: deletedmessageuniqueterm] 755 bytes
Changing file and reindexing
Should have 1 result: longmbox:
1 results
message/rfc822 [file:///home/dockes/projets/fulltext/testrecoll/partialpurge/longmbox] [This email goes: deletedmessageuniqueterm] 755 bytes
Purging whole test file
Should have 1 result: longmbox:
1 results
message/rfc822 [file:///home/dockes/projets/fulltext/testrecoll/partialpurge/longmbox] [This email goes: deletedmessageuniqueterm] 755 bytes
Should have 2 results: longmbox shortmbox:
2 results
message/rfc822 [file:///home/dockes/projets/fulltext/testrecoll/partialpurge/longmbox] [This email remains: stablemessageuniqueterm] 759 bytes
message/rfc822 [file:///home/dockes/projets/fulltext/testrecoll/partialpurge/shortmbox] [This email remains: stablemessageuniqueterm] 1173 bytes