Abstract framework for queueing, optimizing and dispatching index operations for Plone content.
collective.indexing is an approach to provide an abstract framework for queuing and optimizing index operations in Plone as well as dispatching them to various backends. The default implementation aims to replace the standard indexing mechanism of CMF to allow index operations to be handled asynchronously in a backwards-compatible way.
Queuing these operations on a transaction level allows to get rid of redundant indexing of objects and thereby providing a substantial performance improvement. By leveraging the component architecture and Zope event system collective.indexing also makes it much easier to use backends other than or in addition to the standard portal catalog for indexing, such as dedicated search engine solutions like Solr, Xapian or Google Search Appliance. One backend implementation designed to be used with this package has already been started in the form of collective.solr.
The implementation is considered to be ready for production. It can be installed in a Plone 4.x site to enable indexing operations to be queued, optimized and dispatched to the standard portal catalog on the Zope transaction boundary thereby improving the Plone’s out-of-the-box performance.
At the moment the package requires several “monkey patches”, to the mixin classes currently used to hook up indexing, i.e. CMFCatalogAware and CatalogMultiplex, the portal catalog as well as to helper methods in Plone itself. It is planned to clear these up by making the classes “pluggable” via adapterization, allowing collective.indexing to hook in in clean ways.
In conjunction with collective.solr the package also provides a working solution for integration of Solr with Plone. Based on a schema configurable at zc.buildout level indexing operations can be dispatched a Solr instance in addition or alternatively to the standard catalog. This allows for minimal and very efficient indexing of standard Plone content items based on Archetypes. Providing support for other content types is rather trivial and will be support soon.
The code was written with emphasis on minimalism, clarity and maintainability. It comes with extensive tests covering the code base at more than 95%. The package is currently in use in several production sites and considered stable.
For outstanding issues and features remaining to be implemented please see the issue tracker.
The package comes with support for queueing up and performing indexing operations via event subscribers. The idea behind this is to not rely on explicit calls as defined in CMFCatalogAware alone, but instead make it possible to phase them out eventually. As the additional indexing operations added via the subscribers are optimized away anyway, this only adds very little processing overhead.
However, even though IObjectModifiedEvent has support for partial reindexing by passing a list of descriptions/index names, this is currently not used anywhere in Plone. Unfortunately that means that partial reindex operations will be “upgraded” to full reindexes, e.g. for IContainerModifiedEvent via the notifyContainerModified helper, which is one reason why subscriber support is not enabled by default for now.
To activate please use:
[instance] ... zcml = collective.indexing:subscribers.zcml
instead of just the package name itself, re-run buildout and restart your Plone instance.
The following tries to address some of the known issues. Please also make sure to check the package’s issue tracker and use it to report new bugs and/or discuss possible enhancements. Alternatively, feedback via the “Plone Developers” mailing-list is also most welcome.
“OFS.Uninstalled Could not import class ‘…’ from module ‘…’” Warnings
When loading your Plone site after a Zope restart, i.e. when browsing it, you’re seeing warnings like:
WARNING OFS.Uninstalled Could not import class 'PortalCatalogQueueProcessor' from module 'collective.indexing.indexer' WARNING OFS.Uninstalled Could not import class 'IndexQueueSwitch' from module 'collective.indexing.queue'
This code was inspired by enfold.indexing and enfold.solr by Enfold Systems as well as work done at the snowsprint‘08. The TransactionManager pattern is taken from enfold.solr. Development was kindly sponsored by Elkjop.
Upgrade note: This version requires Plone 4.1 but no longer requires any persistent configuration or does it have any UI. Please deactivate the add-on in the add-ons control panel. The functionality will be present as long as the package is available on the Python path.