? .svn
? apachesolr334929.patch
? attachments-339776-11.patch
? cache-luke-341175-1.patch
? form-alter-340813-1.patch
? re-use-339776-8.patch
? refactor-339776-10.patch
? sint-ckk-340222-1.patch
? SolrPhpClient/.svn
? SolrPhpClient/Apache/.svn
? SolrPhpClient/Apache/Solr/.svn
? SolrPhpClient/Apache/Solr/Service/.svn
? contrib/.svn
? contrib/apachesolr_attachments/.svn
? contrib/apachesolr_image/.svn
? contrib/apachesolr_lang/.svn
? contrib/apachesolr_mlt/.svn
? contrib/apachesolr_multisitesearch/.svn
? contrib/apachesolr_nodeaccess/.svn
? contrib/apachesolr_nodeaccess/tests/.svn
? tests/.svn
Index: Drupal_Apache_Solr_Service.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/Attic/Drupal_Apache_Solr_Service.php,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 Drupal_Apache_Solr_Service.php
--- Drupal_Apache_Solr_Service.php	26 Nov 2008 13:35:27 -0000	1.1.2.3
+++ Drupal_Apache_Solr_Service.php	1 Dec 2008 16:42:04 -0000
@@ -3,7 +3,8 @@ require_once 'SolrPhpClient/Apache/Solr/
 
 class Drupal_Apache_Solr_Service extends Apache_Solr_Service {
 
-  var $luke;
+  protected $luke;
+  protected $luke_cid;
   const LUKE_SERVLET = 'admin/luke';
 
   /**
@@ -14,6 +15,7 @@ class Drupal_Apache_Solr_Service extends
     if (empty($this->luke[$num_terms])) {
       $url = $this->_constructUrl(self::LUKE_SERVLET, array('numTerms' => "$num_terms", 'wt' => self::SOLR_WRITER));
       $this->luke[$num_terms] = $this->_sendRawGet($url);
+      cache_set($this->luke_cid, $this->luke);
     }
   }
 
@@ -23,18 +25,30 @@ class Drupal_Apache_Solr_Service extends
 
   public function getLuke($num_terms = 0) {
     if (!isset($this->luke[$num_terms])) {
-        $this->setLuke($num_terms);
+      $this->setLuke($num_terms);
     }
     return $this->luke[$num_terms];
   }
 
+  public function clearCache() {
+    cache_clear_all("apachesolr:luke:", 'cache', TRUE);
+    $this->luke = array();
+  }
+
   /**
    * Construct the Full URLs for the three servlets we reference
    */
-  protected function _initUrls()
-  {
+  protected function _initUrls() {
     parent::_initUrls();
     $this->_lukeUrl = $this->_constructUrl(self::LUKE_SERVLET, array('numTerms' => '0', 'wt' => self::SOLR_WRITER));
   }
 
+  public function __construct($host = 'localhost', $port = 8180, $path = '/solr/') {
+    parent::__construct($host, $port, $path);
+    $this->luke_cid = "apachesolr:luke:$host:$port:$path";
+    $cache = cache_get($this->luke_cid);
+    if (isset($cache->data)) {
+      $this->luke = $cache->data;
+    }
+  }
 }
Index: apachesolr.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr.module,v
retrieving revision 1.1.2.12.2.63
diff -u -p -r1.1.2.12.2.63 apachesolr.module
--- apachesolr.module	30 Nov 2008 15:54:59 -0000	1.1.2.12.2.63
+++ apachesolr.module	1 Dec 2008 16:42:04 -0000
@@ -154,6 +154,7 @@ function apachesolr_index_page() {
   // Gets information about the fields already in solr index.
   try {
     $solr = apachesolr_get_solr();
+    $solr->clearCache();
     $data = $solr->getLuke(1);
   } 
   catch (Exception $e) {
@@ -229,6 +230,7 @@ function apachesolr_delete_index_form_su
       drupal_alter('apachesolr_delete_index', $query);
       $solr->deleteByQuery($query);
       $solr->commit();
+      $solr->clearCache();
       // This form can't be seen by anyone without 'administer site configuration'
       // permission, so no need to check perms before displaying a run-cron link.
       drupal_set_message(t('The Solr content index has been erased. You must now !run_cron until your entire site has been re-indexed.', array('!run_cron' => l(t('run cron'), 'admin/reports/status/run-cron', array('query' => array('destination' => 'admin/settings/apachesolr/index'))))));
@@ -369,6 +371,7 @@ function apachesolr_index_nodes($result,
       }
       $solr->commit();
       $solr->optimize(FALSE, FALSE);
+      $solr->clearCache();
       return array('last_change' => $solr_last_change, 'last_nid' => $solr_last_id);
     }
     catch (Exception $e) {
