Commit ffcd3503381cc91f830823ec12418ddd750719fd

Authored by kevin_fourie
1 parent df761ec3

Merged in from DEV trunk...

KTS-3427
"Indexing a large XML document (97 meg) resulted in the indexer throwing an error relating to heap not being big enough"
Updated. Optimised the read of content so text extractor does not crash indexer.

Committed By: Conrad Vermeulen
Reviewed By: Megan Watson


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/trunk@9019 c91229c3-7414-0410-bfa2-8a42b809f60b
search2/indexing/extractorCore.inc.php
... ... @@ -686,7 +686,7 @@ abstract class TextExtractor extends DocumentExtractor
686 686  
687 687 $config = KTConfig::getSingleton();
688 688 $maxTextSize = $config->get('indexer/maxTextSize', 1024 * 1024 * 10); // we'll only take 10 meg by default
689   - $content = substr(file_get_contents($this->sourcefile), 0, $maxTextSize);
  689 + $content = file_get_contents($this->sourcefile, null, null, null, $maxTextSize);
690 690 if (false === $content)
691 691 {
692 692 return false;
... ...