in reply to Hash Search Ranking

Some wheels, in this case the array of hash two-pass algorithm, are meant to be re-invented day in, day out. The variation for this case is that it's a hash of hash of array e.g.
{ artist => { 256 => [matches...], 128 => [matches...], ... }, ... }
that needs two passes - one to populate it and then to read it sorted by calculated rank using a custom sort routine.