Commit 7f38b3aa7b01af5dd82d824e588bc903335c4a96

Authored by kevin_fourie
1 parent 06e9b0a0

Merged in from DEV trunk...

KTC-327
"The Document Indexing Diagostics does not show problems when in reality they exist"
Fixed.

Committed By: Conrad Vermeulen
Reviewed By: Jonathan Byrne

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/trunk@8068 c91229c3-7414-0410-bfa2-8a42b809f60b
search2/indexing/extractorCore.inc.php
... ... @@ -370,10 +370,7 @@ abstract class ExternalDocumentExtractor extends DocumentExtractor
370 370 $script_name = $script_prefix . '.bat';
371 371  
372 372 $script = "rem This is an auto generated file. \n";
373   - $script .= $cmd . ' 2> "' . $script_out . "\"\r\n";
374   -
375   -
376   -
  373 + $script .= $cmd . ' 2>>"' . $script_out . '" >>"' . $script_out . "\"\r\n";
377 374 }
378 375 else
379 376 {
... ... @@ -381,7 +378,7 @@ abstract class ExternalDocumentExtractor extends DocumentExtractor
381 378  
382 379 $script = "#!/bin/sh\n";
383 380 $script .= "# This is an auto generated file. \n";
384   - $script .= $cmd . ' 2> "' . $script_out . "\"\n";
  381 + $script .= $cmd . ' 2>>"' . $script_out . '" >>"' . $script_out . "\"\n";
385 382 $script .= "exit $?\n";
386 383 }
387 384  
... ... @@ -406,8 +403,7 @@ abstract class ExternalDocumentExtractor extends DocumentExtractor
406 403 $this->output = _kt('Could change permission on exec script: ') . $script_name;
407 404 return false;
408 405 }
409   - $aRet = KTUtil::pexec($script_name);
410   - $res = $aRet['ret'];
  406 + system($script_name, $res);
411 407 }
412 408  
413 409 // remote the script file and get the output if available
... ... @@ -419,7 +415,7 @@ abstract class ExternalDocumentExtractor extends DocumentExtractor
419 415 @unlink($script_out);
420 416 }
421 417  
422   - return $res == 0;
  418 + return ($res == 0) && empty($this->output);
423 419 }
424 420  
425 421 /**
... ...
search2/indexing/indexerCore.inc.php
... ... @@ -828,13 +828,13 @@ abstract class Indexer
828 828 INNER JOIN mime_types mt ON dcv.mime_id=mt.id
829 829 LEFT JOIN mime_extractors me ON mt.extractor_id=me.id
830 830 WHERE
831   - (iff.status_msg IS NOT NULL) AND dmv.status_id=1
  831 + (iff.status_msg IS NOT NULL AND iff.status_msg <> '') AND d.status_id=1
832 832 ORDER BY indexdate ";
833 833 }
834 834 else
835 835 {
836 836 $sql = "SELECT
837   - iff.document_id, iff.indexdate, mt.filetypes, mt.mimetypes, me.name as extractor, iff.what, iff.status_msg, dcv.filename
  837 + iff.document_id, iff.indexdate, mt.filetypes, mt.mimetypes, me.name as extractor, iff.what, iff.status_msg, dcv.filename
838 838 FROM
839 839 index_files iff
840 840 INNER JOIN documents d ON iff.document_id=d.id
... ... @@ -843,7 +843,7 @@ abstract class Indexer
843 843 INNER JOIN mime_types mt ON dcv.mime_id=mt.id
844 844 LEFT JOIN mime_extractors me ON mt.extractor_id=me.id
845 845 WHERE
846   - (iff.status_msg IS NULL or iff.status_msg = '') AND dmv.status_id=1
  846 + (iff.status_msg IS NULL or iff.status_msg = '') AND d.status_id=1
847 847 ORDER BY indexdate ";
848 848 }
849 849 $aResult = DBUtil::getResultArray($sql);
... ... @@ -1085,6 +1085,7 @@ abstract class Indexer
1085 1085 {
1086 1086 $extractor->setExtractionStatus(false);
1087 1087 $this->logPendingDocumentInfoStatus($docId, sprintf(_kt("Could not extract contents from document %d"),$docId), 'error');
  1088 + $this->logPendingDocumentInfoStatus($docId, '<output>' . $extractor->output . '</output>', 'error');
1088 1089 }
1089 1090  
1090 1091 $this->executeHook($extractor, 'post_extract', $mimeType);
... ...
templates/ktcore/search2/lucene_statistics.smarty
... ... @@ -37,7 +37,15 @@ toggle.style.display = &#39;none&#39;;
37 37 <tr><td></td><td>{i18n}Period Since Last Indexing:{/i18n}</td><td>{$stats.indexingPeriod}</td></tr>
38 38 <tr><td></td><td>{i18n}Total # Documents in Repository:{/i18n}</td><td>{$stats.docsInRepository}</td></tr>
39 39 <tr><td></td><td>{i18n}Documents Indexed:{/i18n}</td><td>{$stats.docsInIndex}</td></tr>
40   -<tr><td></td><td>{i18n}Documents in Indexing Queue:{/i18n}</td><td>{$stats.docsInQueue}</td></tr>
  40 +<tr><td></td><td>
  41 +{if $stats.docsInQueue > 0}<a href="{$rootUrl}/admin.php?kt_path_info=search/pendingdocuments">{/if}
  42 +{i18n}Documents in Indexing Queue:{/i18n}
  43 +{if $stats.docsInQueue > 0}</a>{/if}
  44 +</td><td>{$stats.docsInQueue}</td></tr>
  45 +<tr><td></td><td>{if $stats.errorsInQueue > 0}<a href="{$rootUrl}/admin.php?kt_path_info=search/indexerrors">{/if}
  46 + {i18n}Documents with Indexing Problems:{/i18n}
  47 + {if $stats.errorsInQueue > 0}</a>{/if}
  48 + </td><td>{$stats.errorsInQueue}</td></tr>
41 49 <tr><td><img src="{$rootUrl}/resources/graphics/info.gif" style="cursor: pointer;" onmouseOver="mouseOver1()" onmouseOut="mouseOut1()"/></td>
42 50 <td><span>
43 51 {i18n}Index Coverage:{/i18n}
... ...