fulltext index uses 'indexed' instead of 'created'

This commit is contained in:
Uwe Steinmann 2022-12-15 12:46:54 +01:00
parent 9e9c0c8ac5
commit e141892934

View File

@ -157,17 +157,17 @@ class SeedDMS_Task_Indexer_Process_Folder { /* {{{ */
echo "(Timeout)".PHP_EOL; echo "(Timeout)".PHP_EOL;
} }
} else { } else {
/* Check if the attribute created is set or has a value older /* Check if the attribute indexed is set or has a value older
* than the lastet content. Folders without such an attribute * than the lastet content. Folders without such an attribute
* where added when a new folder was added to the dms. In such * where added when a new folder was added to the dms. In such
* a case the folder content wasn't indexed. * a case the folder content wasn't indexed.
*/ */
try { try {
$created = (int) $hit->getDocument()->getFieldValue('created'); $indexed = (int) $hit->getDocument()->getFieldValue('indexed');
} catch (/* Zend_Search_Lucene_ */Exception $e) { } catch (/* Zend_Search_Lucene_ */Exception $e) {
$created = 0; $indexed = 0;
} }
if($created >= $folder->getDate() && !$this->forceupdate) { if($indexed >= $folder->getDate() && !$this->forceupdate) {
echo "(".getMLText('index_folder_unchanged').")".PHP_EOL; echo "(".getMLText('index_folder_unchanged').")".PHP_EOL;
} else { } else {
$this->fulltextservice->Indexer()->delete($hit->id); $this->fulltextservice->Indexer()->delete($hit->id);
@ -212,18 +212,18 @@ class SeedDMS_Task_Indexer_Process_Folder { /* {{{ */
echo "(Timeout)".PHP_EOL; echo "(Timeout)".PHP_EOL;
} }
} else { } else {
/* Check if the attribute created is set or has a value older /* Check if the attribute indexed is set or has a value older
* than the lastet content. Documents without such an attribute * than the lastet content. Documents without such an attribute
* where added when a new document was added to the dms. In such * where added when a new document was added to the dms. In such
* a case the document content wasn't indexed. * a case the document content wasn't indexed.
*/ */
try { try {
$created = (int) $hit->getDocument()->getFieldValue('created'); $indexed = (int) $hit->getDocument()->getFieldValue('indexed');
} catch (/* Zend_Search_Lucene_ */Exception $e) { } catch (/* Zend_Search_Lucene_ */Exception $e) {
$created = 0; $indexed = 0;
} }
$content = $document->getLatestContent(); $content = $document->getLatestContent();
if($created >= $content->getDate() && !$this->forceupdate) { if($indexed >= $content->getDate() && !$this->forceupdate) {
echo "(".getMLText('index_document_unchanged').")".PHP_EOL; echo "(".getMLText('index_document_unchanged').")".PHP_EOL;
} else { } else {
$this->fulltextservice->Indexer()->delete($hit->id); $this->fulltextservice->Indexer()->delete($hit->id);