You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ja...@apache.org on 2012/04/03 00:55:40 UTC
svn commit: r1308608 [1/2] - in /lucene/dev/trunk: ./ dev-tools/ lucene/
modules/analysis/common/ solr/
solr/contrib/clustering/src/test-files/clustering/solr/conf/
solr/contrib/dataimporthandler-extras/src/test-files/dihextras/solr/conf/
solr/contrib/...
Author: janhoy
Date: Mon Apr 2 22:55:37 2012
New Revision: 1308608
URL: http://svn.apache.org/viewvc?rev=1308608&view=rev
Log:
SOLR-1052: Deprecate/Remove <indexDefaults> and <mainIndex> in favor of <indexConfig> in solrconfig.xml (trunk)
Added:
lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-basic-luceneVersion31.xml
- copied unchanged from r1305693, lucene/dev/branches/branch_3x/solr/core/src/test-files/solr/conf/solrconfig-basic-luceneVersion31.xml
Removed:
lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-legacy.xml
lucene/dev/trunk/solr/core/src/test/org/apache/solr/core/TestLegacyMergeSchedulerPolicyConfig.java
Modified:
lucene/dev/trunk/ (props changed)
lucene/dev/trunk/dev-tools/ (props changed)
lucene/dev/trunk/lucene/ (props changed)
lucene/dev/trunk/modules/analysis/common/ (props changed)
lucene/dev/trunk/solr/ (props changed)
lucene/dev/trunk/solr/CHANGES.txt
lucene/dev/trunk/solr/contrib/clustering/src/test-files/clustering/solr/conf/solrconfig.xml
lucene/dev/trunk/solr/contrib/dataimporthandler-extras/src/test-files/dihextras/solr/conf/dataimport-solrconfig.xml
lucene/dev/trunk/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/contentstream-solrconfig.xml
lucene/dev/trunk/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-nodatasource-solrconfig.xml
lucene/dev/trunk/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-solrconfig.xml
lucene/dev/trunk/solr/contrib/extraction/src/test-files/extraction/solr/conf/solrconfig.xml
lucene/dev/trunk/solr/contrib/uima/src/test-files/uima/solr/conf/solrconfig.xml
lucene/dev/trunk/solr/contrib/uima/src/test-files/uima/uima-tokenizers-solrconfig.xml
lucene/dev/trunk/solr/contrib/velocity/src/test-files/velocity/solr/conf/solrconfig.xml
lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrConfig.java
lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrCore.java
lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java
lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/SpellCheckComponent.java
lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java
lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java
lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrIndexWriter.java
lucene/dev/trunk/solr/core/src/test-files/solr/conf/bad-mp-solrconfig.xml
lucene/dev/trunk/solr/core/src/test-files/solr/conf/bad_solrconfig.xml
lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-delpolicy1.xml
lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-delpolicy2.xml
lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-elevate.xml
lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-enableplugin.xml
lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-master.xml
lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-master1-keepOneBackup.xml
lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-master1.xml
lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-master2.xml
lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-master3.xml
lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-mergepolicy.xml
lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-nativelock.xml
lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-propinject-indexdefault.xml
lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-propinject.xml
lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-repeater.xml
lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-simplelock.xml
lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-slave.xml
lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-slave1.xml
lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-solcoreproperties.xml
lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-termindex.xml
lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig.xml
lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig_perf.xml
lucene/dev/trunk/solr/core/src/test-files/solr/crazy-path-to-config.xml
lucene/dev/trunk/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java
lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java
lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java
lucene/dev/trunk/solr/core/src/test/org/apache/solr/core/TestConfig.java
lucene/dev/trunk/solr/core/src/test/org/apache/solr/core/TestMergePolicyConfig.java
lucene/dev/trunk/solr/core/src/test/org/apache/solr/core/TestQuerySenderListener.java
lucene/dev/trunk/solr/core/src/test/org/apache/solr/core/TestQuerySenderNoQuery.java
lucene/dev/trunk/solr/example/example-DIH/solr/db/conf/solrconfig.xml
lucene/dev/trunk/solr/example/example-DIH/solr/mail/conf/solrconfig.xml
lucene/dev/trunk/solr/example/example-DIH/solr/rss/conf/solrconfig.xml
lucene/dev/trunk/solr/example/example-DIH/solr/solr/conf/solrconfig.xml
lucene/dev/trunk/solr/example/example-DIH/solr/tika/conf/solrconfig.xml
lucene/dev/trunk/solr/example/solr/conf/solrconfig.xml
lucene/dev/trunk/solr/solrj/src/test-files/solrj/solr/conf/solrconfig-slave1.xml
lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java
lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java
Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Mon Apr 2 22:55:37 2012
@@ -68,10 +68,17 @@ Upgrading from Solr 3.6-dev
deprecated but still working since Solr3.2, but is now removed
entirely.
+* The <indexDefaults> and <mainIndex> sections of solrconfig.xml are discontinued
+ and replaced with the <indexConfig> section. There are also better defaults.
+ When migrating, if you don't know what your old settings mean, simply delete
+ both <indexDefaults> and <mainIndex> sections. If you have customizations,
+ put them in <indexConfig> section - with same syntax as before.
+
* Two of the SolrServer subclasses in SolrJ were renamed/replaced.
CommonsHttpSolrServer is now HttpSolrServer, and
StreamingUpdateSolrServer is now ConcurrentUpdateSolrServer.
+
Detailed Change List
----------------------
@@ -496,6 +503,9 @@ Upgrading from Solr 3.5
HTMLStripCharFilter in Solr version 3.5 and earlier: the old implementation
(bugs and all) is preserved as LegacyHTMLStripCharFilter.
+* As of Solr 3.6, the <indexDefaults> and <mainIndex> sections of solrconfig.xml are deprecated
+ and replaced with a new <indexConfig> section. Read more in SOLR-1052 below.
+
* SOLR-3040: The DIH's admin UI (dataimport.jsp) now requires DIH request handlers to start with
a '/'. (dsmiley)
@@ -808,6 +818,12 @@ Other Changes
this check was only performed during modifying (e.g. adding and deleting
documents) the index. (Luca Cavanna via Martijn van Groningen)
+* SOLR-1052: Deprecated <indexDefaults> and <mainIndex> in solrconfig.xml
+ From now, all settings go in the new <indexConfig> tag, and some defaults are
+ changed: useCompoundFile=false, ramBufferSizeMB=32, lockType=native, so that
+ the effect of NOT specifying <indexConfig> at all gives same result as the
+ example config used to give in 3.5 (janhoy, gsingers)
+
Build
----------------------
* SOLR-2487: Add build target to package war without slf4j jars (janhoy)
Modified: lucene/dev/trunk/solr/contrib/clustering/src/test-files/clustering/solr/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/clustering/src/test-files/clustering/solr/conf/solrconfig.xml?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/clustering/src/test-files/clustering/solr/conf/solrconfig.xml (original)
+++ lucene/dev/trunk/solr/contrib/clustering/src/test-files/clustering/solr/conf/solrconfig.xml Mon Apr 2 22:55:37 2012
@@ -25,79 +25,10 @@
<dataDir>${solr.data.dir:}</dataDir>
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
- <indexDefaults>
- <!-- Values here affect all index writers and act as a default unless overridden. -->
- <useCompoundFile>false</useCompoundFile>
- <mergeFactor>10</mergeFactor>
- <!--
- If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene will flush based on whichever limit is hit first.
-
- -->
- <!--<maxBufferedDocs>1000</maxBufferedDocs>-->
- <!-- Tell Lucene when to flush documents to disk.
- Giving Lucene more memory for indexing means faster indexing at the cost of more RAM
-
- If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene will flush based on whichever limit is hit first.
-
- -->
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <maxMergeDocs>2147483647</maxMergeDocs>
- <maxFieldLength>10000</maxFieldLength>
- <writeLockTimeout>1000</writeLockTimeout>
-
- <!--
- Expert:
- The Merge Policy in Lucene controls how merging is handled by Lucene. The default in 2.3 is the LogByteSizeMergePolicy, previous
- versions used LogDocMergePolicy.
-
- LogByteSizeMergePolicy chooses segments to merge based on their size. The Lucene 2.2 default, LogDocMergePolicy chose when
- to merge based on number of documents
-
- Other implementations of MergePolicy must have a no-argument constructor
- -->
- <!--<mergePolicy>org.apache.lucene.index.LogByteSizeMergePolicy</mergePolicy>-->
-
- <!--
- Expert:
- The Merge Scheduler in Lucene controls how merges are performed. The ConcurrentMergeScheduler (Lucene 2.3 default)
- can perform merges in the background using separate threads. The SerialMergeScheduler (Lucene 2.2 default) does not.
- -->
- <!--<mergeScheduler>org.apache.lucene.index.ConcurrentMergeScheduler</mergeScheduler>-->
-
- <!--
- This option specifies which Lucene LockFactory implementation to use.
-
- single = SingleInstanceLockFactory - suggested for a read-only index
- or when there is no possibility of another process trying
- to modify the index.
- native = NativeFSLockFactory
- simple = SimpleFSLockFactory
-
- (For backwards compatibility with Solr 1.2, 'simple' is the default
- if not specified.)
- -->
+ <indexConfig>
<lockType>single</lockType>
- </indexDefaults>
-
- <mainIndex>
- <!-- options specific to the main on-disk lucene index -->
- <useCompoundFile>false</useCompoundFile>
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <mergeFactor>10</mergeFactor>
- <!-- Deprecated -->
- <!--<maxBufferedDocs>1000</maxBufferedDocs>-->
- <maxMergeDocs>2147483647</maxMergeDocs>
- <maxFieldLength>10000</maxFieldLength>
-
- <!-- If true, unlock any held write or commit locks on startup.
- This defeats the locking mechanism that allows multiple
- processes to safely access a lucene index, and should be
- used with care.
- This is not needed if lock type is 'none' or 'single'
- -->
- <unlockOnStartup>false</unlockOnStartup>
- </mainIndex>
+ </indexConfig>
<!-- Enables JMX if and only if an existing MBeanServer is found, use
this if you want to configure JMX through JVM parameters. Remove
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler-extras/src/test-files/dihextras/solr/conf/dataimport-solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler-extras/src/test-files/dihextras/solr/conf/dataimport-solrconfig.xml?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler-extras/src/test-files/dihextras/solr/conf/dataimport-solrconfig.xml (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler-extras/src/test-files/dihextras/solr/conf/dataimport-solrconfig.xml Mon Apr 2 22:55:37 2012
@@ -26,89 +26,7 @@
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
- <indexDefaults>
- <!-- Values here affect all index writers and act as a default unless overridden. -->
- <useCompoundFile>false</useCompoundFile>
-
- <mergeFactor>10</mergeFactor>
- <!--
- If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene will flush based on whichever limit is hit first.
-
- -->
- <!--<maxBufferedDocs>1000</maxBufferedDocs>-->
- <!-- Tell Lucene when to flush documents to disk.
- Giving Lucene more memory for indexing means faster indexing at the cost of more RAM
-
- If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene will flush based on whichever limit is hit first.
-
- -->
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <maxMergeDocs>2147483647</maxMergeDocs>
- <maxFieldLength>10000</maxFieldLength>
- <writeLockTimeout>1000</writeLockTimeout>
-
- <!--
- Expert: Turn on Lucene's auto commit capability.
-
- TODO: Add recommendations on why you would want to do this.
-
- NOTE: Despite the name, this value does not have any relation to Solr's autoCommit functionality
-
- -->
- <!--<luceneAutoCommit>false</luceneAutoCommit>-->
- <!--
- Expert:
- The Merge Policy in Lucene controls how merging is handled by Lucene. The default in 2.3 is the LogByteSizeMergePolicy, previous
- versions used LogDocMergePolicy.
-
- LogByteSizeMergePolicy chooses segments to merge based on their size. The Lucene 2.2 default, LogDocMergePolicy chose when
- to merge based on number of documents
-
- Other implementations of MergePolicy must have a no-argument constructor
- -->
- <!--<mergePolicy>org.apache.lucene.index.LogByteSizeMergePolicy</mergePolicy>-->
-
- <!--
- Expert:
- The Merge Scheduler in Lucene controls how merges are performed. The ConcurrentMergeScheduler (Lucene 2.3 default)
- can perform merges in the background using separate threads. The SerialMergeScheduler (Lucene 2.2 default) does not.
- -->
- <!--<mergeScheduler>org.apache.lucene.index.ConcurrentMergeScheduler</mergeScheduler>-->
-
- <!--
- As long as Solr is the only process modifying your index, it is
- safe to use Lucene's in process locking mechanism. But you may
- specify one of the other Lucene LockFactory implementations in
- the event that you have a custom situation.
-
- none = NoLockFactory (typically only used with read only indexes)
- single = SingleInstanceLockFactory (suggested)
- native = NativeFSLockFactory
- simple = SimpleFSLockFactory
-
- ('simple' is the default for backwards compatibility with Solr 1.2)
- -->
- <lockType>single</lockType>
- </indexDefaults>
-
- <mainIndex>
- <!-- options specific to the main on-disk lucene index -->
- <useCompoundFile>false</useCompoundFile>
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <mergeFactor>10</mergeFactor>
- <!-- Deprecated -->
- <!--<maxBufferedDocs>1000</maxBufferedDocs>-->
- <maxMergeDocs>2147483647</maxMergeDocs>
- <maxFieldLength>10000</maxFieldLength>
-
- <!-- If true, unlock any held write or commit locks on startup.
- This defeats the locking mechanism that allows multiple
- processes to safely access a lucene index, and should be
- used with care.
- This is not needed if lock type is 'none' or 'single'
- -->
- <unlockOnStartup>false</unlockOnStartup>
- </mainIndex>
+ <!-- <indexConfig> section could go here, but we want the defaults -->
<!-- the default high-performance update handler -->
<updateHandler class="solr.DirectUpdateHandler2">
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/contentstream-solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/contentstream-solrconfig.xml?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/contentstream-solrconfig.xml (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/contentstream-solrconfig.xml Mon Apr 2 22:55:37 2012
@@ -26,80 +26,7 @@
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
- <indexDefaults>
- <!-- Values here affect all index writers and act as a default unless overridden. -->
- <useCompoundFile>false</useCompoundFile>
-
- <mergeFactor>10</mergeFactor>
- <!--
- If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene will flush based on whichever limit is hit first.
-
- -->
- <!--<maxBufferedDocs>1000</maxBufferedDocs>-->
- <!-- Tell Lucene when to flush documents to disk.
- Giving Lucene more memory for indexing means faster indexing at the cost of more RAM
-
- If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene will flush based on whichever limit is hit first.
-
- -->
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <maxMergeDocs>2147483647</maxMergeDocs>
- <maxFieldLength>10000</maxFieldLength>
- <writeLockTimeout>1000</writeLockTimeout>
-
- <!--
- Expert:
- The Merge Policy in Lucene controls how merging is handled by Lucene. The default in 2.3 is the LogByteSizeMergePolicy, previous
- versions used LogDocMergePolicy.
-
- LogByteSizeMergePolicy chooses segments to merge based on their size. The Lucene 2.2 default, LogDocMergePolicy chose when
- to merge based on number of documents
-
- Other implementations of MergePolicy must have a no-argument constructor
- -->
- <!--<mergePolicy>org.apache.lucene.index.LogByteSizeMergePolicy</mergePolicy>-->
-
- <!--
- Expert:
- The Merge Scheduler in Lucene controls how merges are performed. The ConcurrentMergeScheduler (Lucene 2.3 default)
- can perform merges in the background using separate threads. The SerialMergeScheduler (Lucene 2.2 default) does not.
- -->
- <!--<mergeScheduler>org.apache.lucene.index.ConcurrentMergeScheduler</mergeScheduler>-->
-
- <!--
- As long as Solr is the only process modifying your index, it is
- safe to use Lucene's in process locking mechanism. But you may
- specify one of the other Lucene LockFactory implementations in
- the event that you have a custom situation.
-
- none = NoLockFactory (typically only used with read only indexes)
- single = SingleInstanceLockFactory (suggested)
- native = NativeFSLockFactory
- simple = SimpleFSLockFactory
-
- ('simple' is the default for backwards compatibility with Solr 1.2)
- -->
- <lockType>single</lockType>
- </indexDefaults>
-
- <mainIndex>
- <!-- options specific to the main on-disk lucene index -->
- <useCompoundFile>false</useCompoundFile>
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <mergeFactor>10</mergeFactor>
- <!-- Deprecated -->
- <!--<maxBufferedDocs>1000</maxBufferedDocs>-->
- <maxMergeDocs>2147483647</maxMergeDocs>
- <maxFieldLength>10000</maxFieldLength>
-
- <!-- If true, unlock any held write or commit locks on startup.
- This defeats the locking mechanism that allows multiple
- processes to safely access a lucene index, and should be
- used with care.
- This is not needed if lock type is 'none' or 'single'
- -->
- <unlockOnStartup>false</unlockOnStartup>
- </mainIndex>
+ <!-- <indexConfig> section could go here, but we want the defaults -->
<!-- the default high-performance update handler -->
<updateHandler class="solr.DirectUpdateHandler2">
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-nodatasource-solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-nodatasource-solrconfig.xml?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-nodatasource-solrconfig.xml (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-nodatasource-solrconfig.xml Mon Apr 2 22:55:37 2012
@@ -26,80 +26,9 @@
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
- <indexDefaults>
- <!-- Values here affect all index writers and act as a default unless overridden. -->
- <useCompoundFile>false</useCompoundFile>
-
- <mergeFactor>10</mergeFactor>
- <!--
- If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene will flush based on whichever limit is hit first.
-
- -->
- <!--<maxBufferedDocs>1000</maxBufferedDocs>-->
- <!-- Tell Lucene when to flush documents to disk.
- Giving Lucene more memory for indexing means faster indexing at the cost of more RAM
-
- If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene will flush based on whichever limit is hit first.
-
- -->
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <maxMergeDocs>2147483647</maxMergeDocs>
- <maxFieldLength>10000</maxFieldLength>
- <writeLockTimeout>1000</writeLockTimeout>
-
- <!--
- Expert:
- The Merge Policy in Lucene controls how merging is handled by Lucene. The default in 2.3 is the LogByteSizeMergePolicy, previous
- versions used LogDocMergePolicy.
-
- LogByteSizeMergePolicy chooses segments to merge based on their size. The Lucene 2.2 default, LogDocMergePolicy chose when
- to merge based on number of documents
-
- Other implementations of MergePolicy must have a no-argument constructor
- -->
- <!--<mergePolicy>org.apache.lucene.index.LogByteSizeMergePolicy</mergePolicy>-->
-
- <!--
- Expert:
- The Merge Scheduler in Lucene controls how merges are performed. The ConcurrentMergeScheduler (Lucene 2.3 default)
- can perform merges in the background using separate threads. The SerialMergeScheduler (Lucene 2.2 default) does not.
- -->
- <!--<mergeScheduler>org.apache.lucene.index.ConcurrentMergeScheduler</mergeScheduler>-->
-
- <!--
- As long as Solr is the only process modifying your index, it is
- safe to use Lucene's in process locking mechanism. But you may
- specify one of the other Lucene LockFactory implementations in
- the event that you have a custom situation.
-
- none = NoLockFactory (typically only used with read only indexes)
- single = SingleInstanceLockFactory (suggested)
- native = NativeFSLockFactory
- simple = SimpleFSLockFactory
-
- ('simple' is the default for backwards compatibility with Solr 1.2)
- -->
+ <indexConfig>
<lockType>single</lockType>
- </indexDefaults>
-
- <mainIndex>
- <!-- options specific to the main on-disk lucene index -->
- <useCompoundFile>false</useCompoundFile>
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <mergeFactor>10</mergeFactor>
- <!-- Deprecated -->
- <!--<maxBufferedDocs>1000</maxBufferedDocs>-->
- <maxMergeDocs>2147483647</maxMergeDocs>
- <maxFieldLength>10000</maxFieldLength>
-
- <!-- If true, unlock any held write or commit locks on startup.
- This defeats the locking mechanism that allows multiple
- processes to safely access a lucene index, and should be
- used with care.
- This is not needed if lock type is 'none' or 'single'
- -->
- <unlockOnStartup>false</unlockOnStartup>
- </mainIndex>
+ </indexConfig>
<!-- the default high-performance update handler -->
<updateHandler class="solr.DirectUpdateHandler2">
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-solrconfig.xml?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-solrconfig.xml (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-solrconfig.xml Mon Apr 2 22:55:37 2012
@@ -26,80 +26,7 @@
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
- <indexDefaults>
- <!-- Values here affect all index writers and act as a default unless overridden. -->
- <useCompoundFile>false</useCompoundFile>
-
- <mergeFactor>10</mergeFactor>
- <!--
- If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene will flush based on whichever limit is hit first.
-
- -->
- <!--<maxBufferedDocs>1000</maxBufferedDocs>-->
- <!-- Tell Lucene when to flush documents to disk.
- Giving Lucene more memory for indexing means faster indexing at the cost of more RAM
-
- If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene will flush based on whichever limit is hit first.
-
- -->
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <maxMergeDocs>2147483647</maxMergeDocs>
- <maxFieldLength>10000</maxFieldLength>
- <writeLockTimeout>1000</writeLockTimeout>
-
- <!--
- Expert:
- The Merge Policy in Lucene controls how merging is handled by Lucene. The default in 2.3 is the LogByteSizeMergePolicy, previous
- versions used LogDocMergePolicy.
-
- LogByteSizeMergePolicy chooses segments to merge based on their size. The Lucene 2.2 default, LogDocMergePolicy chose when
- to merge based on number of documents
-
- Other implementations of MergePolicy must have a no-argument constructor
- -->
- <!--<mergePolicy>org.apache.lucene.index.LogByteSizeMergePolicy</mergePolicy>-->
-
- <!--
- Expert:
- The Merge Scheduler in Lucene controls how merges are performed. The ConcurrentMergeScheduler (Lucene 2.3 default)
- can perform merges in the background using separate threads. The SerialMergeScheduler (Lucene 2.2 default) does not.
- -->
- <!--<mergeScheduler>org.apache.lucene.index.ConcurrentMergeScheduler</mergeScheduler>-->
-
- <!--
- As long as Solr is the only process modifying your index, it is
- safe to use Lucene's in process locking mechanism. But you may
- specify one of the other Lucene LockFactory implementations in
- the event that you have a custom situation.
-
- none = NoLockFactory (typically only used with read only indexes)
- single = SingleInstanceLockFactory (suggested)
- native = NativeFSLockFactory
- simple = SimpleFSLockFactory
-
- ('simple' is the default for backwards compatibility with Solr 1.2)
- -->
- <lockType>single</lockType>
- </indexDefaults>
-
- <mainIndex>
- <!-- options specific to the main on-disk lucene index -->
- <useCompoundFile>false</useCompoundFile>
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <mergeFactor>10</mergeFactor>
- <!-- Deprecated -->
- <!--<maxBufferedDocs>1000</maxBufferedDocs>-->
- <maxMergeDocs>2147483647</maxMergeDocs>
- <maxFieldLength>10000</maxFieldLength>
-
- <!-- If true, unlock any held write or commit locks on startup.
- This defeats the locking mechanism that allows multiple
- processes to safely access a lucene index, and should be
- used with care.
- This is not needed if lock type is 'none' or 'single'
- -->
- <unlockOnStartup>false</unlockOnStartup>
- </mainIndex>
+ <!-- <indexConfig> section could go here, but we want the defaults -->
<!-- the default high-performance update handler -->
<updateHandler class="solr.DirectUpdateHandler2">
Modified: lucene/dev/trunk/solr/contrib/extraction/src/test-files/extraction/solr/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/extraction/src/test-files/extraction/solr/conf/solrconfig.xml?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/extraction/src/test-files/extraction/solr/conf/solrconfig.xml (original)
+++ lucene/dev/trunk/solr/contrib/extraction/src/test-files/extraction/solr/conf/solrconfig.xml Mon Apr 2 22:55:37 2012
@@ -32,59 +32,7 @@
<dataDir>${solr.data.dir:}</dataDir>
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
- <indexDefaults>
- <!-- Values here affect all index writers and act as a default
- unless overridden. -->
- <!-- Values here affect all index writers and act as a default unless overridden. -->
- <useCompoundFile>false</useCompoundFile>
- <mergeFactor>10</mergeFactor>
- <!-- If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene will flush based on whichever limit is hit first.
- -->
- <!--<maxBufferedDocs>1000</maxBufferedDocs>-->
- <!-- Tell Lucene when to flush documents to disk.
- Giving Lucene more memory for indexing means faster indexing at the cost of more RAM
-
- If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene will flush based on whichever limit is hit first.
-
- -->
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <maxMergeDocs>2147483647</maxMergeDocs>
- <maxFieldLength>10000</maxFieldLength>
-
- <!--
- Expert:
- The Merge Policy in Lucene controls how merging is handled by Lucene. The default in 2.3 is the LogByteSizeMergePolicy, previous
- versions used LogDocMergePolicy.
-
- LogByteSizeMergePolicy chooses segments to merge based on their size. The Lucene 2.2 default, LogDocMergePolicy chose when
- to merge based on number of documents
-
- Other implementations of MergePolicy must have a no-argument constructor
- -->
- <mergePolicy>org.apache.lucene.index.LogByteSizeMergePolicy</mergePolicy>
-
- <!--
- Expert:
- The Merge Scheduler in Lucene controls how merges are performed. The ConcurrentMergeScheduler (Lucene 2.3 default)
- can perform merges in the background using separate threads. The SerialMergeScheduler (Lucene 2.2 default) does not.
- -->
- <mergeScheduler>org.apache.lucene.index.ConcurrentMergeScheduler</mergeScheduler>
- <!-- these are global... can't currently override per index -->
- <writeLockTimeout>1000</writeLockTimeout>
-
- <lockType>single</lockType>
- </indexDefaults>
-
- <mainIndex>
- <!-- lucene options specific to the main on-disk lucene index -->
- <useCompoundFile>false</useCompoundFile>
- <mergeFactor>10</mergeFactor>
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <maxMergeDocs>2147483647</maxMergeDocs>
- <maxFieldLength>10000</maxFieldLength>
-
- <unlockOnStartup>true</unlockOnStartup>
- </mainIndex>
+ <!-- <indexConfig> section could go here, but we want the defaults -->
<updateHandler class="solr.DirectUpdateHandler2">
Modified: lucene/dev/trunk/solr/contrib/uima/src/test-files/uima/solr/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/uima/src/test-files/uima/solr/conf/solrconfig.xml?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/uima/src/test-files/uima/solr/conf/solrconfig.xml (original)
+++ lucene/dev/trunk/solr/contrib/uima/src/test-files/uima/solr/conf/solrconfig.xml Mon Apr 2 22:55:37 2012
@@ -68,153 +68,7 @@
-->
<dataDir>${solr.data.dir:}</dataDir>
-
- <!--
- WARNING: this <indexDefaults> section only provides defaults for
- index writers in general. See also the <mainIndex> section after
- that when changing parameters for Solr's main Lucene index.
- -->
- <indexDefaults>
- <!--
- Values here affect all index writers and act as a default unless
- overridden.
- -->
- <useCompoundFile>false</useCompoundFile>
-
- <mergeFactor>10</mergeFactor>
- <!--
- If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene
- will flush based on whichever limit is hit first.
- -->
- <!--<maxBufferedDocs>1000</maxBufferedDocs>-->
-
- <!--
- Sets the amount of RAM that may be used by Lucene indexing for
- buffering added documents and deletions before they are flushed to
- the Directory.
- -->
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <!-- <maxMergeDocs>2147483647</maxMergeDocs> -->
- <maxFieldLength>10000</maxFieldLength>
- <writeLockTimeout>1000</writeLockTimeout>
-
- <!--
- Expert: Turn on Lucene's auto commit capability. This causes
- intermediate segment flushes to write a new lucene index
- descriptor, enabling it to be opened by an external IndexReader.
- This can greatly slow down indexing speed. NOTE: Despite the name,
- this value does not have any relation to Solr's autoCommit
- functionality
- -->
- <!--<luceneAutoCommit>false</luceneAutoCommit>-->
-
- <!--
- Expert: The Merge Policy in Lucene controls how merging is handled
- by Lucene. The default in 2.3 is the LogByteSizeMergePolicy,
- previous versions used LogDocMergePolicy. LogByteSizeMergePolicy
- chooses segments to merge based on their size. The Lucene 2.2
- default, LogDocMergePolicy chose when to merge based on number of
- documents Other implementations of MergePolicy must have a
- no-argument constructor
- -->
- <!--
- <mergePolicy
- class="org.apache.lucene.index.LogByteSizeMergePolicy"/>
- -->
-
- <!--
- Expert: The Merge Scheduler in Lucene controls how merges are
- performed. The ConcurrentMergeScheduler (Lucene 2.3 default) can
- perform merges in the background using separate threads. The
- SerialMergeScheduler (Lucene 2.2 default) does not.
- -->
- <!--
- <mergeScheduler
- class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
- -->
-
-
- <!--
- This option specifies which Lucene LockFactory implementation to
- use. single = SingleInstanceLockFactory - suggested for a
- read-only index or when there is no possibility of another process
- trying to modify the index. native = NativeFSLockFactory - uses OS
- native file locking simple = SimpleFSLockFactory - uses a plain
- file for locking (For backwards compatibility with Solr 1.2,
- 'simple' is the default if not specified.)
- -->
- <lockType>native</lockType>
- <!--
- Expert: Controls how often Lucene loads terms into memory
- -->
- <!--<termIndexInterval>256</termIndexInterval>-->
- </indexDefaults>
-
- <mainIndex>
- <!-- options specific to the main on-disk lucene index -->
- <useCompoundFile>false</useCompoundFile>
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <mergeFactor>10</mergeFactor>
- <!-- Deprecated -->
- <!--<maxBufferedDocs>1000</maxBufferedDocs>-->
- <!--<maxMergeDocs>2147483647</maxMergeDocs>-->
-
- <!--
- inherit from indexDefaults <maxFieldLength>10000</maxFieldLength>
- -->
-
- <!--
- If true, unlock any held write or commit locks on startup. This
- defeats the locking mechanism that allows multiple processes to
- safely access a lucene index, and should be used with care. 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>
-
- <!--
- Expert: Controls how often Lucene loads terms into memory. Default
- is 128 and is likely good for most everyone.
- -->
- <!--<termIndexInterval>256</termIndexInterval>-->
-
- <!--
- Custom deletion policies can specified here. The class must
- implement org.apache.lucene.index.IndexDeletionPolicy.
-
- http://lucene.apache.org/java/2_3_2/api/org/apache/lucene/index/IndexDeletionPolicy.html
-
- The standard Solr IndexDeletionPolicy implementation supports
- deleting index commit points on number of commits, age of commit
- point and optimized status. The latest commit point should always
- be preserved regardless of the criteria.
- -->
- <deletionPolicy class="solr.SolrDeletionPolicy">
- <!-- The number of commit points to be kept -->
- <str name="maxCommitsToKeep">1</str>
- <!-- The number of optimized commit points to be kept -->
- <str name="maxOptimizedCommitsToKeep">0</str>
- <!--
- Delete all commit points once they have reached the given age.
- Supports DateMathParser syntax e.g. <str
- name="maxCommitAge">30MINUTES</str> <str
- name="maxCommitAge">1DAY</str>
- -->
- </deletionPolicy>
-
- <!--
- To aid in advanced debugging, you may turn on IndexWriter debug
- logging. Setting to true will set the file that the underlying
- Lucene IndexWriter will write its debug infostream to.
- -->
- <infoStream file="INFOSTREAM.txt">false</infoStream>
-
- </mainIndex>
+ <!-- <indexConfig> section could go here, but we want the defaults -->
<!--
Enables JMX if and only if an existing MBeanServer is found, use
Modified: lucene/dev/trunk/solr/contrib/uima/src/test-files/uima/uima-tokenizers-solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/uima/src/test-files/uima/uima-tokenizers-solrconfig.xml?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/uima/src/test-files/uima/uima-tokenizers-solrconfig.xml (original)
+++ lucene/dev/trunk/solr/contrib/uima/src/test-files/uima/uima-tokenizers-solrconfig.xml Mon Apr 2 22:55:37 2012
@@ -68,153 +68,7 @@
-->
<dataDir>${solr.data.dir:}</dataDir>
-
- <!--
- WARNING: this <indexDefaults> section only provides defaults for
- index writers in general. See also the <mainIndex> section after
- that when changing parameters for Solr's main Lucene index.
- -->
- <indexDefaults>
- <!--
- Values here affect all index writers and act as a default unless
- overridden.
- -->
- <useCompoundFile>false</useCompoundFile>
-
- <mergeFactor>10</mergeFactor>
- <!--
- If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene
- will flush based on whichever limit is hit first.
- -->
- <!--<maxBufferedDocs>1000</maxBufferedDocs>-->
-
- <!--
- Sets the amount of RAM that may be used by Lucene indexing for
- buffering added documents and deletions before they are flushed to
- the Directory.
- -->
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <!-- <maxMergeDocs>2147483647</maxMergeDocs> -->
- <maxFieldLength>10000</maxFieldLength>
- <writeLockTimeout>1000</writeLockTimeout>
-
- <!--
- Expert: Turn on Lucene's auto commit capability. This causes
- intermediate segment flushes to write a new lucene index
- descriptor, enabling it to be opened by an external IndexReader.
- This can greatly slow down indexing speed. NOTE: Despite the name,
- this value does not have any relation to Solr's autoCommit
- functionality
- -->
- <!--<luceneAutoCommit>false</luceneAutoCommit>-->
-
- <!--
- Expert: The Merge Policy in Lucene controls how merging is handled
- by Lucene. The default in 2.3 is the LogByteSizeMergePolicy,
- previous versions used LogDocMergePolicy. LogByteSizeMergePolicy
- chooses segments to merge based on their size. The Lucene 2.2
- default, LogDocMergePolicy chose when to merge based on number of
- documents Other implementations of MergePolicy must have a
- no-argument constructor
- -->
- <!--
- <mergePolicy
- class="org.apache.lucene.index.LogByteSizeMergePolicy"/>
- -->
-
- <!--
- Expert: The Merge Scheduler in Lucene controls how merges are
- performed. The ConcurrentMergeScheduler (Lucene 2.3 default) can
- perform merges in the background using separate threads. The
- SerialMergeScheduler (Lucene 2.2 default) does not.
- -->
- <!--
- <mergeScheduler
- class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
- -->
-
-
- <!--
- This option specifies which Lucene LockFactory implementation to
- use. single = SingleInstanceLockFactory - suggested for a
- read-only index or when there is no possibility of another process
- trying to modify the index. native = NativeFSLockFactory - uses OS
- native file locking simple = SimpleFSLockFactory - uses a plain
- file for locking (For backwards compatibility with Solr 1.2,
- 'simple' is the default if not specified.)
- -->
- <lockType>native</lockType>
- <!--
- Expert: Controls how often Lucene loads terms into memory
- -->
- <!--<termIndexInterval>256</termIndexInterval>-->
- </indexDefaults>
-
- <mainIndex>
- <!-- options specific to the main on-disk lucene index -->
- <useCompoundFile>false</useCompoundFile>
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <mergeFactor>10</mergeFactor>
- <!-- Deprecated -->
- <!--<maxBufferedDocs>1000</maxBufferedDocs>-->
- <!--<maxMergeDocs>2147483647</maxMergeDocs>-->
-
- <!--
- inherit from indexDefaults <maxFieldLength>10000</maxFieldLength>
- -->
-
- <!--
- If true, unlock any held write or commit locks on startup. This
- defeats the locking mechanism that allows multiple processes to
- safely access a lucene index, and should be used with care. 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>
-
- <!--
- Expert: Controls how often Lucene loads terms into memory. Default
- is 128 and is likely good for most everyone.
- -->
- <!--<termIndexInterval>256</termIndexInterval>-->
-
- <!--
- Custom deletion policies can specified here. The class must
- implement org.apache.lucene.index.IndexDeletionPolicy.
-
- http://lucene.apache.org/java/2_3_2/api/org/apache/lucene/index/IndexDeletionPolicy.html
-
- The standard Solr IndexDeletionPolicy implementation supports
- deleting index commit points on number of commits, age of commit
- point and optimized status. The latest commit point should always
- be preserved regardless of the criteria.
- -->
- <deletionPolicy class="solr.SolrDeletionPolicy">
- <!-- The number of commit points to be kept -->
- <str name="maxCommitsToKeep">1</str>
- <!-- The number of optimized commit points to be kept -->
- <str name="maxOptimizedCommitsToKeep">0</str>
- <!--
- Delete all commit points once they have reached the given age.
- Supports DateMathParser syntax e.g. <str
- name="maxCommitAge">30MINUTES</str> <str
- name="maxCommitAge">1DAY</str>
- -->
- </deletionPolicy>
-
- <!--
- To aid in advanced debugging, you may turn on IndexWriter debug
- logging. Setting to true will set the file that the underlying
- Lucene IndexWriter will write its debug infostream to.
- -->
- <infoStream file="INFOSTREAM.txt">false</infoStream>
-
- </mainIndex>
+ <!-- <indexConfig> section could go here, but we want the defaults -->
<!--
Enables JMX if and only if an existing MBeanServer is found, use
Modified: lucene/dev/trunk/solr/contrib/velocity/src/test-files/velocity/solr/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/velocity/src/test-files/velocity/solr/conf/solrconfig.xml?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/velocity/src/test-files/velocity/solr/conf/solrconfig.xml (original)
+++ lucene/dev/trunk/solr/contrib/velocity/src/test-files/velocity/solr/conf/solrconfig.xml Mon Apr 2 22:55:37 2012
@@ -32,28 +32,7 @@
class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/>
- <indexDefaults>
- <useCompoundFile>false</useCompoundFile>
- <mergeFactor>10</mergeFactor>
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <maxFieldLength>10000</maxFieldLength>
- <writeLockTimeout>1000</writeLockTimeout>
- <commitLockTimeout>10000</commitLockTimeout>
- <lockType>native</lockType>
- </indexDefaults>
-
- <mainIndex>
- <useCompoundFile>false</useCompoundFile>
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <mergeFactor>10</mergeFactor>
- <unlockOnStartup>false</unlockOnStartup>
- <reopenReaders>true</reopenReaders>
- <deletionPolicy class="solr.SolrDeletionPolicy">
- <str name="maxCommitsToKeep">1</str>
- <str name="maxOptimizedCommitsToKeep">0</str>
- </deletionPolicy>
- <infoStream file="INFOSTREAM.txt">false</infoStream>
- </mainIndex>
+ <!-- <indexConfig> section could go here, but we want the defaults -->
<updateHandler class="solr.DirectUpdateHandler2">
</updateHandler>
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrConfig.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrConfig.java?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrConfig.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrConfig.java Mon Apr 2 22:55:37 2012
@@ -18,6 +18,7 @@
package org.apache.solr.core;
import org.apache.solr.common.SolrException;
+import org.apache.solr.common.SolrException.ErrorCode;
import org.apache.solr.common.util.DOMUtil;
import org.apache.solr.common.util.RegexFileFilter;
import org.apache.solr.handler.component.SearchComponent;
@@ -59,8 +60,6 @@ import java.io.IOException;
* Provides a static reference to a Config object modeling the main
* configuration data for a a Solr instance -- typically found in
* "solrconfig.xml".
- *
- *
*/
public class SolrConfig extends Config {
@@ -118,16 +117,48 @@ public class SolrConfig extends Config {
super(loader, name, is, "/config/");
initLibs();
luceneMatchVersion = getLuceneVersion("luceneMatchVersion");
- defaultIndexConfig = new SolrIndexConfig(this, null, null);
- mainIndexConfig = new SolrIndexConfig(this, "mainIndex", defaultIndexConfig);
- reopenReaders = getBool("mainIndex/reopenReaders", true);
+ String indexConfigPrefix;
+
+ // Old indexDefaults and mainIndex sections are deprecated and fails fast for luceneMatchVersion=>LUCENE_40.
+ // For older solrconfig.xml's we allow the old sections, but never mixed with the new <indexConfig>
+ boolean hasDeprecatedIndexConfig = get("indexDefaults/text()", null) != null || get("mainIndex/text()", null) != null;
+ boolean hasNewIndexConfig = get("indexConfig/text()", null) != null;
+ if(hasDeprecatedIndexConfig){
+ if(luceneMatchVersion.onOrAfter(Version.LUCENE_40)) {
+ throw new SolrException(ErrorCode.FORBIDDEN, "<indexDefaults> and <mainIndex> configuration sections are discontinued. Use <indexConfig> instead.");
+ } else {
+ // Still allow the old sections for older LuceneMatchVersion's
+ if(hasNewIndexConfig) {
+ throw new SolrException(ErrorCode.FORBIDDEN, "Cannot specify both <indexDefaults>, <mainIndex> and <indexConfig> at the same time. Please use <indexConfig> only.");
+ }
+ log.warn("<indexDefaults> and <mainIndex> configuration sections are deprecated and will fail for luceneMatchVersion=LUCENE_40 and later. Please use <indexConfig> instead.");
+ defaultIndexConfig = new SolrIndexConfig(this, "indexDefaults", null);
+ mainIndexConfig = new SolrIndexConfig(this, "mainIndex", defaultIndexConfig);
+ indexConfigPrefix = "mainIndex";
+ }
+ } else {
+ defaultIndexConfig = mainIndexConfig = null;
+ indexConfigPrefix = "indexConfig";
+ }
+ // Parse indexConfig section, using mainIndex as backup in case old config is used
+ indexConfig = new SolrIndexConfig(this, "indexConfig", mainIndexConfig);
+
+ reopenReaders = getBool(indexConfigPrefix+"/reopenReaders", true);
booleanQueryMaxClauseCount = getInt("query/maxBooleanClauses", BooleanQuery.getMaxClauseCount());
log.info("Using Lucene MatchVersion: " + luceneMatchVersion);
- filtOptEnabled = getBool("query/boolTofilterOptimizer/@enabled", false);
- filtOptCacheSize = getInt("query/boolTofilterOptimizer/@cacheSize",32);
- filtOptThreshold = getFloat("query/boolTofilterOptimizer/@threshold",.05f);
+ // Warn about deprecated / discontinued parameters
+ // boolToFilterOptimizer has had no effect since 3.1
+ if(get("query/boolTofilterOptimizer", null) != null)
+ log.warn("solrconfig.xml: <boolTofilterOptimizer> is currently not implemented and has no effect.");
+ if(get("query/HashDocSet", null) != null)
+ log.warn("solrconfig.xml: <HashDocSet> is deprecated and no longer recommended used.");
+
+// TODO: Old code - in case somebody wants to re-enable. Also see SolrIndexSearcher#search()
+// filtOptEnabled = getBool("query/boolTofilterOptimizer/@enabled", false);
+// filtOptCacheSize = getInt("query/boolTofilterOptimizer/@cacheSize",32);
+// filtOptThreshold = getFloat("query/boolTofilterOptimizer/@threshold",.05f);
useFilterForSortedQuery = getBool("query/useFilterForSortedQuery", false);
queryResultWindowSize = Math.max(1, getInt("query/queryResultWindowSize", 1));
@@ -148,7 +179,7 @@ public class SolrConfig extends Config {
conf = new CacheConfig(FastLRUCache.class, args, null);
}
fieldValueCacheConfig = conf;
- unlockOnStartup = getBool("mainIndex/unlockOnStartup", false);
+ unlockOnStartup = getBool(indexConfigPrefix+"/unlockOnStartup", false);
useColdSearcher = getBool("query/useColdSearcher",false);
dataDir = get("dataDir", null);
if (dataDir != null && dataDir.length()==0) dataDir=null;
@@ -189,7 +220,7 @@ public class SolrConfig extends Config {
loadPluginInfo(SolrEventListener.class, "//listener",false, true);
loadPluginInfo(DirectoryFactory.class,"directoryFactory",false, true);
- loadPluginInfo(IndexDeletionPolicy.class,"mainIndex/deletionPolicy",false, true);
+ loadPluginInfo(IndexDeletionPolicy.class,indexConfigPrefix+"/deletionPolicy",false, true);
loadPluginInfo(CodecFactory.class,"mainIndex/codecFactory",false, false);
loadPluginInfo(IndexReaderFactory.class,"indexReaderFactory",false, true);
loadPluginInfo(UpdateRequestProcessorChain.class,"updateRequestProcessorChain",false, false);
@@ -227,10 +258,10 @@ public class SolrConfig extends Config {
/* The set of materialized parameters: */
public final int booleanQueryMaxClauseCount;
- // SolrIndexSearcher - nutch optimizer
- public final boolean filtOptEnabled;
- public final int filtOptCacheSize;
- public final float filtOptThreshold;
+// SolrIndexSearcher - nutch optimizer -- Disabled since 3.1
+// public final boolean filtOptEnabled;
+// public final int filtOptCacheSize;
+// public final float filtOptThreshold;
// SolrIndexSearcher - caches configurations
public final CacheConfig filterCacheConfig ;
public final CacheConfig queryResultCacheConfig;
@@ -246,9 +277,13 @@ public class SolrConfig extends Config {
// DocSet
public final float hashSetInverseLoadFactor;
public final int hashDocSetMaxSize;
- // default & main index configurations
+ // default & main index configurations, deprecated as of 3.6
+ @Deprecated
public final SolrIndexConfig defaultIndexConfig;
+ @Deprecated
public final SolrIndexConfig mainIndexConfig;
+ // IndexConfig settings
+ public final SolrIndexConfig indexConfig;
protected UpdateHandlerInfo updateHandlerInfo ;
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrCore.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrCore.java?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrCore.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrCore.java Mon Apr 2 22:55:37 2012
@@ -323,7 +323,7 @@ public final class SolrCore implements S
// gets a non-caching searcher
public SolrIndexSearcher newSearcher(String name) throws IOException {
- return new SolrIndexSearcher(this, getNewIndexDir(), schema, getSolrConfig().mainIndexConfig, name, false, directoryFactory);
+ return new SolrIndexSearcher(this, getNewIndexDir(), schema, getSolrConfig().indexConfig, name, false, directoryFactory);
}
@@ -370,7 +370,7 @@ public final class SolrCore implements S
if (indexExists && firstTime) {
// to remove locks, the directory must already exist... so we create it
// if it didn't exist already...
- Directory dir = directoryFactory.get(indexDir, getSolrConfig().mainIndexConfig.lockType);
+ Directory dir = directoryFactory.get(indexDir, getSolrConfig().indexConfig.lockType);
if (dir != null) {
if (IndexWriter.isLocked(dir)) {
if (removeLocks) {
@@ -390,7 +390,7 @@ public final class SolrCore implements S
log.warn(logid+"Solr index directory '" + new File(indexDir) + "' doesn't exist."
+ " Creating new index...");
- SolrIndexWriter writer = new SolrIndexWriter("SolrCore.initIndex", indexDir, getDirectoryFactory(), true, schema, solrConfig.mainIndexConfig, solrDelPolicy, codec, false);
+ SolrIndexWriter writer = new SolrIndexWriter("SolrCore.initIndex", indexDir, getDirectoryFactory(), true, schema, solrConfig.indexConfig, solrDelPolicy, codec, false);
writer.close();
}
@@ -1134,7 +1134,7 @@ public final class SolrCore implements S
} else {
// verbose("non-reopen START:");
- tmp = new SolrIndexSearcher(this, newIndexDir, schema, getSolrConfig().mainIndexConfig, "main", true, directoryFactory);
+ tmp = new SolrIndexSearcher(this, newIndexDir, schema, getSolrConfig().indexConfig, "main", true, directoryFactory);
// verbose("non-reopen DONE: searcher=",tmp);
}
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java Mon Apr 2 22:55:37 2012
@@ -243,7 +243,7 @@ public class CoreAdminHandler extends Re
dirsToBeReleased = new Directory[dirNames.length];
DirectoryFactory dirFactory = core.getDirectoryFactory();
for (int i = 0; i < dirNames.length; i++) {
- Directory dir = dirFactory.get(dirNames[i], core.getSolrConfig().mainIndexConfig.lockType);
+ Directory dir = dirFactory.get(dirNames[i], core.getSolrConfig().indexConfig.lockType);
dirsToBeReleased[i] = dir;
// TODO: why doesn't this use the IR factory? what is going on here?
readersToBeClosed[i] = DirectoryReader.open(dir);
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/SpellCheckComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/SpellCheckComponent.java?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/SpellCheckComponent.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/SpellCheckComponent.java Mon Apr 2 22:55:37 2012
@@ -563,7 +563,7 @@ public class SpellCheckComponent extends
//ensure that there is at least one query converter defined
if (queryConverters.size() == 0) {
- LOG.warn("No queryConverter defined, using default converter");
+ LOG.info("No queryConverter defined, using default converter");
queryConverters.put("queryConverter", new SpellingQueryConverter());
}
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java Mon Apr 2 22:55:37 2012
@@ -188,8 +188,11 @@ public class SolrIndexSearcher extends I
cacheMap = noGenericCaches;
cacheList= noCaches;
}
- optimizer = solrConfig.filtOptEnabled ? new LuceneQueryOptimizer(solrConfig.filtOptCacheSize,solrConfig.filtOptThreshold) : null;
-
+
+ // TODO: This option has been dead/noop since 3.1, should we re-enable it?
+// optimizer = solrConfig.filtOptEnabled ? new LuceneQueryOptimizer(solrConfig.filtOptCacheSize,solrConfig.filtOptThreshold) : null;
+ optimizer = null;
+
fieldNames = new HashSet<String>();
for(FieldInfo fieldInfo : atomicReader.getFieldInfos()) {
fieldNames.add(fieldInfo.name);
@@ -382,6 +385,7 @@ public class SolrIndexSearcher extends I
return qr;
}
+// FIXME: This option has been dead/noop since 3.1, should we re-enable or remove it?
// public Hits search(Query query, Filter filter, Sort sort) throws IOException {
// // todo - when Solr starts accepting filters, need to
// // change this conditional check (filter!=null) and create a new filter
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java Mon Apr 2 22:55:37 2012
@@ -111,7 +111,7 @@ public final class DefaultSolrCoreState
boolean removeAllExisting, boolean forceNewDirectory) throws IOException {
return new SolrIndexWriter(name, core.getNewIndexDir(),
core.getDirectoryFactory(), removeAllExisting, core.getSchema(),
- core.getSolrConfig().mainIndexConfig, core.getDeletionPolicy(), core.getCodec(), forceNewDirectory);
+ core.getSolrConfig().indexConfig, core.getDeletionPolicy(), core.getCodec(), forceNewDirectory);
}
@Override
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java Mon Apr 2 22:55:37 2012
@@ -19,6 +19,8 @@ package org.apache.solr.update;
import org.apache.lucene.index.*;
import org.apache.lucene.util.Version;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.SolrException.ErrorCode;
import org.apache.solr.core.SolrConfig;
import org.apache.solr.core.PluginInfo;
import org.apache.solr.schema.IndexSchema;
@@ -27,40 +29,17 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
-import java.util.Map;
-import java.util.HashMap;
-//
-// For performance reasons, we don't want to re-read
-// config params each time an index writer is created.
-// This config object encapsulates IndexWriter config params.
-//
/**
- *
+ * This config object encapsulates IndexWriter config params,
+ * defined in the <indexConfig> section of solrconfig.xml
+ * @version $Id$
*/
public class SolrIndexConfig {
public static final Logger log = LoggerFactory.getLogger(SolrIndexConfig.class);
- public static final String defaultsName ="indexDefaults";
final String defaultMergePolicyClassName;
public static final String DEFAULT_MERGE_SCHEDULER_CLASSNAME = ConcurrentMergeScheduler.class.getName();
- static final SolrIndexConfig defaultDefaults = new SolrIndexConfig();
-
- private SolrIndexConfig() {
- luceneVersion = Version.LUCENE_40;
- useCompoundFile = true;
- maxBufferedDocs = -1;
- maxMergeDocs = -1;
- mergeFactor = -1;
- ramBufferSizeMB = 16;
- writeLockTimeout = -1;
- lockType = null;
- termIndexInterval = IndexWriterConfig.DEFAULT_TERM_INDEX_INTERVAL;
- mergePolicyInfo = null;
- mergeSchedulerInfo = null;
- defaultMergePolicyClassName = TieredMergePolicy.class.getName();
- }
-
public final Version luceneVersion;
public final boolean useCompoundFile;
@@ -78,15 +57,65 @@ public class SolrIndexConfig {
public String infoStreamFile = null;
+ // Available lock types
+ public final static String LOCK_TYPE_SIMPLE = "simple";
+ public final static String LOCK_TYPE_NATIVE = "native";
+ public final static String LOCK_TYPE_SINGLE = "single";
+ public final static String LOCK_TYPE_NONE = "none";
+
+ /**
+ * Internal constructor for setting defaults based on Lucene Version
+ */
+ @SuppressWarnings("deprecation")
+ private SolrIndexConfig(SolrConfig solrConfig) {
+ luceneVersion = solrConfig.luceneMatchVersion;
+ useCompoundFile = luceneVersion.onOrAfter(Version.LUCENE_36) ? false : true;
+ maxBufferedDocs = -1;
+ maxMergeDocs = -1;
+ mergeFactor = -1;
+ ramBufferSizeMB = luceneVersion.onOrAfter(Version.LUCENE_36) ? 32 : 16;
+ writeLockTimeout = -1;
+ lockType = luceneVersion.onOrAfter(Version.LUCENE_36) ?
+ LOCK_TYPE_NATIVE :
+ LOCK_TYPE_SIMPLE;
+ termIndexInterval = IndexWriterConfig.DEFAULT_TERM_INDEX_INTERVAL;
+ mergePolicyInfo = null;
+ mergeSchedulerInfo = null;
+ defaultMergePolicyClassName = luceneVersion.onOrAfter(Version.LUCENE_33) ? TieredMergePolicy.class.getName() : LogByteSizeMergePolicy.class.getName();
+ }
+
+ /**
+ * Constructs a SolrIndexConfig which parses the Lucene related config params in solrconfig.xml
+ * @param solrConfig the overall SolrConfig object
+ * @param prefix the XPath prefix for which section to parse (mandatory)
+ * @param def a SolrIndexConfig instance to pick default values from (optional)
+ */
+ @SuppressWarnings("deprecation")
public SolrIndexConfig(SolrConfig solrConfig, String prefix, SolrIndexConfig def) {
- if (prefix == null)
- prefix = defaultsName;
- if (def == null)
- def = defaultDefaults;
+ if (prefix == null) {
+ prefix = "indexConfig";
+ log.debug("Defaulting to prefix \""+prefix+"\" for index configuration");
+ }
+
+ if (def == null) {
+ def = new SolrIndexConfig(solrConfig);
+ }
luceneVersion = solrConfig.luceneMatchVersion;
- defaultMergePolicyClassName = luceneVersion.onOrAfter(Version.LUCENE_33) ? TieredMergePolicy.class.getName() : LogByteSizeMergePolicy.class.getName();
+ // Assert that end-of-life parameters or syntax is not in our config.
+ // Warn for luceneMatchVersion's before LUCENE_36, fail fast above
+ assertWarnOrFail("The <mergeScheduler>myclass</mergeScheduler> syntax is no longer supported in solrconfig.xml. Please use syntax <mergeScheduler class=\"myclass\"/> instead.",
+ !((solrConfig.get(prefix+"/mergeScheduler/text()",null) != null) && (solrConfig.get(prefix+"/mergeScheduler/@class",null) == null)),
+ luceneVersion.onOrAfter(Version.LUCENE_36));
+ assertWarnOrFail("The <mergePolicy>myclass</mergePolicy> syntax is no longer supported in solrconfig.xml. Please use syntax <mergePolicy class=\"myclass\"/> instead.",
+ !((solrConfig.get(prefix+"/mergePolicy/text()",null) != null) && (solrConfig.get(prefix+"/mergePolicy/@class",null) == null)),
+ luceneVersion.onOrAfter(Version.LUCENE_36));
+ assertWarnOrFail("The <luceneAutoCommit>true|false</luceneAutoCommit> parameter is no longer valid in solrconfig.xml.",
+ solrConfig.get(prefix+"/luceneAutoCommit", null) == null,
+ luceneVersion.onOrAfter(Version.LUCENE_36));
+
+ defaultMergePolicyClassName = def.defaultMergePolicyClassName;
useCompoundFile=solrConfig.getBool(prefix+"/useCompoundFile", def.useCompoundFile);
maxBufferedDocs=solrConfig.getInt(prefix+"/maxBufferedDocs",def.maxBufferedDocs);
maxMergeDocs=solrConfig.getInt(prefix+"/maxMergeDocs",def.maxMergeDocs);
@@ -96,33 +125,8 @@ public class SolrIndexConfig {
writeLockTimeout=solrConfig.getInt(prefix+"/writeLockTimeout", def.writeLockTimeout);
lockType=solrConfig.get(prefix+"/lockType", def.lockType);
- String str = solrConfig.get(prefix+"/mergeScheduler/text()",null);
- if(str != null && str.trim().length() >0){
- //legacy handling <mergeScheduler>[classname]</mergeScheduler>
- //remove in Solr2.0
- log.warn("deprecated syntax : <mergeScheduler>[classname]</mergeScheduler>");
- Map<String,String> atrs = new HashMap<String, String>();
- atrs.put("class",str.trim());
- mergeSchedulerInfo = new PluginInfo("mergeScheduler",atrs,null,null);
- } else {
- mergeSchedulerInfo = getPluginInfo(prefix + "/mergeScheduler", solrConfig, def.mergeSchedulerInfo);
- }
- str = solrConfig.get(prefix+"/mergePolicy/text()",null);
- if(str != null && str.trim().length() >0){
- //legacy handling <mergePolicy>[classname]</mergePolicy>
- //remove in Solr2.0
- log.warn("deprecated syntax : <mergePolicy>[classname]</mergePolicy>");
- Map<String,String> atrs = new HashMap<String, String>();
- atrs.put("class",str.trim());
- mergePolicyInfo = new PluginInfo("mergePolicy",atrs,null,null);
- } else {
- mergePolicyInfo = getPluginInfo(prefix + "/mergePolicy", solrConfig, def.mergePolicyInfo);
- }
-
- Object luceneAutoCommit = solrConfig.get(prefix + "/luceneAutoCommit", null);
- if(luceneAutoCommit != null) {
- log.warn("found deprecated option : luceneAutoCommit no longer has any affect - it is always false");
- }
+ mergeSchedulerInfo = getPluginInfo(prefix + "/mergeScheduler", solrConfig, def.mergeSchedulerInfo);
+ mergePolicyInfo = getPluginInfo(prefix + "/mergePolicy", solrConfig, def.mergePolicyInfo);
termIndexInterval = solrConfig.getInt(prefix + "/termIndexInterval", def.termIndexInterval);
@@ -133,6 +137,21 @@ public class SolrIndexConfig {
}
}
+ /*
+ * Assert that assertCondition is true.
+ * If not, prints reason as log warning.
+ * If failCondition is true, then throw exception instead of warning
+ */
+ private void assertWarnOrFail(String reason, boolean assertCondition, boolean failCondition) {
+ if(assertCondition) {
+ return;
+ } else if(failCondition) {
+ throw new SolrException(ErrorCode.FORBIDDEN, reason);
+ } else {
+ log.warn(reason);
+ }
+ }
+
private PluginInfo getPluginInfo(String path, SolrConfig solrConfig, PluginInfo def) {
List<PluginInfo> l = solrConfig.readPluginInfos(path, false, true);
return l.isEmpty() ? def : l.get(0);
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrIndexWriter.java?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrIndexWriter.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/SolrIndexWriter.java Mon Apr 2 22:55:37 2012
@@ -20,10 +20,7 @@ package org.apache.solr.update;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
-import java.io.OutputStream;
import java.io.PrintStream;
-import java.text.DateFormat;
-import java.util.Date;
import java.util.concurrent.atomic.AtomicLong;
import org.apache.lucene.codecs.Codec;
@@ -50,7 +47,6 @@ public class SolrIndexWriter extends Ind
public static final AtomicLong numOpens = new AtomicLong();
public static final AtomicLong numCloses = new AtomicLong();
-
/** Stored into each Lucene commit to record the
* System.currentTimeMillis() when commit was called. */
public static final String COMMIT_TIME_MSEC_KEY = "commitTimeMSec";
Modified: lucene/dev/trunk/solr/core/src/test-files/solr/conf/bad-mp-solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test-files/solr/conf/bad-mp-solrconfig.xml?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test-files/solr/conf/bad-mp-solrconfig.xml (original)
+++ lucene/dev/trunk/solr/core/src/test-files/solr/conf/bad-mp-solrconfig.xml Mon Apr 2 22:55:37 2012
@@ -23,27 +23,10 @@
<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
- <indexDefaults>
-
- <useCompoundFile>false</useCompoundFile>
- <mergeFactor>10</mergeFactor>
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <maxMergeDocs>2147483647</maxMergeDocs>
- <maxFieldLength>10000</maxFieldLength>
- <writeLockTimeout>1000</writeLockTimeout>
+ <indexConfig>
<mergePolicy class="org.apache.solr.update.DummyMergePolicy"/>
-
- </indexDefaults>
-
- <mainIndex>
- <useCompoundFile>false</useCompoundFile>
<mergeFactor>8</mergeFactor>
- <maxBufferedDocs>10</maxBufferedDocs>
- <maxMergeDocs>2147483647</maxMergeDocs>
- <maxFieldLength>10000</maxFieldLength>
- <mergePolicy class="org.apache.solr.update.DummyMergePolicy"/>
- <unlockOnStartup>true</unlockOnStartup>
- </mainIndex>
+ </indexConfig>
<updateHandler class="solr.DirectUpdateHandler2"/>
<requestHandler name="standard" class="solr.StandardRequestHandler"></requestHandler>
Modified: lucene/dev/trunk/solr/core/src/test-files/solr/conf/bad_solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test-files/solr/conf/bad_solrconfig.xml?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test-files/solr/conf/bad_solrconfig.xml (original)
+++ lucene/dev/trunk/solr/core/src/test-files/solr/conf/bad_solrconfig.xml Mon Apr 2 22:55:37 2012
@@ -25,7 +25,7 @@
<config>
<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
- <indexDefaults>
+ <indexConfig>
<useCompoundFile>${unset.sys.property}</useCompoundFile>
- </indexDefaults>
+ </indexConfig>
</config>
Modified: lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-delpolicy1.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-delpolicy1.xml?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-delpolicy1.xml (original)
+++ lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-delpolicy1.xml Mon Apr 2 22:55:37 2012
@@ -29,12 +29,12 @@
<updateHandler class="solr.DirectUpdateHandler2"/>
<requestHandler name="standard" class="solr.StandardRequestHandler"/>
- <mainIndex>
+ <indexConfig>
<deletionPolicy class="solr.SolrDeletionPolicy">
<str name="keepOptimizedOnly">true</str>
<str name="maxCommitsToKeep">3</str>
<str name="maxCommitAge">100MILLISECONDS</str>
</deletionPolicy>
- </mainIndex>
+ </indexConfig>
</config>
Modified: lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-delpolicy2.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-delpolicy2.xml?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-delpolicy2.xml (original)
+++ lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-delpolicy2.xml Mon Apr 2 22:55:37 2012
@@ -20,12 +20,12 @@
<config>
<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
- <mainIndex>
+ <indexConfig>
<deletionPolicy class="org.apache.solr.core.FakeDeletionPolicy">
<str name="var1">value1</str>
<str name="var2">value2</str>
</deletionPolicy>
- </mainIndex>
+ </indexConfig>
<requestHandler name="standard" class="solr.StandardRequestHandler"></requestHandler>
</config>
Modified: lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-elevate.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-elevate.xml?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-elevate.xml (original)
+++ lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-elevate.xml Mon Apr 2 22:55:37 2012
@@ -36,66 +36,10 @@
solr.RAMDirectoryFactory is memory based and not persistent. -->
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
-
- <indexDefaults>
- <!-- Values here affect all index writers and act as a default
- unless overridden. -->
- <!-- Values here affect all index writers and act as a default unless overridden. -->
- <useCompoundFile>false</useCompoundFile>
- <mergeFactor>10</mergeFactor>
- <!-- If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene will flush based on whichever limit is hit first.
- -->
- <!--<maxBufferedDocs>1000</maxBufferedDocs>-->
- <!-- Tell Lucene when to flush documents to disk.
- Giving Lucene more memory for indexing means faster indexing at the cost of more RAM
-
- If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene will flush based on whichever limit is hit first.
-
- -->
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <maxMergeDocs>2147483647</maxMergeDocs>
- <maxFieldLength>10000</maxFieldLength>
- <writeLockTimeout>1000</writeLockTimeout>
-
- <!--
- Expert:
- The Merge Policy in Lucene controls how merging is handled by Lucene. The default in 2.3 is the LogByteSizeMergePolicy, previous
- versions used LogDocMergePolicy.
-
- LogByteSizeMergePolicy chooses segments to merge based on their size. The Lucene 2.2 default, LogDocMergePolicy chose when
- to merge based on number of documents
-
- Other implementations of MergePolicy must have a no-argument constructor
- -->
- <mergePolicy class="org.apache.lucene.index.LogByteSizeMergePolicy"/>
-
- <!--
- Expert:
- The Merge Scheduler in Lucene controls how merges are performed. The ConcurrentMergeScheduler (Lucene 2.3 default)
- can perform merges in the background using separate threads. The SerialMergeScheduler (Lucene 2.2 default) does not.
- -->
- <mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
- <!-- these are global... can't currently override per index -->
- <writeLockTimeout>1000</writeLockTimeout>
-
+ <indexConfig>
<lockType>single</lockType>
- </indexDefaults>
-
- <mainIndex>
- <!-- lucene options specific to the main on-disk lucene index -->
- <useCompoundFile>false</useCompoundFile>
- <mergeFactor>10</mergeFactor>
- <!-- for better multi-segment testing, we are using slower
- indexing properties of maxBufferedDocs=10 and LogDocMergePolicy.
- -->
- <maxBufferedDocs>10</maxBufferedDocs>
- <maxMergeDocs>2147483647</maxMergeDocs>
- <maxFieldLength>10000</maxFieldLength>
- <mergePolicy class="org.apache.lucene.index.LogDocMergePolicy"/>
-
- <unlockOnStartup>true</unlockOnStartup>
- </mainIndex>
-
+ </indexConfig>
+
<updateHandler class="solr.DirectUpdateHandler2">
<!-- autocommit pending docs if certain criteria are met
Modified: lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-enableplugin.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-enableplugin.xml?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-enableplugin.xml (original)
+++ lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-enableplugin.xml Mon Apr 2 22:55:37 2012
@@ -31,27 +31,9 @@
solr.RAMDirectoryFactory is memory based and not persistent. -->
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
-
- <indexDefaults>
- <useCompoundFile>false</useCompoundFile>
- <mergeFactor>10</mergeFactor>
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <maxMergeDocs>2147483647</maxMergeDocs>
- <maxFieldLength>10000</maxFieldLength>
- <writeLockTimeout>1000</writeLockTimeout>
-
+ <indexConfig>
<lockType>single</lockType>
- </indexDefaults>
-
- <mainIndex>
- <useCompoundFile>false</useCompoundFile>
- <mergeFactor>10</mergeFactor>
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <maxMergeDocs>2147483647</maxMergeDocs>
- <maxFieldLength>10000</maxFieldLength>
-
- <unlockOnStartup>true</unlockOnStartup>
- </mainIndex>
+ </indexConfig>
<updateHandler class="solr.DirectUpdateHandler2">
</updateHandler>
Modified: lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-master.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-master.xml?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-master.xml (original)
+++ lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-master.xml Mon Apr 2 22:55:37 2012
@@ -27,28 +27,9 @@
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
<dataDir>${solr.data.dir:}</dataDir>
- <indexDefaults>
- <useCompoundFile>false</useCompoundFile>
- <mergeFactor>10</mergeFactor>
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <maxMergeDocs>2147483647</maxMergeDocs>
- <maxFieldLength>10000</maxFieldLength>
- <writeLockTimeout>1000</writeLockTimeout>
-
- <mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
-
+ <indexConfig>
<lockType>single</lockType>
- </indexDefaults>
-
- <mainIndex>
- <useCompoundFile>false</useCompoundFile>
- <mergeFactor>10</mergeFactor>
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <maxMergeDocs>2147483647</maxMergeDocs>
- <maxFieldLength>10000</maxFieldLength>
-
- <unlockOnStartup>true</unlockOnStartup>
- </mainIndex>
+ </indexConfig>
<updateHandler class="solr.DirectUpdateHandler2">
</updateHandler>
Modified: lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-master1-keepOneBackup.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-master1-keepOneBackup.xml?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-master1-keepOneBackup.xml (original)
+++ lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-master1-keepOneBackup.xml Mon Apr 2 22:55:37 2012
@@ -20,18 +20,10 @@
<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
<dataDir>${solr.data.dir:}</dataDir>
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
- <indexDefaults />
- <mainIndex>
- <useCompoundFile>false</useCompoundFile>
- <mergeFactor>10</mergeFactor>
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <maxMergeDocs>2147483647</maxMergeDocs>
- <maxFieldLength>10000</maxFieldLength>
- <mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
- <writeLockTimeout>1000</writeLockTimeout>
- <unlockOnStartup>true</unlockOnStartup>
+
+ <indexConfig>
<lockType>single</lockType>
- </mainIndex>
+ </indexConfig>
<updateHandler class="solr.DirectUpdateHandler2">
</updateHandler>
Modified: lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-master1.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-master1.xml?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-master1.xml (original)
+++ lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-master1.xml Mon Apr 2 22:55:37 2012
@@ -26,27 +26,10 @@
<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
<dataDir>${solr.data.dir:}</dataDir>
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
- <indexDefaults>
- <useCompoundFile>false</useCompoundFile>
- <mergeFactor>10</mergeFactor>
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <maxMergeDocs>2147483647</maxMergeDocs>
- <maxFieldLength>10000</maxFieldLength>
- <mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
- <writeLockTimeout>1000</writeLockTimeout>
+ <indexConfig>
<lockType>single</lockType>
- </indexDefaults>
-
- <mainIndex>
- <useCompoundFile>false</useCompoundFile>
- <mergeFactor>10</mergeFactor>
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <maxMergeDocs>2147483647</maxMergeDocs>
- <maxFieldLength>10000</maxFieldLength>
-
- <unlockOnStartup>true</unlockOnStartup>
- </mainIndex>
+ </indexConfig>
<updateHandler class="solr.DirectUpdateHandler2">
</updateHandler>
Modified: lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-master2.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-master2.xml?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-master2.xml (original)
+++ lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-master2.xml Mon Apr 2 22:55:37 2012
@@ -26,26 +26,10 @@
<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
<dataDir>${solr.data.dir:}</dataDir>
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
- <indexDefaults>
- <useCompoundFile>false</useCompoundFile>
- <mergeFactor>10</mergeFactor>
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <maxMergeDocs>2147483647</maxMergeDocs>
- <maxFieldLength>10000</maxFieldLength>
- <mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
- <writeLockTimeout>1000</writeLockTimeout>
- <lockType>single</lockType>
- </indexDefaults>
-
- <mainIndex>
- <useCompoundFile>false</useCompoundFile>
- <mergeFactor>10</mergeFactor>
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <maxMergeDocs>2147483647</maxMergeDocs>
- <maxFieldLength>10000</maxFieldLength>
- <unlockOnStartup>true</unlockOnStartup>
- </mainIndex>
+ <indexConfig>
+ <lockType>single</lockType>
+ </indexConfig>
<updateHandler class="solr.DirectUpdateHandler2">
</updateHandler>
Modified: lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-master3.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-master3.xml?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-master3.xml (original)
+++ lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-master3.xml Mon Apr 2 22:55:37 2012
@@ -26,28 +26,10 @@
<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
<dataDir>${solr.data.dir:}</dataDir>
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
- <indexDefaults>
- <useCompoundFile>false</useCompoundFile>
- <mergeFactor>10</mergeFactor>
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <maxMergeDocs>2147483647</maxMergeDocs>
- <maxFieldLength>10000</maxFieldLength>
-
- <mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
- <writeLockTimeout>1000</writeLockTimeout>
+ <indexConfig>
<lockType>single</lockType>
- </indexDefaults>
-
- <mainIndex>
- <useCompoundFile>false</useCompoundFile>
- <mergeFactor>10</mergeFactor>
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <maxMergeDocs>2147483647</maxMergeDocs>
- <maxFieldLength>10000</maxFieldLength>
-
- <unlockOnStartup>true</unlockOnStartup>
- </mainIndex>
+ </indexConfig>
<updateHandler class="solr.DirectUpdateHandler2">
</updateHandler>
Modified: lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-mergepolicy.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-mergepolicy.xml?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-mergepolicy.xml (original)
+++ lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-mergepolicy.xml Mon Apr 2 22:55:37 2012
@@ -25,17 +25,15 @@
<config>
<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
- <indexDefaults>
- <ramBufferSizeMB>32</ramBufferSizeMB>
- <termIndexInterval>256</termIndexInterval>
+
+ <indexConfig>
<mergeFactor>7</mergeFactor>
- <useCompoundFile>false</useCompoundFile>
<mergePolicy class="org.apache.lucene.index.TieredMergePolicy">
<int name="maxMergeAtOnceExplicit">19</int>
<int name="segmentsPerTier">9</int>
<double name="noCFSRatio">1.0</double>
</mergePolicy>
- </indexDefaults>
+ </indexConfig>
<requestHandler name="standard" class="solr.StandardRequestHandler"></requestHandler>
Modified: lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-nativelock.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-nativelock.xml?rev=1308608&r1=1308607&r2=1308608&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-nativelock.xml (original)
+++ lucene/dev/trunk/solr/core/src/test-files/solr/conf/solrconfig-nativelock.xml Mon Apr 2 22:55:37 2012
@@ -27,7 +27,7 @@
<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
- <indexDefaults>
+ <indexConfig>
<lockType>native</lockType>
- </indexDefaults>
+ </indexConfig>
</config>