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.9
diff -u -r1.1.2.9 Drupal_Apache_Solr_Service.php
--- Drupal_Apache_Solr_Service.php	11 Jan 2009 03:21:01 -0000	1.1.2.9
+++ Drupal_Apache_Solr_Service.php	17 Feb 2009 11:18:15 -0000
@@ -5,7 +5,9 @@
 
   protected $luke;
   protected $luke_cid;
+  protected $stats;
   const LUKE_SERVLET = 'admin/luke';
+  const STATS_SERVLET = 'admin/stats.jsp';
 
   /**
    * Sets $this->luke with the meta-data about the index from admin/luke.
@@ -34,6 +36,29 @@
     }
     return $this->luke[$num_terms];
   }
+  
+  /**
+   * Sets $this->stats with the information about the Solr Core form /admin/stats.jsp
+   */
+  protected function setStats() {
+    if (empty($this->stats)) {
+      $url = $this->_constructUrl(self::STATS_SERVLET);
+      $this->stats = $this->_sendRawGet($url);
+    }
+  }
+  
+  /**
+   * Get information about the Solr Core.
+   */
+  public function getStats($parsed = true) {
+    if (!isset($this->stats)) {
+      $this->setStats();
+    }
+    if ($parsed) {
+      return simplexml_load_string($this->stats->getRawResponse());
+    }
+    return $this->stats;
+  }
 
   /**
    * Clear cached Solr data.
Index: apachesolr.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr.admin.inc,v
retrieving revision 1.1.2.6
diff -u -r1.1.2.6 apachesolr.admin.inc
--- apachesolr.admin.inc	28 Jan 2009 13:53:03 -0000	1.1.2.6
+++ apachesolr.admin.inc	17 Feb 2009 11:18:16 -0000
@@ -83,7 +83,11 @@
 
   $output  = '';
   if (isset($data->index->numDocs)) {
-    $output .= '<p>' . t('Number of documents in index: @num', array('@num' => $data->index->numDocs)) . "</p>\n";
+    $stats = $solr->getStats(true);
+    $docsPendingXpath = $stats->xpath('//stat[@name="docsPending"]');
+    $pending_docs = (int)(string)$docsPendingXpath[0];
+    $pending_msg = $pending_docs ? t('(@pending_docs sent but not yet indexed)', array('@pending_docs' => $pending_docs)) : '';
+    $output .= '<p>' . t('Number of documents in index: @num @pending', array('@num' => $data->index->numDocs, '@pending' => $pending_msg)) . "</p>\n";
     $output .= '<p>' . t('Number of terms in index: @num', array('@num' => $data->index->numTerms)) . "</p>\n";
   }
 
