diff --git a/apachesolr_views_query.inc b/apachesolr_views_query.inc
index c10da5c..aa25c24 100644
--- a/apachesolr_views_query.inc
+++ b/apachesolr_views_query.inc
@@ -88,6 +88,11 @@ class apachesolr_views_query extends views_plugin_query {
       $params['defType'] = $this->params['defType'];
     }

+    // Set sort order.
+    if (isset($this->orderby)) {
+      $params['sort'] = implode(',', $this->orderby);
+    }
+
     $this->query_params = $params;

     // Export parameters for preview.
@@ -133,10 +138,7 @@ class apachesolr_views_query extends views_plugin_query {
         'current_display' => $view->current_display,
       );

-      $query = new ApachesolrViewsSolrBaseQuery('apachesolr', $solr, $this->query_params, '', current_path(), $context, $view);
-
-      // Add sorting. The setSolrsort method can't be used, because it doesn't support multiple sorting criteria.
-      $query->replaceParam('sort', $this->orderby);
+      $query = new ApachesolrViewsSolrBaseQuery('apachesolr', $solr, $this->query_params, implode(',', $this->orderby), current_path(), $context, $view);

       $query->page = $this->pager->current_page;

