sort for search

Adds support for sorting search results.