sort for search

Adds support for sorting search results.
Addressed by 45784f1a7c5cacbf1aa769249b52af0a34d479f0