alphagov/rummager — pull request #26 by tomafro (2012-09-25 10:58:42+00:00)
Title: Introduce named backends with dedicated urls

This defines routes of the form //search and similar to perform requests against the given backend for all actions that use a single index. Requests without a backend parameter (such as POST /documents) will be applied against the primary backend as before.

This will be needed to give whitehall access to two backends (specialist and government), and hopefully remove the need for whitehall to have a different rummager.

I've tried to be very conservative in how many changes I've made, and also attempted to keep almost all existing functionality working (everything other than the path prefix). I'm afraid the tests are not great, but adding more was difficult, at least not without some disruptive refactoring. I didn't find sinatra and testing went as well together as I'd expected.