sort for search

Adds support for sorting search results.
The sort order actually can be any of "asc", "desc" or "dsc" (not case-sensitive)