Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Lucene module - search including PDF, Word and Excel


Go to End


18 Posts   7298 Views

Avatar
Darren Inwood

Community Member, 12 Posts

25 June 2011 at 10:06am

Edited: 25/06/2011 10:13am

Hi nicolant,

This will be caused by the Zend_Search_Lucene indexer. What happens is, while it's building the index, it creates 'segment' files which are parts of the index and combines these when they pass a set threshold. You can actually change that threshold using the MergeFactor property of the index when you create it.

There's a mechanism in place in the plugin to let you change this thankfully. Try this code in your _config.php, you need to rebuild your index afterwards to make it take effect:

function create_index_callback() {
	$index = ZendSeachLuceneWrapper::getIndex();
	$index->setMergeFactor(5);
}
ZendSearchLuceneWrapper::addCreateIndexCallback('create_index_callback');

Have a read of this page and a play with MergeFactor values (default is 10, you want to set it lower) and you should be able to get your index working OK =]
http://framework.zend.com/manual/en/zend.search.lucene.index-creation.html

HTH!
Darren

Avatar
nicolant

Community Member, 6 Posts

25 June 2011 at 9:17pm

Unfortunately, it doesn't work.

I tried "dev/build" with your code in _config.php:

function create_index_callback() {
$index = ZendSearchLuceneWrapper::getIndex();
$index->setMergeFactor(5);
}
ZendSearchLuceneWrapper::addCreateIndexCallback('create_index_callback');

ZendSearchLuceneSearchable::enable();

and without and results are the same:

.
.
.
Creating database records
.
.
.
SiteTree

Warning: include_once(/home/rafsu476/public_html/sapphire/dev/Log.php) [function.include-once]: failed to open stream: Too many open files in /home/rafsu476/public_html/sapphire/core/Core.php on line 213

Warning: include_once() [function.include]: Failed opening '/home/rafsu476/public_html/sapphire/dev/Log.php' for inclusion (include_path='/home/rafsu476/public_html/sapphire:/home/rafsu476/public_html/sapphire/parsers:/home/rafsu476/public_html/sapphire/thirdparty:.:/usr/lib/php:/usr/local/lib/php:/home/rafsu476/public_html/lucene/thirdparty') in /home/rafsu476/public_html/sapphire/core/Core.php on line 213

Fatal error: Class 'SS_Log' not found in /home/rafsu476/public_html/sapphire/dev/Debug.php on line 245

The "Silverstripe" index folder structure is the same in the both cases (30 files).

Thank you anyway for quick responce. A tried to play with hard-coded value of MergeFactor inside Writer class earlier also without success :-(

Go to Top