Improve output format for search

This is still WIP but matches the TREC file.