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 search plugin 'out of the box'

Go to End



Community Member, 102 Posts

6 July 2012 at 9:58am

I am loving lucene-silverstripe-plugin (See and 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

- 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:

- There's a mechanism for cacheing search results, but it caused me problems, so I disabled it. Details here:

- 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'.