Apache Solr is based on Lucene and is the enterprise open source search engine. It powers the search of sites like Twitter, the Apple and iTunes Stores, Wikipedia, Netflix and many more.
Solr does not only scale to any level of content, but provides rich search functionality, like faceting, geospatial search, suggestions, spelling corrections, indexing of binary formats and a whole variety of powerful tools to configure custom search solutions. It has integrated clustering and load-balancing to provide a high level of robustness.
collective.solr comes with a default configuration and setup of Solr that makes it extremely easy to get started,
yet provides a vastly superior search quality compared to Plone's integrated text search based on
- Schema and Schemaless Configuration
- Information Retrieval System
- Speed (in comparission to ZCTextIndex)
Features of Solr Integration into Plone
- Indexing of binary documents
- Spellchecking / suggestions
- Wildcard searches
- Exclude from search
A full Documentation of the Solr integration of Plone could be found on collectivesolr.readthedocs.org.
Download the latest default Solr configuration from github:
$ wget https://github.com/collective/collective.solr/raw/master/solr.cfg $ wget https://raw.githubusercontent.com/collective/collective.solr/master/solr-4.10.x.cfg
Extend your buildout to use those files and make sure collective.solr is added to the eggs in your instance section. Your full buildout file should look something like this:
[buildout] parts += instance extends = http://dist.plone.org/release/4.3.8/versions.cfg solr.cfg solr-4.10.x.cfg [instance] recipe = plone.recipe.zope2instance http-address = 8080 user = admin:admin eggs = Plone collective.solr [versions] collective.recipe.solrinstance = 5.3.2
$ python bootstrap-buildout.py $ bin/buildout ... $ bin/solr-instance start $ bin/instance start
Next you should activate the
collective.solr (site search) add-on in the add-on control panel of Plone.
After activation you should review the settings in the new
Solr Settings control panel.
To index all your content in Solr you can call the provided maintenance view:
Solr connection configuration in ZCML
The connections settings for Solr can be configured in ZCML and thus in buildout. This makes it easier when copying databases between multiple Zope instances with different Solr servers.
zcml-additional = <configure xmlns:solr="http://namespaces.plone.org/solr"> <solr:connection host="localhost" port="8983" base="/solr/plone"/> </configure>
The code is used in production in many sites and considered stable.
This add-on can be installed in a Plone 4.3 (or later) site to enable indexing operations
as well as searching (site and live search) using Solr.
Doing so will not only significantly improve search quality and performance -
especially for a large number of indexed objects,
but also reduce the memory footprint of your Plone instance
by allowing you to remove the
Title indexes from the catalog
as well as the lexicons if no other indexes are using them.
In large sites with 100000 content objects and more,
ZCTextIndex often taken 10 seconds or more
and require a good deal of memory from ZODB caches.
Solr will typically answer these requests in 10ms to 50ms
at which point network latency and the rendering speed of Plone's page templates are a more dominant factor.
The code works with Solr 7. Older versions might work as well but we don't test them.
For outstanding issues and features remaining to be implemented please see the issue tracker.