Search and output top-k.