implement basic sorting of the search result