You can refer to my blog post Orderable Search Container In Liferay to sort database results using Liferay search container.
If you want to sort results coming from solr using search container then refer to this blog post Sort Solr Results Using Search Container.
But what if you don't have any database/solr results and still you want to user Liferay search container ? . For example let say if you List<Long> and you want to display the same using Liferay search container.