mirror of https://github.com/apache/lucene.git
SOLR-1184: Add option to not reopen readers
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@781716 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b007152303
commit
0334f5e447
|
@ -491,6 +491,10 @@ Other Changes
|
||||||
|
|
||||||
36. SOLR-458: Add equals and hashCode methods to NamedList (Stefan Rinner, shalin)
|
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
|
Build
|
||||||
----------------------
|
----------------------
|
||||||
1. SOLR-776: Added in ability to sign artifacts via Ant for releases (gsingers)
|
1. SOLR-776: Added in ability to sign artifacts via Ant for releases (gsingers)
|
||||||
|
|
|
@ -113,7 +113,12 @@
|
||||||
This is not needed if lock type is 'none' or 'single'
|
This is not needed if lock type is 'none' or 'single'
|
||||||
-->
|
-->
|
||||||
<unlockOnStartup>false</unlockOnStartup>
|
<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
|
Custom deletion policies can specified here. The class must
|
||||||
implement org.apache.lucene.index.IndexDeletionPolicy.
|
implement org.apache.lucene.index.IndexDeletionPolicy.
|
||||||
|
|
|
@ -116,6 +116,7 @@ public class SolrConfig extends Config {
|
||||||
super(loader, name, is, "/config/");
|
super(loader, name, is, "/config/");
|
||||||
defaultIndexConfig = new SolrIndexConfig(this, null, null);
|
defaultIndexConfig = new SolrIndexConfig(this, null, null);
|
||||||
mainIndexConfig = new SolrIndexConfig(this, "mainIndex", defaultIndexConfig);
|
mainIndexConfig = new SolrIndexConfig(this, "mainIndex", defaultIndexConfig);
|
||||||
|
reopenReaders = getBool("mainIndex/reopenReaders", true);
|
||||||
|
|
||||||
booleanQueryMaxClauseCount = getInt("query/maxBooleanClauses", BooleanQuery.getMaxClauseCount());
|
booleanQueryMaxClauseCount = getInt("query/maxBooleanClauses", BooleanQuery.getMaxClauseCount());
|
||||||
filtOptEnabled = getBool("query/boolTofilterOptimizer/@enabled", false);
|
filtOptEnabled = getBool("query/boolTofilterOptimizer/@enabled", false);
|
||||||
|
@ -188,6 +189,7 @@ public class SolrConfig extends Config {
|
||||||
public final int queryResultWindowSize;
|
public final int queryResultWindowSize;
|
||||||
public final int queryResultMaxDocsCached;
|
public final int queryResultMaxDocsCached;
|
||||||
public final boolean enableLazyFieldLoading;
|
public final boolean enableLazyFieldLoading;
|
||||||
|
public final boolean reopenReaders;
|
||||||
// DocSet
|
// DocSet
|
||||||
public final float hashSetInverseLoadFactor;
|
public final float hashSetInverseLoadFactor;
|
||||||
public final int hashDocSetMaxSize;
|
public final int hashDocSetMaxSize;
|
||||||
|
|
|
@ -1055,7 +1055,7 @@ public final class SolrCore implements SolrInfoMBean {
|
||||||
String newIndexDir = getNewIndexDir();
|
String newIndexDir = getNewIndexDir();
|
||||||
if (newestSearcher != null) {
|
if (newestSearcher != null) {
|
||||||
IndexReader currentReader = newestSearcher.get().getReader();
|
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();
|
IndexReader newReader = currentReader.reopen();
|
||||||
|
|
||||||
if(newReader == currentReader) {
|
if(newReader == currentReader) {
|
||||||
|
|
Loading…
Reference in New Issue