Index: apachesolr.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr.admin.inc,v
retrieving revision 1.1.2.46
diff -u -p -r1.1.2.46 apachesolr.admin.inc
--- apachesolr.admin.inc	27 Dec 2009 16:47:37 -0000	1.1.2.46
+++ apachesolr.admin.inc	29 Dec 2009 02:17:19 -0000
@@ -202,7 +202,7 @@ function apachesolr_index_report() {
     $rows = array();
     foreach ($fields as $name => $field) {
       // TODO: try to map the name to something more meaningful.
-      $rows[$name] = array($name, $field->type, isset($field->distinct) ? $field->distinct : $not_found);
+      $rows[$name] = array(l($name, "admin/reports/apachesolr/field/$name"), $field->type, isset($field->distinct) ? $field->distinct : $not_found);
     }
     ksort($rows);
     // Display the table of Field names, Index Types, and term counts.
@@ -214,6 +214,34 @@ function apachesolr_index_report() {
   return $output;
 }
 
+function apachesolr_index_field_report($field_name, $count = 0) {
+  $count = (int) $count;
+  if ($count <= 0) {
+    // Default to 10
+    $count = 10;
+  }
+  $output = '';
+  try {
+    $solr = apachesolr_get_solr();
+    // Note: we use 2 since 1 fails on Ubuntu Hardy.
+    $data = $solr->getLuke($count, array('fl' => $field_name));
+    $output .= '<p>' . t('Number of terms in index: @num', array('@num' => $data->index->numTerms)) . "</p>\n";
+  }
+  catch (Exception $e) {
+    $error = nl2br(check_plain($e->getMessage()));
+    $output .= $error;
+    watchdog('Apache Solr', $error, NULL, WATCHDOG_ERROR);
+    $data->fields = array();
+  }
+  $fields = (array)$data->fields;
+  if (isset($fields[$field_name])) {
+    foreach ($fields[$field_name] as $k => $v) {
+      $output .= '<p>' . $k .'<br /><pre>' . print_r($v,1) .'</pre>';
+    }
+  }
+  return $output;
+}
+
 /**
  * Indicates what order the specified facets should be listed in.  This function is used in a usort
  * invocation.
Index: apachesolr.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr.module,v
retrieving revision 1.1.2.12.2.181
diff -u -p -r1.1.2.12.2.181 apachesolr.module
--- apachesolr.module	27 Dec 2009 16:47:37 -0000	1.1.2.12.2.181
+++ apachesolr.module	29 Dec 2009 02:17:19 -0000
@@ -69,6 +69,14 @@ function apachesolr_menu() {
     'access arguments'   => array('access site reports'),
     'file'               => 'apachesolr.admin.inc',
   );
+  $items['admin/reports/apachesolr/field/%'] = array(
+    'title'              => 'Apache Solr search index',
+    'page callback'      => 'apachesolr_index_field_report',
+    'page arguments'     => array(4),
+    'access arguments'   => array('access site reports'),
+    'file'               => 'apachesolr.admin.inc',
+    'type'               => MENU_CALLBACK,
+  );
   $items['admin/reports/apachesolr/index'] = array(
     'title'              => 'Search index',
     'file'               => 'apachesolr.admin.inc',
Index: Drupal_Apache_Solr_Service.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/Drupal_Apache_Solr_Service.php,v
retrieving revision 1.1.2.26
diff -u -p -r1.1.2.26 Drupal_Apache_Solr_Service.php
--- Drupal_Apache_Solr_Service.php	26 Dec 2009 17:12:38 -0000	1.1.2.26
+++ Drupal_Apache_Solr_Service.php	29 Dec 2009 02:17:19 -0000
@@ -56,7 +56,7 @@ class Drupal_Apache_Solr_Service extends
    */
   protected function setLuke($num_terms = 0) {
     if (empty($this->luke[$num_terms])) {
-      $url = $this->_constructUrl(self::LUKE_SERVLET, array('numTerms' => "$num_terms", 'wt' => self::SOLR_WRITER));
+      $url = $this->_constructUrl(self::LUKE_SERVLET, array('numTerms' => "$num_terms", 'wt' => self::SOLR_WRITER, 'json.nl' => $this->_namedListTreatment));
       $this->luke[$num_terms] = $this->_sendRawGet($url);
       cache_set($this->luke_cid, $this->luke, 'cache_apachesolr');
     }
@@ -72,11 +72,18 @@ class Drupal_Apache_Solr_Service extends
   /**
    * Get meta-data about the index.
    */
-  public function getLuke($num_terms = 0) {
-    if (!isset($this->luke[$num_terms])) {
-      $this->setLuke($num_terms);
+  public function getLuke($num_terms = 0, $params = NULL) {
+    if (empty($params)) {
+      if (!isset($this->luke[$num_terms])) {
+        $this->setLuke($num_terms);
+      }
+      return $this->luke[$num_terms];
+    }
+    else {
+      // Uncached request
+      $url = $this->_constructUrl(self::LUKE_SERVLET, $params + array('numTerms' => "$num_terms", 'wt' => self::SOLR_WRITER, 'json.nl' => $this->_namedListTreatment));
+      return $this->_sendRawGet($url);
     }
-    return $this->luke[$num_terms];
   }
   
   /**
