Cherry picked and merged 826caa8ef34ab8d7c09ed10b9a506a06fb3376d0: 'Fixed sorting handling. The sorting template uses the same session for fulltext search and common search, but if SOLR is used, the fulltext needs different sorting parameter.'