schedule document for reindexing when changing the mimetype or name

This commit is contained in:
Uwe Steinmann 2024-05-02 18:12:41 +02:00
parent 72509a09eb
commit 188d440560

View File

@ -626,6 +626,13 @@ switch($command) {
if($notifier) {
$notifier->sendChangedNameMail($document, $user, $oldname);
}
if($fulltextservice && ($index = $fulltextservice->Indexer())) {
$lucenesearch = $fulltextservice->Search();
if($hit = $lucenesearch->getDocument($document->getId())) {
$index->reindexDocument($hit->id);
$index->commit();
}
}
header('Content-Type: application/json');
echo json_encode(array('success'=>true, 'message'=>getMLText('splash_document_name_changed'), 'data'=>''));
add_log_line("set name '".$_REQUEST['name']."' of document ".$document->getId());
@ -657,6 +664,13 @@ switch($command) {
header('Content-Type: application/json');
echo json_encode(array('success'=>false, 'message'=>'Error setting mimetype', 'data'=>''));
} else {
if($fulltextservice && ($index = $fulltextservice->Indexer())) {
$lucenesearch = $fulltextservice->Search();
if($hit = $lucenesearch->getDocument($document->getId())) {
$index->reindexDocument($hit->id);
$index->commit();
}
}
header('Content-Type: application/json');
echo json_encode(array('success'=>true, 'message'=>getMLText('splash_mimetype_changed'), 'data'=>''));
add_log_line("set mimetype '".$realmimetype."' of document ".$document->getId().":".$content->getVersion());