if ($arg->{menuaction} == 1 || $arg->{menuaction} == 2) {
if ($topic == 0) {
open (TMP, ">> $DCONF->{admin_dir}/msg_index/$tn-tree.TMP") || error_message("File Write Error", "Could not create temporary tree index file in 'msg_index' directory!");
open (TMP, ">> $DCONF->{admin_dir}/msg_index/$tn-search.TMP") || error_message("File Write Error", "Could not create temporary search index file in 'msg_index' directory!");
$topic = $tn;
$fileopen = 1;
}
my $messages = build_search_data($tn, $pn);
foreach my $m (@{ $messages }) {
print TMP search_hash_to_line($m);
}
}
$ctr++;
if ($ctr % 10 == 0) {
last if time > ($timer+2+$GLOBAL_OPTIONS->{reindex_secs});
}
}
close (TMP) if $fileopen;
my $res = incremental({ operation => "write", data => $tempfile->{data}, tempfile => $arg->{tempfile} });