add more hooks for reindexing documents/folders

This commit is contained in:
Uwe Steinmann 2023-04-28 18:39:53 +02:00
parent 3dfcb8d581
commit 921eab9e54

View File

@ -13,6 +13,8 @@ function reindexDocumentOrFolderCallback($fulltextservice, $object) {
$hit = $lucenesearch->getDocument($object->getId());
elseif($object->isType('folder'))
$hit = $lucenesearch->getFolder($object->getId());
elseif($object->isType('documentcontent'))
$hit = $lucenesearch->getDocument($object->getDocument()->getId());
if($hit) {
$index->reindexDocument($hit->id);
$index->commit();
@ -84,5 +86,8 @@ if($settings->_enableFullSearch) {
$dms->addCallback('onPostSetKategories', 'reindexDocumentOrFolderCallback', $fulltextservice);
$dms->addCallback('onPostAddKategories', 'reindexDocumentOrFolderCallback', $fulltextservice);
$dms->addCallback('onPostRemoveKategories', 'reindexDocumentOrFolderCallback', $fulltextservice);
$dms->addCallback('onPostAddAttribute', 'reindexDocumentOrFolderCallback', $fulltextservice);
$dms->addCallback('onPostUpdateAttribute', 'reindexDocumentOrFolderCallback', $fulltextservice);
$dms->addCallback('onPostRemoveAttribute', 'reindexDocumentOrFolderCallback', $fulltextservice);
}