mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 07:04:57 +00:00
schedule document for reindexing when changing the mimetype or name
This commit is contained in:
parent
72509a09eb
commit
188d440560
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue
Block a user