Handle elasticsearch 1.x when looking up popularity
Handle elasticsearch 1.x when looking up popularity

Elasticsearch 1.x always returns fields as arrays.  When looking up the
popularity at index time, the field value is a number, so we simply use
Array(foo).first to handle both the 1.x and 0.90 return types.

alphagov/rummager,theodi/rummager,alphagov/rummager,theodi/rummager