? SolrPhpClient
? allow-abort-611670-7-6x-2x.patch
? apachesolr.kpf
? commentsearch_0.patch
? subqueries.patch
? update-library-628080-9-D6-2.patch
Index: apachesolr.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr.module,v
retrieving revision 1.1.2.12.2.155.2.39
diff -u -p -r1.1.2.12.2.155.2.39 apachesolr.module
--- apachesolr.module	20 Nov 2009 17:13:51 -0000	1.1.2.12.2.155.2.39
+++ apachesolr.module	20 Nov 2009 18:48:49 -0000
@@ -843,7 +843,7 @@ function apachesolr_facet_block($respons
         $facet_text = $facet_callback($facet, $options);
       }
       // If this block is to be alphabetically sorted, change $sortpre.
-      if (isset($facet_query_sorts[$module][$delta]) && ($facet_query_sorts[$module][$delta] == 'index')) {
+      if (isset($facet_query_sorts[$module][$delta]) && ($facet_query_sorts[$module][$delta] != 'count')) {
         $sortpre = $facet_text;
       }
       $unclick_link = '';
@@ -868,7 +868,12 @@ function apachesolr_facet_block($respons
     }
     // Unless a facet is active only display 2 or more.
     if ($items && ($response->response->numFound > 1 || $contains_active)) {
-      ksort($items, SORT_STRING);
+      if (!isset($facet_query_sorts[$module][$delta]) || ($facet_query_sorts[$module][$delta] == 'index asc')) {
+        ksort($items, SORT_STRING);
+      }
+      else if ($facet_query_sorts[$module][$delta] == 'index desc') {
+        krsort($items, SORT_STRING);
+      }
       // Get information needed by the rest of the blocks about limits.
       $initial_limits = variable_get('apachesolr_facet_query_initial_limits', array());
       $limit = isset($initial_limits[$module][$delta]) ? $initial_limits[$module][$delta] : variable_get('apachesolr_facet_query_initial_limit_default', 10);
@@ -1133,8 +1138,8 @@ function apachesolr_facetcount_form($mod
     $form['apachesolr_facet_query_sort'] = array(
       '#type' => 'radios',
       '#title' => t('Sort order of facet links'),
-      '#options' => array('count' => t('Count'), 'index' => t('Alphanumeric')),
-      '#description' => t('The sort order of facet links in this block. %Count, which is the default, will show facets with the most results first. %Alphanumeric will sort alphabetically, ascending.', array('%Count' => t('Count'), '%Alphanumeric' => t('Alphanumeric'))),
+      '#options' => array('count' => t('Count'), 'index asc' => t('Alphanumeric, ascending'), 'index desc' => t('Alphanumeric, descending')),
+      '#description' => t('The sort order of facet links in this block. %Count, which is the default, will show facets with the most results first. %Alphanumeric will sort alphabetically, either ascending or descending.', array('%Count' => t('Count'), '%Alphanumeric' => t('Alphanumeric'))),
       '#default_value' => isset($sorts[$module][$delta]) ? $sorts[$module][$delta] : 'count',
     );
   }
Index: apachesolr_search.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr_search.module,v
retrieving revision 1.1.2.6.2.111.2.29
diff -u -p -r1.1.2.6.2.111.2.29 apachesolr_search.module
--- apachesolr_search.module	20 Nov 2009 17:13:51 -0000	1.1.2.6.2.111.2.29
+++ apachesolr_search.module	20 Nov 2009 18:48:49 -0000
@@ -754,7 +754,7 @@ function apachesolr_search_block($op = '
               unset($active);
               $term = taxonomy_get_term($tid);
               $sortpre = '';
-              if (isset($facet_query_sorts['apachesolr_search'][$delta]) && ($facet_query_sorts['apachesolr_search'][$delta] == 'index')) {
+              if (isset($facet_query_sorts['apachesolr_search'][$delta]) && ($facet_query_sorts['apachesolr_search'][$delta] != 'count')) {
                 $sortpre = $term->name;
               }
               $new_query = clone $query;
@@ -781,7 +781,13 @@ function apachesolr_search_block($op = '
           $vid = substr($delta, 7);
           $vocab = taxonomy_vocabulary_load($vid);
           if (is_numeric($vid) && is_array($terms) && isset($terms[$vid]) && is_array($terms[$vid])) {
-            ksort($terms[$vid]);
+            if (!isset($facet_query_sorts['apachesolr_search'][$delta]) || ($facet_query_sorts['apachesolr_search'][$delta] == 'index asc')) {
+              ksort($terms[$vid]);
+            }
+            else if ($facet_query_sorts['apachesolr_search'][$delta] == 'index desc') {
+              krsort($terms[$vid]);
+            }
+            
             $limit = isset($initial_limits['apachesolr_search'][$delta]) ? $initial_limits['apachesolr_search'][$delta] : $limit_default;
             return array(
               'subject' => t('Filter by @name', array('@name' => $vocab->name)),
