Php Zend_Search_Lucene在索引过程中崩溃
我想为我的网页创建搜索引擎,但在服务器上编制索引时,它因错误而崩溃:Php Zend_Search_Lucene在索引过程中崩溃,php,zend-framework,lucene,Php,Zend Framework,Lucene,我想为我的网页创建搜索引擎,但在服务器上编制索引时,它因错误而崩溃: Warning: opendir(/admin/lucene/) [function.opendir]: failed to open dir: Too many open files in /admin/includes/Zend/Search/Lucene/Storage/Directory/Filesystem.php on line 159 Warning: readdir(): supplied argum
Warning: opendir(/admin/lucene/) [function.opendir]: failed to open dir: Too many open files in /admin/includes/Zend/Search/Lucene/Storage/Directory/Filesystem.php on line 159
Warning: readdir(): supplied argument is not a valid Directory resource in /admin/includes/Zend/Search/Lucene/Storage/Directory/Filesystem.php on line 160
Warning: closedir(): supplied argument is not a valid Directory resource in /admin/includes/Zend/Search/Lucene/Storage/Directory/Filesystem.php on line 167
Fatal error: Ignoring exception from Zend_Search_Lucene_Proxy::__destruct() while an exception is already active (Uncaught Zend_Search_Lucene_Exception in /admin/includes/Zend/Search/Lucene/Storage/File/Filesystem.php on line 66) in /admin/test.php on line 549
我使用的是ZF的最新版本。有没有代码解决这样的错误-我在本地主机上运行脚本,效果很好
感谢您的帮助。PHP已经达到了一次可以打开的文件数量的限制。在PHP.ini中似乎可以选择更改,可能是操作系统(配额)限制,或者您可以告诉索引器放慢速度,不要同时打开这么多文件。这显然是Linux/内核强加的限制。在计算机上以root用户身份使用以下命令:
cat /proc/sys/fs/file-nr
返回值定义为:
问题似乎在于索引中的大量段 您能检查一下索引文件夹包含多少文件吗 有两种方法可以解决此问题: a) 更频繁地优化索引。 b) 使用另一个MaxBufferedDocs/MergeFactor参数。有关详细信息,请参阅 如果没有帮助,请注册JIRA问题。记录在案,2009年4月28日您提出此问题时的“ZF最新版本”是ZF 1.8.0 Beta 1。