alphagov/rummager — pull request #231 by rboulton (2014-05-16 13:55:30+00:00)
Title: Always add popularity to content indexes

Check if the index is an "auxilary" index, and if not add the popularity
field. We don't just check if the index is a "content" index, because
many of the tests make indexes which are neither content or auxilary
indexes (eg, "rummager_test"), and these should have popularity values
added.

Previously, we were only adding popularity fields to indexes when a
popularity value was found matching the value of the "link" field. This
meant that most of our tests were producing documents without a
popularity value. It turns out that elasticsearch 0.90 is more fussy
about the popularity field existing when used in a script than 0.20, and
as such VMs running 0.90.12 fail their integration tests.

This probably doesn't affect production. It could if:
- the page-traffic index went missing on production
- an index migration was performed
- no documents contained a popularity value