Commit f2d9616a427026c42ef47d0c5b3e5d42611544ac

Authored by Megan Watson
1 parent da2d9b44

KTC-754 The filter now returns true if there's no content and logs it, no conten…

…t doesn't mean there's an error.
"If document is empty indexing returns error"
Fixed.

Committed by: Megan Watson
search2/indexing/indexerCore.inc.php
@@ -759,9 +759,11 @@ abstract class Indexer @@ -759,9 +759,11 @@ abstract class Indexer
759 { 759 {
760 $content = file_get_contents($filename); 760 $content = file_get_contents($filename);
761 761
762 - // if the file is empty something went wrong with the text extraction 762 + // if the file is empty skip the filter - document was probably empty
763 if(empty($content)){ 763 if(empty($content)){
764 - return false; 764 + global $default;
  765 + $default->log->debug('No text was extracted from the document. Either it was empty or there was a problem with the extraction');
  766 + return true;
765 } 767 }
766 768
767 $src = array("([\r\n])","([\n][\n])","([\n])","([\t])",'([ ][ ])'); 769 $src = array("([\r\n])","([\n][\n])","([\n])","([\t])",'([ ][ ])');