Use the update_hit_ranks SQL function after the hits have been inserted.