Jump to:

10994 Posts in 2728 Topics by 1819 members

All other Modules

SilverStripe Forums » All other Modules » Lucene module - search including PDF, Word and Excel

Discuss all other Modules here.

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

Page: 1 2 3
Go to End
Author Topic: 4909 Views
  • Darren Inwood
    Avatar
    Community Member
    12 Posts

    Re: Lucene module - search including PDF, Word and Excel Link to this post

    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

  • nicolant
    Avatar
    Community Member
    6 Posts

    Re: Lucene module - search including PDF, Word and Excel Link to this post

    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

    4909 Views
Page: 1 2 3
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.