Allow searching across multiple indexes.

This adds support for SearchServer.index to be given a comma separated
list of index names instead of a single index name.  Elasticsearch
understands this syntax for referencing multiple indexes.

This paves the way for us to perform a search across multiple indexes in
elasticsearch, rather than having to join the results in Ruby.
Split setup routines for multi-index tests out.

This moves the setup code for the combined search integration tests into
a separate base class from the tests.  This allows the same setup to be
reused for tests of the unified search.
Add Elasticsearch.Index.raw_search().

This performs a search directly in elasticsearch given a payload.  It
abstracts a little common code from the "search" and "advanced_search"
methods, but I mainly want to do this so that I can call this directly
from the new UnifiedSearcher.

Why start breaking the abstraction that Elasticsearch-specific stuff
should live in "elasticsearch"?  Because it's a false abstraction;
rummager only supports elasticsearch as a backend and there's no clean
api for the elasticsearch module; elasticsearch specific idioms and
schema handling code permeate most of the rummager code.  Ultimately we
should get replace most of the code in the elasticsearch directory by
using the official elasticsearch client.
Add unf for unicode normalization

This is needed to normalise the query received from the user, so that we
can reliably remove excess whitespace and compare queries.
Add unified search endpoint.

Adds a /unified_search.json endpoint that will be used for the new
gov.uk search, returning one combined stream of results.

This uses a UnifiedSearchBuilder for constructing the elasticsearch
queries, a UnifiedSearchPresenter for formatting the result sets, and a
UnifiedSearcher for performing the search.
Call UnifiedSearchPresenter from UnifiedSearcher.

This encapsulates the details of converting the response from
elasticsearch to the output format more nicely, and is easier to write
tests for.
Minimal integration test of unified search
Unit tests for unified search

Adds unit tests for the UnifiedSearcher and for UnifiedSearchBuilder.
These show up a problem with sorting (it doesn't filter out documents
for which the sort field doesn't exist).
Don't return documents missing sort field.

When sorting, we want to exclude documents which are missing the sort
field, since it doesn't really make sense to put those at either the top
or bottom of the search results.  This will support the ordering wanted
by https://www.pivotaltracker.com/story/show/66950384.
Put hash parameter for UnifiedSearchPresenter last

Jordan points out that this is a loose convention, and makes it nicer to
call because the hash entries can be supplied when this is called
without needing to wrap them in {}.
Unit tests for UnifiedSearchPresenter
Keep metadata separate for UnifiedSearchPresenter

Instead of merging the metadata fields (eg, _score, _index) with the
rest of the fields for passing input to the UnifiedSearchPresenter, put
them all into a :_metadata member.  This avoids risk of them colliding
with other fields, and makes it easier to write tests that check all the
concrete fields have the correct values.
Integration test date sorting and optional fields.
Rename multi_index_helper to multi_index_test.

This is in line with the convention that the filename should match the
name of the class defined in it.  The file will be included when tests
are run, which may waste a little time in test runs, but on the other
hand if a developer in future adds a test to the file it won't silently
fail to be run.
Cleaner parsing of filter parameters

Use a regex and assignment in the if statement to avoid having to
do a substring calculation with a magic number 7 to remove the "filter_"
prefix.
Make fresh test data instead of copying a constant

Previously, we used Marshal.load and Marshal.dump to get a copy of this
data each time we used it, because the searcher code being tested
mutates its input.  Instead, it's simpler to just generate fresh correct
data each time.
Merge pull request #204 from alphagov/unified_search_api

Unified search api