Lucene+PHPでoptimize時のエラー: failed to open stream: Too many open files

optimizeしてもエラーになってしまうので、lukeというツールを使えと。

http://www.getopt.org/luke/

とりあえず、使おうと思ったけどGUIなので無理っ
lucene部分は、javaで書こうかな、とりあえずsolrを入れてみてから検討しよ。

http://framework.zend.com/manual/en/zend.search.lucene.index-creation.html

MergeFactor auto-optimization option
MergeFactor determines how often segment indices are merged by addDocument(). With smaller values, less RAM is used while indexing, and searches on unoptimized indices are faster, but indexing speed is slower. With larger values, more RAM is used during indexing, and while searches on unoptimized indices are slower, indexing is faster. Thus larger values (> 10) are best for batch index creation, and smaller values (< 10) for indices that are interactively maintained.

MergeFactor is a good estimation for average number of segments merged by one auto-optimization pass. Too large values produce large number of segments while they are not merged into new one. It may be a cause of "failed to open stream: Too many open files" error message. This limitation is system dependent.

MergeFactor can be retrieved or set by $index->getMergeFactor() or $index->setMergeFactor($mergeFactor) calls.

Default value is 10.

Lucene Java and Luke (Lucene Index Toolbox - » http://www.getopt.org/luke/) can also be used to optimize an index. Latest Luke release (v0.8) is based on Lucene v2.3 and compatible with current implementation of Zend_Search_Lucene component (Zend Framework 1.6). Earlier versions of Zend_Search_Lucene implementations need another versions of Java Lucene tools to be compatible:

Zend Framework 1.5 - Java Lucene 2.1 (Luke tool v0.7.1 - http://www.getopt.org/luke/luke-0.7.1/)

Zend Framework 1.0 - Java Lucene 1.4 - 2.1 (Luke tool v0.6 - http://www.getopt.org/luke/luke-0.6/)

This entry was posted on 水曜日, 5月 18th, 2011 at 6:57 PM and is filed under Lucene, php. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Unityによるゲームを公開しております iOS/Android
https://itunes.apple.com/jp/app/lost-knight-3d-action/id900917032
https://play.google.com/store/apps/details?id=com.groundroad.runknight

各種開発支援・機能開発等小さいお仕事などもお請けしております。
unity開発支援, PHPシステム開発, javascript/html5 フロント開発, titanium mobileアプリ開発
お気軽にお問い合わせください
大崎・五反田近郊での対面でのお打ち合わせはいつでも可能です。