Add popularity info when bulk loading

When bulk loading from a dump (eg, from whitehall), popularity
information needs to be added to the loaded documents.  Similarly, when
loading a dump of best-bets from search-admin, a special
`stemmed_query_as_term` field needs to be added.  This wasn't previously
being done, because the documents being loaded in weren't being parsed
and were just being passed straight to elasticsearch.

If we want to load without parsing, we can do that by making a call to
upload a dump file to elasticsearch directly using a tool like curl (and
more efficiently than going through ruby).  The normal case for loading
is that we want to import a dump from whitehall, or from search-admin.

There's a lot of technical debt in this indexing code, but I'm just
ignoring it for now because when we implement an indexing worker
listening to messages from the content store we'll want to rewrite the
indexing pathway (and can thus address the messiness then).
Refactor bulk_payload for clarity
Merge pull request #245 from alphagov/fix_bulk_loading

Add popularity info when bulk loading
Add tags and specialist_sectors to schema

The specialist sectors field is not indexed, because it's going to be
merged into the tags field.  It does need to appear in the "_source"
JSON of the document, though, so that amend actions work.  (Amend works
by fetching the _source field for the document, updating the fields
listed in the amendments, and then indexing it again.)

The tags field is just a non-analyzed field, holding a list of values,
which will be used for filtering and faceting.
Allow filtering, faceting and returning tag field
Populate the tag field when indexing

For now, just populate it from organisation and specialist_sector, since
those are the only ones of interest for now.
Add unit test of creation of tags field
Test that the tags field gets amended correctly

When its source fields are modified, the tags field should be updated.
Even if an amendment only sends some of the source fields, the tags
field needs to be populated with all the source fields.
Merge pull request #246 from alphagov/add_tag_field

Add tag field
Correct field name: tags not tag
Only populate the tags field for content indexes

Tidy up the setting of the popularity field, too.

The tags field should only be populated for indexes which hold content.
Fix raw-load test to expect tags field

The tags field is now added even when indexing raw bulk upload data.
Make Jenkins test merge result of branches

Almost all of the time we are writing code to be merged into master
sooner rather than later. Rather than testing the HEAD of the branch in
Jenkins this commit adds a command to the build script which merges the
branch with master before building it.
Merge pull request #248 from alphagov/fix_tag_field

Fix tag field
Merge pull request #247 from alphagov/make-jenkins-test-merge-result

Make Jenkins test merge result of branches
Update documentation of elasticsearch version
Merge pull request #249 from alphagov/update_elasticsearch_version_doc

Update documentation of elasticsearch version