Jump to:

10931 Posts in 2614 Topics by 1810 members

All other Modules

SilverStripe Forums » All other Modules » Lucene search plugin 'out of the box'

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 551 Views
  • inCharge
    Avatar
    Community Member
    102 Posts

    Lucene search plugin 'out of the box' Link to this post

    I am loving lucene-silverstripe-plugin (See http://www.silverstripe.org/lucene-module/ and http://code.google.com/p/lucene-silverstripe-plugin/). Many, many thanks to Darren Inwood for developing it and making it available.

    This is the best solution I have found to search in Files, or to search Page fields other than Content. Also, relevance is more accurate, and can even be fine-tuned by altering relative weighting of fields. This is industrial strength search.

    It was fairly easy to get it going, but there were a few gotchas. Hopefully my solutions (or better solutions) will make it into stable releases, but maybe not, so here they are:

    - The main problem is that when files are added & deleted via AssetAdmin, the index isn't updated automatically. So you have to rebuild the entire index by running a batch job! This is due to the way the File & Folder classes use SQL queries instead DataObjects. So the the event handlers that are meant to update the Lucene index aren't called. If you ask me, File & Folder are not playing by the SilverStripe rules and should be brought into line, so I raised a ticket:
    Folder class should use DataObjects to create & delete File records
    http://open.silverstripe.org/ticket/7582

    - When pages are added, changed and deleted, indexes ARE updated immediately. However, sub-classes with no fields ARE NOT indexed. There's a detailed explation and a fix here:
    http://code.google.com/p/lucene-silverstripe-plugin/issues/detail?id=7

    - There's a mechanism for cacheing search results, but it caused me problems, so I disabled it. Details here:
    http://code.google.com/p/lucene-silverstripe-plugin/issues/detail?id=8

    - Be aware that password protected pages and files (e.g. using the securefiles plugin) are shown in search results by default. If you don't want that to happen, you need to filter them out. You wouldn't want search results to include a private intranet page titled 'All IT staff except SilverStripe devs to be made redundant by Dec 2012'.

    551 Views
Page: 1
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.