alphagov/rummager — pull request #204 by rboulton (2014-03-26 14:38:36+00:00)
Title: Unified search api (DO NOT MERGE YET)

This is a first cut at a new rummager API to support future site search developments, by providing a single ranked list of search results, and a cleaner API for adding things like filters.

It also starts to break elasticsearch-specific code out of the lib/elasticsearch directory; there isn't currently actually a clean separation of code which is specific to elasticsearch and code which isn't, and trying to make rummager designed to support potentially multiple backend engines makes the code much more complex than it needs to be. In particular, validation that isn't required should be done by handling elasticsearch error responses, rather than validating the input to elasticsearch.

The ranking of the results from this API will be improved in future pull requests; the aim is to get this API deployed soon so that we can start building interfaces on top of it in parallel with improving the ranking. I've just used the default basic elasticsearch ranking at this point, since the query for the existing endpoints are overly complex.

This relates to https://www.pivotaltracker.com/story/show/67318390

This isn't ready to merge yet, primarily because it needs many more tests writing, but also because I want a fair bit of feedback before this is merged (in particular, code structure and idioms may be shaky because this is my first significant bit of Ruby).