silverstripe-labs/silverstripe-fulltextsearch — pull request #43 by tractorcow (2014-05-09 06:25:36+00:00)
Title: API Caching of search results (do not merge)

This solution uses the factory pattern for generating service instances for indexes, allowing service instances to be created via Injector, rather than just calling Solr::service directly.

The Solr service instance has been generalised into a `SolrService_Engine` interface, which is implemented by both the `SolrService_Core` class, as well as the new `SolrService_Cache` class.

I have snuck in a `SolrService_Engine_Reportable` interface to allow classes to optionally expose a `getReport` method to provide consumer code with statistics and information on the most recent search.

Since the PHP files were very heavy on the number of classes, I've split some of them into separate files and organised them a bit more organised under code/solr/subfolders.

This provides an alternate solution in part to #41. The rate limiting aspect will be extrapolated out of this module.

If this solution is acceptable I'll next add documentation and test cases to cover this functionality, as well as cleanup the code a bit more fully.

ref: CWPBUG-44