check field indexed instead of created

This commit is contained in:
Uwe Steinmann 2022-12-15 12:36:35 +01:00
parent 20d368ec99
commit 0186e1af00

View File

@ -42,17 +42,17 @@ class SeedDMS_View_Indexer_Process_Folder { /* {{{ */
if(($this->numdocs == 0) || !($hit = $lucenesearch->getFolder($folder->getId()))) {
echo " <span id=\"status_F".$folder->getID()."\" class=\"indexme indexstatus\" data-docid=\"F".$folder->getID()."\">".getMLText('index_waiting')."</span>";
} 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
* where added when a new document was added to the dms. In such
* a case the document content wasn't indexed.
*/
try {
$created = (int) $hit->getDocument()->getFieldValue('created');
$indexed = (int) $hit->getDocument()->getFieldValue('indexed');
} catch (/* Zend_Search_Lucene_ */Exception $e) {
$created = 0;
$indexed = 0;
}
if($created >= $folder->getDate() && !$this->forceupdate) {
if($indexed >= $folder->getDate() && !$this->forceupdate) {
echo "<span id=\"status_F".$folder->getID()."\" class=\"indexstatus\" data-docid=\"F".$folder->getID()."\">".getMLText('index_document_unchanged')."</span>";
} else {
$this->fulltextservice->Indexer()->delete($hit->id);
@ -70,18 +70,18 @@ class SeedDMS_View_Indexer_Process_Folder { /* {{{ */
if(($this->numdocs == 0) || !($hit = $lucenesearch->getDocument($document->getId()))) {
echo " <span id=\"status_D".$document->getID()."\" class=\"indexme indexstatus\" data-docid=\"D".$document->getID()."\">".getMLText('index_waiting')."</span>";
} 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
* where added when a new document was added to the dms. In such
* a case the document content wasn't indexed.
*/
try {
$created = (int) $hit->getDocument()->getFieldValue('created');
$indexed = (int) $hit->getDocument()->getFieldValue('indexed');
} catch (/* Zend_Search_Lucene_ */Exception $e) {
$created = 0;
$indexed = 0;
}
$content = $document->getLatestContent();
if($created >= $content->getDate() && !$this->forceupdate) {
if($indexed >= $content->getDate() && !$this->forceupdate) {
echo "<span id=\"status_D".$document->getID()."\" class=\"indexstatus\" data-docid=\"D".$document->getID()."\">".getMLText('index_document_unchanged')."</span>";
} else {
$this->fulltextservice->Indexer()->delete($hit->id);