Sort search results by download count.

Search results can be sorted by download
counts using sort=[-]downloads.
This looks like a previous bug. Is there a test that tests this bug specifically?