lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r781716 - in /lucene/solr/trunk: CHANGES.txt example/solr/conf/solrconfig.xml src/java/org/apache/solr/core/SolrConfig.java src/java/org/apache/solr/core/SolrCore.java
Date Thu, 04 Jun 2009 12:17:31 GMT
Author: markrmiller
Date: Thu Jun  4 12:17:31 2009
New Revision: 781716

URL: http://svn.apache.org/viewvc?rev=781716&view=rev
Log:
SOLR-1184: Add option to not reopen readers

Modified:
    lucene/solr/trunk/CHANGES.txt
    lucene/solr/trunk/example/solr/conf/solrconfig.xml
    lucene/solr/trunk/src/java/org/apache/solr/core/SolrConfig.java
    lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java

Modified: lucene/solr/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/CHANGES.txt?rev=781716&r1=781715&r2=781716&view=diff
==============================================================================
--- lucene/solr/trunk/CHANGES.txt (original)
+++ lucene/solr/trunk/CHANGES.txt Thu Jun  4 12:17:31 2009
@@ -491,6 +491,10 @@
 
 36. SOLR-458: Add equals and hashCode methods to NamedList (Stefan Rinner, shalin) 
 
+37. SOLR-1184: Add option in solrconfig to open a new IndexReader rather than
+    using reopen. Done mainly as a fail-safe in the case that a user runs into
+    a reopen bug/issue.  (Mark Miller)
+
 Build
 ----------------------
  1. SOLR-776: Added in ability to sign artifacts via Ant for releases (gsingers)

Modified: lucene/solr/trunk/example/solr/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/example/solr/conf/solrconfig.xml?rev=781716&r1=781715&r2=781716&view=diff
==============================================================================
--- lucene/solr/trunk/example/solr/conf/solrconfig.xml (original)
+++ lucene/solr/trunk/example/solr/conf/solrconfig.xml Thu Jun  4 12:17:31 2009
@@ -113,7 +113,12 @@
          This is not needed if lock type is 'none' or 'single'
      -->
     <unlockOnStartup>false</unlockOnStartup>
-
+    
+    <!-- If true, IndexReaders will be reopened (often more efficient) instead
+         of closed and then opened.
+    -->
+    <reopenReaders>true</reopenReaders>
+	  
     <!--
         Custom deletion policies can specified here. The class must
         implement org.apache.lucene.index.IndexDeletionPolicy.

Modified: lucene/solr/trunk/src/java/org/apache/solr/core/SolrConfig.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/core/SolrConfig.java?rev=781716&r1=781715&r2=781716&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/core/SolrConfig.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/core/SolrConfig.java Thu Jun  4 12:17:31 2009
@@ -116,6 +116,7 @@
     super(loader, name, is, "/config/");
     defaultIndexConfig = new SolrIndexConfig(this, null, null);
     mainIndexConfig = new SolrIndexConfig(this, "mainIndex", defaultIndexConfig);
+    reopenReaders = getBool("mainIndex/reopenReaders", true);
     
     booleanQueryMaxClauseCount = getInt("query/maxBooleanClauses", BooleanQuery.getMaxClauseCount());
     filtOptEnabled = getBool("query/boolTofilterOptimizer/@enabled", false);
@@ -188,6 +189,7 @@
   public final int queryResultWindowSize;
   public final int queryResultMaxDocsCached;
   public final boolean enableLazyFieldLoading;
+  public final boolean reopenReaders;
   // DocSet
   public final float hashSetInverseLoadFactor;
   public final int hashDocSetMaxSize;

Modified: lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java?rev=781716&r1=781715&r2=781716&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java Thu Jun  4 12:17:31 2009
@@ -1055,7 +1055,7 @@
       String newIndexDir = getNewIndexDir();
       if (newestSearcher != null) {
         IndexReader currentReader = newestSearcher.get().getReader();
-        if(new File(getIndexDir()).getCanonicalFile().equals(new File(newIndexDir).getCanonicalFile()))
 {
+        if(solrConfig.reopenReaders && new File(getIndexDir()).getCanonicalFile().equals(new
File(newIndexDir).getCanonicalFile()))  {
           IndexReader newReader = currentReader.reopen();
 
           if(newReader == currentReader) {



Mime
View raw message