Commit 6c22e10f1aad3212f4286a346d93a835375f70eb
1 parent
beae7c30
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/trunk@8067 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
3 changed files
with
17 additions
and
12 deletions
search2/indexing/extractorCore.inc.php
| @@ -370,10 +370,7 @@ abstract class ExternalDocumentExtractor extends DocumentExtractor | @@ -370,10 +370,7 @@ abstract class ExternalDocumentExtractor extends DocumentExtractor | ||
| 370 | $script_name = $script_prefix . '.bat'; | 370 | $script_name = $script_prefix . '.bat'; |
| 371 | 371 | ||
| 372 | $script = "rem This is an auto generated file. \n"; | 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 | else | 375 | else |
| 379 | { | 376 | { |
| @@ -381,7 +378,7 @@ abstract class ExternalDocumentExtractor extends DocumentExtractor | @@ -381,7 +378,7 @@ abstract class ExternalDocumentExtractor extends DocumentExtractor | ||
| 381 | 378 | ||
| 382 | $script = "#!/bin/sh\n"; | 379 | $script = "#!/bin/sh\n"; |
| 383 | $script .= "# This is an auto generated file. \n"; | 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 | $script .= "exit $?\n"; | 382 | $script .= "exit $?\n"; |
| 386 | } | 383 | } |
| 387 | 384 | ||
| @@ -406,8 +403,7 @@ abstract class ExternalDocumentExtractor extends DocumentExtractor | @@ -406,8 +403,7 @@ abstract class ExternalDocumentExtractor extends DocumentExtractor | ||
| 406 | $this->output = _kt('Could change permission on exec script: ') . $script_name; | 403 | $this->output = _kt('Could change permission on exec script: ') . $script_name; |
| 407 | return false; | 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 | // remote the script file and get the output if available | 409 | // remote the script file and get the output if available |
| @@ -419,7 +415,7 @@ abstract class ExternalDocumentExtractor extends DocumentExtractor | @@ -419,7 +415,7 @@ abstract class ExternalDocumentExtractor extends DocumentExtractor | ||
| 419 | @unlink($script_out); | 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,13 +828,13 @@ abstract class Indexer | ||
| 828 | INNER JOIN mime_types mt ON dcv.mime_id=mt.id | 828 | INNER JOIN mime_types mt ON dcv.mime_id=mt.id |
| 829 | LEFT JOIN mime_extractors me ON mt.extractor_id=me.id | 829 | LEFT JOIN mime_extractors me ON mt.extractor_id=me.id |
| 830 | WHERE | 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 | ORDER BY indexdate "; | 832 | ORDER BY indexdate "; |
| 833 | } | 833 | } |
| 834 | else | 834 | else |
| 835 | { | 835 | { |
| 836 | $sql = "SELECT | 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 | FROM | 838 | FROM |
| 839 | index_files iff | 839 | index_files iff |
| 840 | INNER JOIN documents d ON iff.document_id=d.id | 840 | INNER JOIN documents d ON iff.document_id=d.id |
| @@ -843,7 +843,7 @@ abstract class Indexer | @@ -843,7 +843,7 @@ abstract class Indexer | ||
| 843 | INNER JOIN mime_types mt ON dcv.mime_id=mt.id | 843 | INNER JOIN mime_types mt ON dcv.mime_id=mt.id |
| 844 | LEFT JOIN mime_extractors me ON mt.extractor_id=me.id | 844 | LEFT JOIN mime_extractors me ON mt.extractor_id=me.id |
| 845 | WHERE | 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 | ORDER BY indexdate "; | 847 | ORDER BY indexdate "; |
| 848 | } | 848 | } |
| 849 | $aResult = DBUtil::getResultArray($sql); | 849 | $aResult = DBUtil::getResultArray($sql); |
| @@ -1085,6 +1085,7 @@ abstract class Indexer | @@ -1085,6 +1085,7 @@ abstract class Indexer | ||
| 1085 | { | 1085 | { |
| 1086 | $extractor->setExtractionStatus(false); | 1086 | $extractor->setExtractionStatus(false); |
| 1087 | $this->logPendingDocumentInfoStatus($docId, sprintf(_kt("Could not extract contents from document %d"),$docId), 'error'); | 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 | $this->executeHook($extractor, 'post_extract', $mimeType); | 1091 | $this->executeHook($extractor, 'post_extract', $mimeType); |
templates/ktcore/search2/lucene_statistics.smarty
| @@ -37,7 +37,15 @@ toggle.style.display = 'none'; | @@ -37,7 +37,15 @@ toggle.style.display = 'none'; | ||
| 37 | <tr><td></td><td>{i18n}Period Since Last Indexing:{/i18n}</td><td>{$stats.indexingPeriod}</td></tr> | 37 | <tr><td></td><td>{i18n}Period Since Last Indexing:{/i18n}</td><td>{$stats.indexingPeriod}</td></tr> |
| 38 | <tr><td></td><td>{i18n}Total # Documents in Repository:{/i18n}</td><td>{$stats.docsInRepository}</td></tr> | 38 | <tr><td></td><td>{i18n}Total # Documents in Repository:{/i18n}</td><td>{$stats.docsInRepository}</td></tr> |
| 39 | <tr><td></td><td>{i18n}Documents Indexed:{/i18n}</td><td>{$stats.docsInIndex}</td></tr> | 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 | <tr><td><img src="{$rootUrl}/resources/graphics/info.gif" style="cursor: pointer;" onmouseOver="mouseOver1()" onmouseOut="mouseOut1()"/></td> | 49 | <tr><td><img src="{$rootUrl}/resources/graphics/info.gif" style="cursor: pointer;" onmouseOver="mouseOver1()" onmouseOut="mouseOut1()"/></td> |
| 42 | <td><span> | 50 | <td><span> |
| 43 | {i18n}Index Coverage:{/i18n} | 51 | {i18n}Index Coverage:{/i18n} |