18F/foia-search — pull request #9 by konklone (2014-07-22 17:28:42+00:00)
Title: Adds a basic API over any loaded search results

This adds a real basic API, at `/search`, that returns highlighted results for anything loaded into the backend. It looks like this:

![pinochet-example](https://cloud.githubusercontent.com/assets/4592/3661935/77c5fd4e-11c5-11e4-814b-569f888c886f.png)

It accepts `page`, `per_page`, and `query` parameters, which are fed directly into the elasticsearch query, without much in the way of sanitization. Passing no `query` defaults to `*`, and the `title` and `text` fields are what get searched and highlighted.

It includes some basic query metadata at a top-level `meta` key, visible at the bottom:

![meta-example](https://cloud.githubusercontent.com/assets/4592/3661938/9d58e26a-11c5-11e4-9553-ff5716c79f37.png)

The current test data is [from the State Department](https://github.com/18F/foia/pull/11). It's loaded into Elasticsearch with a few common fields at the top (e.g. `title`, `url`), and any source-specific fields preserved in their own sub-object.

Closes #5.