Index: plugins/content_types/apachesolr_result.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr_panels/plugins/content_types/apachesolr_result.inc,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 apachesolr_result.inc
--- plugins/content_types/apachesolr_result.inc	27 Aug 2010 15:57:04 -0000	1.1.2.2
+++ plugins/content_types/apachesolr_result.inc	1 Nov 2010 12:33:15 -0000
@@ -17,6 +17,8 @@ if (module_exists('apachesolr_search')) 
       'filters' => '',
       'sort_action' => 'none',
       'sort' => '',
+      'rows_action' => 'none',
+      'rows' => '',
       'title_override' => FALSE,
       'title_override_text' => '',
       'empty_override' => FALSE,
@@ -83,7 +85,23 @@ function apachesolr_panels_apachesolr_re
   // Execute the search if we have keys or if keys aren't required.
   $results = NULL;
   if (!empty($search['keys']) || !$conf['keys_required']) {
-    $results = search_data($search, 'apachesolr_panels');
+    if (($conf['rows_action'] == 'override') && is_numeric($conf['rows'])) {
+      // Add some trickery to be able to specify the number of rows returned:
+      $old_rows_value = isset($GLOBALS['conf']['apachesolr_rows']) ? $GLOBALS['conf']['apachesolr_rows'] : NULL;
+      $GLOBALS['conf']['apachesolr_rows'] = $conf['rows'];
+
+      $results = search_data($search, 'apachesolr_panels');
+
+
+      // Restore the old value:
+      unset($GLOBALS['conf']['apachesolr_rows']);
+      if (!is_null($old_rows_value)) {
+        $GLOBALS['conf']['apachesolr_rows'] = $old_rows_value;
+      }
+    }
+    else {
+      $results = search_data($search, 'apachesolr_panels');
+    }
   }
 
   // Add the title and results, or any overrides.
@@ -188,6 +206,26 @@ function apachesolr_panels_apachesolr_re
     '#suffix' => '</div>',
   );
 
+  $form['rows_action'] = array(
+    '#prefix' => '<div class="form-item container-inline">',
+    '#title' => t('Number of results'),
+    '#type' => 'select',
+    '#options' => array(
+      'none' => t('Apachesolr default (' . variable_get('apachesolr_rows', 10).  ')'),
+      'override' => t('Override'),
+    ),
+    '#default_value' => $conf['rows_action'],
+  );
+
+  $form['rows'] = array(
+    '#title' => '',
+    '#type' => 'textfield',
+    '#default_value' => $conf['rows'],
+    '#process' => array('ctools_dependent_process'),
+    '#dependency' => array('edit-rows-action' => array('override',)),
+    '#suffix' => '</div>',
+  );
+
   $form['title_override'] = array(
     '#prefix' => '<div class="form-item container-inline">',
     '#title' => t('Override title'),
