Apache Solr open-source search software
SOLR-1052: Deprecate/Remove <indexDefaults> and <mainIndex> in favor of <indexConfig> in solrconfig.xml (trunk)
Jan Høydahl058179d17720
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex f282acb4d95..156b415c45c 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -68,10 +68,17 @@ Upgrading from Solr 3.6-devdeprecated but still working since Solr3.2, but is now removedentirely.+* 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, andStreamingUpdateSolrServer is now ConcurrentUpdateSolrServer.+Detailed Change List----------------------@@ -496,6 +503,9 @@ Upgrading from Solr 3.5HTMLStripCharFilter 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 witha '/'. (dsmiley)@@ -808,6 +818,12 @@ Other Changesthis check was only performed during modifying (e.g. adding and deletingdocuments) 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)diff --git a/solr/contrib/clustering/src/test-files/clustering/solr/conf/solrconfig.xml b/solr/contrib/clustering/src/test-files/clustering/solr/conf/solrconfig.xmlindex c6fa8fb6148..58fd85b92e3 100644--- a/solr/contrib/clustering/src/test-files/clustering/solr/conf/solrconfig.xml+++ b/solr/contrib/clustering/src/test-files/clustering/solr/conf/solrconfig.xml@@ -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, usethis if you want to configure JMX through JVM parameters. Removediff --git a/solr/contrib/dataimporthandler-extras/src/test-files/dihextras/solr/conf/dataimport-solrconfig.xml b/solr/contrib/dataimporthandler-extras/src/test-files/dihextras/solr/conf/dataimport-solrconfig.xmlindex a6c527d2b46..45d93da53a6 100644--- a/solr/contrib/dataimporthandler-extras/src/test-files/dihextras/solr/conf/dataimport-solrconfig.xml+++ b/solr/contrib/dataimporthandler-extras/src/test-files/dihextras/solr/conf/dataimport-solrconfig.xml@@ -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">diff --git a/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/contentstream-solrconfig.xml b/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/contentstream-solrconfig.xmlindex 11e77bd8fdf..59564c6badf 100644--- a/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/contentstream-solrconfig.xml+++ b/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/contentstream-solrconfig.xml@@ -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">diff --git a/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-nodatasource-solrconfig.xml b/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-nodatasource-solrconfig.xmlindex c3c5194c44c..1f147c05dbf 100644--- a/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-nodatasource-solrconfig.xml+++ b/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-nodatasource-solrconfig.xml@@ -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">diff --git a/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-solrconfig.xml b/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-solrconfig.xmlindex b8051017453..c6a60c645d6 100644--- a/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-solrconfig.xml+++ b/solr/contrib/dataimporthandler/src/test-files/dih/solr/conf/dataimport-solrconfig.xml@@ -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">diff --git a/solr/contrib/extraction/src/test-files/extraction/solr/conf/solrconfig.xml b/solr/contrib/extraction/src/test-files/extraction/solr/conf/solrconfig.xmlindex af2c87876d6..1bc4d31cdf7 100644--- a/solr/contrib/extraction/src/test-files/extraction/solr/conf/solrconfig.xml+++ b/solr/contrib/extraction/src/test-files/extraction/solr/conf/solrconfig.xml@@ -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">diff --git a/solr/contrib/uima/src/test-files/uima/solr/conf/solrconfig.xml b/solr/contrib/uima/src/test-files/uima/solr/conf/solrconfig.xmlindex c05dc8af8b6..26cc41da59f 100644--- a/solr/contrib/uima/src/test-files/uima/solr/conf/solrconfig.xml+++ b/solr/contrib/uima/src/test-files/uima/solr/conf/solrconfig.xml@@ -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, usediff --git a/solr/contrib/uima/src/test-files/uima/uima-tokenizers-solrconfig.xml b/solr/contrib/uima/src/test-files/uima/uima-tokenizers-solrconfig.xmlindex 470b49fdc9b..e8d0f3a4779 100644--- a/solr/contrib/uima/src/test-files/uima/uima-tokenizers-solrconfig.xml+++ b/solr/contrib/uima/src/test-files/uima/uima-tokenizers-solrconfig.xml@@ -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, usediff --git a/solr/contrib/velocity/src/test-files/velocity/solr/conf/solrconfig.xml b/solr/contrib/velocity/src/test-files/velocity/solr/conf/solrconfig.xmlindex b463e377581..8f9fd96a825 100644--- a/solr/contrib/velocity/src/test-files/velocity/solr/conf/solrconfig.xml+++ b/solr/contrib/velocity/src/test-files/velocity/solr/conf/solrconfig.xml@@ -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>diff --git a/solr/core/src/java/org/apache/solr/core/SolrConfig.java b/solr/core/src/java/org/apache/solr/core/SolrConfig.javaindex 5003a184384..dcb18656e4e 100644--- a/solr/core/src/java/org/apache/solr/core/SolrConfig.java+++ b/solr/core/src/java/org/apache/solr/core/SolrConfig.java@@ -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 configurationspublic final CacheConfig filterCacheConfig ;public final CacheConfig queryResultCacheConfig;@@ -246,9 +277,13 @@ public class SolrConfig extends Config {// DocSetpublic final float hashSetInverseLoadFactor;public final int hashDocSetMaxSize;- // default & main index configurations+ // default & main index configurations, deprecated as of 3.6+ @Deprecatedpublic final SolrIndexConfig defaultIndexConfig;+ @Deprecatedpublic final SolrIndexConfig mainIndexConfig;+ // IndexConfig settings+ public final SolrIndexConfig indexConfig;protected UpdateHandlerInfo updateHandlerInfo ;diff --git a/solr/core/src/java/org/apache/solr/core/SolrCore.java b/solr/core/src/java/org/apache/solr/core/SolrCore.javaindex d7067902c4a..88eaad05cf7 100644--- a/solr/core/src/java/org/apache/solr/core/SolrCore.java+++ b/solr/core/src/java/org/apache/solr/core/SolrCore.java@@ -323,7 +323,7 @@ public final class SolrCore implements SolrInfoMBean {// gets a non-caching searcherpublic 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 SolrInfoMBean {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 SolrInfoMBean {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 SolrInfoMBean {} 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);}diff --git a/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.javaindex 88aaf89edf1..79e19d20681 100644--- a/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java+++ b/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java@@ -243,7 +243,7 @@ public class CoreAdminHandler extends RequestHandlerBase {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);diff --git a/solr/core/src/java/org/apache/solr/handler/component/SpellCheckComponent.java b/solr/core/src/java/org/apache/solr/handler/component/SpellCheckComponent.javaindex 2983fb0128d..fee62d1db96 100644--- a/solr/core/src/java/org/apache/solr/handler/component/SpellCheckComponent.java+++ b/solr/core/src/java/org/apache/solr/handler/component/SpellCheckComponent.java@@ -563,7 +563,7 @@ public class SpellCheckComponent extends SearchComponent implements SolrCoreAwar//ensure that there is at least one query converter definedif (queryConverters.size() == 0) {- LOG.warn("No queryConverter defined, using default converter");+ LOG.info("No queryConverter defined, using default converter");queryConverters.put("queryConverter", new SpellingQueryConverter());}diff --git a/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java b/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.javaindex cf9ed42e57c..1048ba1f4a3 100644--- a/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java+++ b/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java@@ -188,8 +188,11 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable,SolrIncacheMap = 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 IndexSearcher implements Closeable,SolrInreturn 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 filterdiff --git a/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java b/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.javaindex 4b6da03ad35..bcc6d9a9915 100644--- a/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java+++ b/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java@@ -111,7 +111,7 @@ public final class DefaultSolrCoreState extends SolrCoreState {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);}@Overridediff --git a/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java b/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.javaindex aa2062ee78e..18bbf70e41f 100644--- a/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java+++ b/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java@@ -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);diff --git a/solr/core/src/java/org/apache/solr/update/SolrIndexWriter.java b/solr/core/src/java/org/apache/solr/update/SolrIndexWriter.javaindex bd561dcc18b..b9ca142cdf2 100644--- a/solr/core/src/java/org/apache/solr/update/SolrIndexWriter.java+++ b/solr/core/src/java/org/apache/solr/update/SolrIndexWriter.java@@ -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 IndexWriter {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";diff --git a/solr/core/src/test-files/solr/conf/bad-mp-solrconfig.xml b/solr/core/src/test-files/solr/conf/bad-mp-solrconfig.xmlindex af66ff7e4b3..af5d8fbb155 100644--- a/solr/core/src/test-files/solr/conf/bad-mp-solrconfig.xml+++ b/solr/core/src/test-files/solr/conf/bad-mp-solrconfig.xml@@ -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>diff --git a/solr/core/src/test-files/solr/conf/bad_solrconfig.xml b/solr/core/src/test-files/solr/conf/bad_solrconfig.xmlindex f3d4d67519f..8c8e9601559 100644--- a/solr/core/src/test-files/solr/conf/bad_solrconfig.xml+++ b/solr/core/src/test-files/solr/conf/bad_solrconfig.xml@@ -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>diff --git a/solr/core/src/test-files/solr/conf/solrconfig-legacy.xml b/solr/core/src/test-files/solr/conf/solrconfig-basic-luceneVersion31.xmlsimilarity index 55%rename from solr/core/src/test-files/solr/conf/solrconfig-legacy.xmlrename to solr/core/src/test-files/solr/conf/solrconfig-basic-luceneVersion31.xmlindex bf22949d45c..c7de3b6a174 100644--- a/solr/core/src/test-files/solr/conf/solrconfig-legacy.xml+++ b/solr/core/src/test-files/solr/conf/solrconfig-basic-luceneVersion31.xml@@ -17,21 +17,9 @@limitations under the License.-->-+<!-- a basic solrconfig that tests can use when they want simple minimal solrconfig/schema+ DO NOT ADD THINGS TO THIS CONFIG! --><config>- <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>-- <!-- The DirectoryFactory to use for indexes.- solr.StandardDirectoryFactory, the default, is filesystem based.- solr.RAMDirectoryFactory is memory based and not persistent. -->- <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>-- <mainIndex>- <mergePolicy>org.apache.lucene.index.LogDocMergePolicy</mergePolicy>- <mergeScheduler>org.apache.lucene.index.SerialMergeScheduler</mergeScheduler>- </mainIndex>-- <updateHandler class="solr.DirectUpdateHandler2">- </updateHandler>-+ <luceneMatchVersion>LUCENE_31</luceneMatchVersion>+ <requestHandler name="standard" class="solr.StandardRequestHandler"></requestHandler></config>diff --git a/solr/core/src/test-files/solr/conf/solrconfig-delpolicy1.xml b/solr/core/src/test-files/solr/conf/solrconfig-delpolicy1.xmlindex 335e7e4c482..751663c61c1 100644--- a/solr/core/src/test-files/solr/conf/solrconfig-delpolicy1.xml+++ b/solr/core/src/test-files/solr/conf/solrconfig-delpolicy1.xml@@ -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>diff --git a/solr/core/src/test-files/solr/conf/solrconfig-delpolicy2.xml b/solr/core/src/test-files/solr/conf/solrconfig-delpolicy2.xmlindex d72498c8f20..585a1cde2d6 100644--- a/solr/core/src/test-files/solr/conf/solrconfig-delpolicy2.xml+++ b/solr/core/src/test-files/solr/conf/solrconfig-delpolicy2.xml@@ -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>diff --git a/solr/core/src/test-files/solr/conf/solrconfig-elevate.xml b/solr/core/src/test-files/solr/conf/solrconfig-elevate.xmlindex 669cdd2f949..c5e62342622 100644--- a/solr/core/src/test-files/solr/conf/solrconfig-elevate.xml+++ b/solr/core/src/test-files/solr/conf/solrconfig-elevate.xml@@ -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 metdiff --git a/solr/core/src/test-files/solr/conf/solrconfig-enableplugin.xml b/solr/core/src/test-files/solr/conf/solrconfig-enableplugin.xmlindex 0bc9b4ca4fb..5cb851f8b32 100644--- a/solr/core/src/test-files/solr/conf/solrconfig-enableplugin.xml+++ b/solr/core/src/test-files/solr/conf/solrconfig-enableplugin.xml@@ -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>diff --git a/solr/core/src/test-files/solr/conf/solrconfig-master.xml b/solr/core/src/test-files/solr/conf/solrconfig-master.xmlindex b1ce1509f66..38de374a3d0 100644--- a/solr/core/src/test-files/solr/conf/solrconfig-master.xml+++ b/solr/core/src/test-files/solr/conf/solrconfig-master.xml@@ -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>diff --git a/solr/core/src/test-files/solr/conf/solrconfig-master1-keepOneBackup.xml b/solr/core/src/test-files/solr/conf/solrconfig-master1-keepOneBackup.xmlindex d5e53fca538..13a14dac232 100644--- a/solr/core/src/test-files/solr/conf/solrconfig-master1-keepOneBackup.xml+++ b/solr/core/src/test-files/solr/conf/solrconfig-master1-keepOneBackup.xml@@ -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>diff --git a/solr/core/src/test-files/solr/conf/solrconfig-master1.xml b/solr/core/src/test-files/solr/conf/solrconfig-master1.xmlindex 98f9c10980a..ce3092cbe08 100644--- a/solr/core/src/test-files/solr/conf/solrconfig-master1.xml+++ b/solr/core/src/test-files/solr/conf/solrconfig-master1.xml@@ -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>diff --git a/solr/core/src/test-files/solr/conf/solrconfig-master2.xml b/solr/core/src/test-files/solr/conf/solrconfig-master2.xmlindex 8b3fcc180e6..b662ec4a0d7 100644--- a/solr/core/src/test-files/solr/conf/solrconfig-master2.xml+++ b/solr/core/src/test-files/solr/conf/solrconfig-master2.xml@@ -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>diff --git a/solr/core/src/test-files/solr/conf/solrconfig-master3.xml b/solr/core/src/test-files/solr/conf/solrconfig-master3.xmlindex ae8f47a7324..4ed7b807724 100644--- a/solr/core/src/test-files/solr/conf/solrconfig-master3.xml+++ b/solr/core/src/test-files/solr/conf/solrconfig-master3.xml@@ -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>diff --git a/solr/core/src/test-files/solr/conf/solrconfig-mergepolicy.xml b/solr/core/src/test-files/solr/conf/solrconfig-mergepolicy.xmlindex 4827bff945c..8fa12a7abe9 100644--- a/solr/core/src/test-files/solr/conf/solrconfig-mergepolicy.xml+++ b/solr/core/src/test-files/solr/conf/solrconfig-mergepolicy.xml@@ -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>diff --git a/solr/core/src/test-files/solr/conf/solrconfig-nativelock.xml b/solr/core/src/test-files/solr/conf/solrconfig-nativelock.xmlindex 0ad26f999ed..ac0f70dbbe4 100644--- a/solr/core/src/test-files/solr/conf/solrconfig-nativelock.xml+++ b/solr/core/src/test-files/solr/conf/solrconfig-nativelock.xml@@ -27,7 +27,7 @@<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>- <indexDefaults>+ <indexConfig><lockType>native</lockType>- </indexDefaults>+ </indexConfig></config>diff --git a/solr/core/src/test-files/solr/conf/solrconfig-propinject-indexdefault.xml b/solr/core/src/test-files/solr/conf/solrconfig-propinject-indexdefault.xmlindex c0ae0786baa..efa1e6cddd8 100644--- a/solr/core/src/test-files/solr/conf/solrconfig-propinject-indexdefault.xml+++ b/solr/core/src/test-files/solr/conf/solrconfig-propinject-indexdefault.xml@@ -44,7 +44,7 @@solr.RAMDirectoryFactory is memory based and not persistent. --><directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>- <indexDefaults>+ <indexConfig><mergePolicy class="org.apache.lucene.index.LogByteSizeMergePolicy"><double name="maxMergeMB">32.0</double></mergePolicy>@@ -52,7 +52,7 @@<int name="maxMergeCount">4</int><int name="maxThreadCount">4</int></mergeScheduler>- </indexDefaults>+ </indexConfig><updateHandler class="solr.DirectUpdateHandler2"></updateHandler>diff --git a/solr/core/src/test-files/solr/conf/solrconfig-propinject.xml b/solr/core/src/test-files/solr/conf/solrconfig-propinject.xmlindex e03eef6535e..f3e53915b49 100644--- a/solr/core/src/test-files/solr/conf/solrconfig-propinject.xml+++ b/solr/core/src/test-files/solr/conf/solrconfig-propinject.xml@@ -45,7 +45,7 @@<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>- <mainIndex>+ <indexConfig><mergePolicy class="org.apache.lucene.index.LogByteSizeMergePolicy"><double name="maxMergeMB">64.0</double></mergePolicy>@@ -53,7 +53,7 @@<mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"><int name="maxThreadCount">2</int></mergeScheduler>- </mainIndex>+ </indexConfig><updateHandler class="solr.DirectUpdateHandler2"></updateHandler>diff --git a/solr/core/src/test-files/solr/conf/solrconfig-repeater.xml b/solr/core/src/test-files/solr/conf/solrconfig-repeater.xmlindex 6b7c5773f24..94495535314 100644--- a/solr/core/src/test-files/solr/conf/solrconfig-repeater.xml+++ b/solr/core/src/test-files/solr/conf/solrconfig-repeater.xml@@ -27,26 +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>-+ <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>diff --git a/solr/core/src/test-files/solr/conf/solrconfig-simplelock.xml b/solr/core/src/test-files/solr/conf/solrconfig-simplelock.xmlindex f46c7c2ac46..17602671e62 100644--- a/solr/core/src/test-files/solr/conf/solrconfig-simplelock.xml+++ b/solr/core/src/test-files/solr/conf/solrconfig-simplelock.xml@@ -27,7 +27,7 @@<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>- <indexDefaults>+ <indexConfig><lockType>simple</lockType>- </indexDefaults>+ </indexConfig></config>diff --git a/solr/core/src/test-files/solr/conf/solrconfig-slave.xml b/solr/core/src/test-files/solr/conf/solrconfig-slave.xmlindex 1e17c3734ac..aa7073d73db 100644--- a/solr/core/src/test-files/solr/conf/solrconfig-slave.xml+++ b/solr/core/src/test-files/solr/conf/solrconfig-slave.xml@@ -27,26 +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>-+ <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>diff --git a/solr/core/src/test-files/solr/conf/solrconfig-slave1.xml b/solr/core/src/test-files/solr/conf/solrconfig-slave1.xmlindex 38320ae4c5e..85978026d07 100644--- a/solr/core/src/test-files/solr/conf/solrconfig-slave1.xml+++ b/solr/core/src/test-files/solr/conf/solrconfig-slave1.xml@@ -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>- <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>diff --git a/solr/core/src/test-files/solr/conf/solrconfig-solcoreproperties.xml b/solr/core/src/test-files/solr/conf/solrconfig-solcoreproperties.xmlindex 3596d030600..895e414948a 100644--- a/solr/core/src/test-files/solr/conf/solrconfig-solcoreproperties.xml+++ b/solr/core/src/test-files/solr/conf/solrconfig-solcoreproperties.xml@@ -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>diff --git a/solr/core/src/test-files/solr/conf/solrconfig-termindex.xml b/solr/core/src/test-files/solr/conf/solrconfig-termindex.xmlindex 994530ad978..d5fcdade0b6 100644--- a/solr/core/src/test-files/solr/conf/solrconfig-termindex.xml+++ b/solr/core/src/test-files/solr/conf/solrconfig-termindex.xml@@ -35,13 +35,11 @@solr.RAMDirectoryFactory is memory based and not persistent. --><directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>- <indexDefaults>- <ramBufferSizeMB>32</ramBufferSizeMB>+ <indexConfig><termIndexInterval>256</termIndexInterval><mergePolicy class="org.apache.lucene.index.TieredMergePolicy"/><mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>- </indexDefaults>-+ </indexConfig><updateHandler class="solr.DirectUpdateHandler2"></updateHandler>diff --git a/solr/core/src/test-files/solr/conf/solrconfig.xml b/solr/core/src/test-files/solr/conf/solrconfig.xmlindex cff04742573..b24ea70e590 100644--- a/solr/core/src/test-files/solr/conf/solrconfig.xml+++ b/solr/core/src/test-files/solr/conf/solrconfig.xml@@ -17,13 +17,7 @@limitations under the License.-->-<!-- $Id: solrconfig.xml 382610 2006-03-03 01:43:03Z yonik $- $Source$- $Name$---- This is a "kitchen sink" config file that tests can use.+<!-- This is a "kitchen sink" config file that tests can use.When writting a new test, feel free to add *new* items (plugins,config options, etc...) as long as they don't break any existingtests. if you need to test something esoteric please add a new@@ -32,8 +26,6 @@Note in particular that this test is used by MinimalSchemaTest soAnything added to this file needs to work correctly even if thereis now uniqueKey or defaultSearch Field.----><config>@@ -52,65 +44,20 @@<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>- <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.- -->+ <indexConfig><mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>- <!-- 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>8</mergeFactor>+<!-- for better multi-segment testing, we are using slowerindexing properties of maxBufferedDocs=10 and LogDocMergePolicy.--><maxBufferedDocs>10</maxBufferedDocs>- <maxMergeDocs>2147483647</maxMergeDocs>- <maxFieldLength>10000</maxFieldLength><mergePolicy class="org.apache.lucene.index.LogDocMergePolicy"/>-+ <lockType>single</lockType><unlockOnStartup>true</unlockOnStartup>- </mainIndex>-+ </indexConfig>+<updateHandler class="solr.DirectUpdateHandler2"><!-- autocommit pending docs if certain criteria are metdiff --git a/solr/core/src/test-files/solr/conf/solrconfig_perf.xml b/solr/core/src/test-files/solr/conf/solrconfig_perf.xmlindex 1d67461d6b4..b9a8a926c4e 100755--- a/solr/core/src/test-files/solr/conf/solrconfig_perf.xml+++ b/solr/core/src/test-files/solr/conf/solrconfig_perf.xml@@ -28,8 +28,6 @@solr.RAMDirectoryFactory is memory based and not persistent. --><directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>- <luceneMatchVersion>4.0</luceneMatchVersion>-<updateHandler class="solr.DirectUpdateHandler2"/>diff --git a/solr/core/src/test-files/solr/crazy-path-to-config.xml b/solr/core/src/test-files/solr/crazy-path-to-config.xmlindex 7e4276c9600..e4207f1d597 100644--- a/solr/core/src/test-files/solr/crazy-path-to-config.xml+++ b/solr/core/src/test-files/solr/crazy-path-to-config.xml@@ -25,23 +25,10 @@<config><luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>- <indexDefaults>- <useCompoundFile>false</useCompoundFile>- <mergeFactor>10</mergeFactor>- <maxBufferedDocs>1000</maxBufferedDocs>- <maxMergeDocs>2147483647</maxMergeDocs>- <maxFieldLength>10000</maxFieldLength>- <writeLockTimeout>1000</writeLockTimeout>- </indexDefaults>- <mainIndex>- <useCompoundFile>false</useCompoundFile>- <mergeFactor>10</mergeFactor>- <maxBufferedDocs>1000</maxBufferedDocs>- <maxMergeDocs>2147483647</maxMergeDocs>- <maxFieldLength>10000</maxFieldLength>- <unlockOnStartup>true</unlockOnStartup>- </mainIndex>+ <indexConfig>+ <lockType>single</lockType>+ </indexConfig><updateHandler class="solr.DirectUpdateHandler2"><commitIntervalLowerBound>0</commitIntervalLowerBound>diff --git a/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java b/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.javaindex 00e49085bf4..b778000a3a5 100644--- a/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java+++ b/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java@@ -126,7 +126,7 @@ public class BasicFunctionalityTest extends SolrTestCaseJ4 {SolrCore core = h.getCore();IndexWriter writer = ((DirectUpdateHandler2)core.getUpdateHandler()).getSolrCoreState().getIndexWriter(core);- assertEquals("Mergefactor was not picked up", ((LogMergePolicy)writer.getConfig().getMergePolicy()).getMergeFactor(), 8);+ assertEquals("Mergefactor was not picked up", 8, ((LogMergePolicy)writer.getConfig().getMergePolicy()).getMergeFactor());lrf.args.put(CommonParams.VERSION,"2.2");assertQ("test query on empty index",diff --git a/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java b/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.javaindex 458dbadf799..dd2db62f031 100644--- a/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java@@ -60,7 +60,7 @@ public class BasicZkTest extends AbstractZkTestCase {IndexWriter writer = ((DirectUpdateHandler2)core.getUpdateHandler()).getSolrCoreState().getIndexWriter(core);- assertEquals("Mergefactor was not picked up", ((LogMergePolicy)writer.getConfig().getMergePolicy()).getMergeFactor(), 8);+ assertEquals("Mergefactor was not picked up", 8, ((LogMergePolicy)writer.getConfig().getMergePolicy()).getMergeFactor());lrf.args.put(CommonParams.VERSION, "2.2");assertQ("test query on empty index", request("qlkciyopsbgzyvkylsjhchghjrdf"),diff --git a/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java b/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.javaindex 3d846ba4cb7..dd8a8d33d53 100644--- a/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java@@ -25,7 +25,6 @@ import org.apache.solr.client.solrj.embedded.JettySolrRunner;import org.apache.solr.common.SolrInputDocument;import org.junit.AfterClass;import org.junit.BeforeClass;-import org.junit.Ignore;import org.slf4j.Logger;import org.slf4j.LoggerFactory;diff --git a/solr/core/src/test/org/apache/solr/core/TestConfig.java b/solr/core/src/test/org/apache/solr/core/TestConfig.javaindex 89a2c264429..d1556a602d4 100644--- a/solr/core/src/test/org/apache/solr/core/TestConfig.java+++ b/solr/core/src/test/org/apache/solr/core/TestConfig.java@@ -21,7 +21,6 @@ import org.apache.lucene.index.IndexWriter;import org.apache.lucene.index.TieredMergePolicy;import org.apache.solr.SolrTestCaseJ4;import org.apache.solr.handler.admin.ShowFileRequestHandler;-import org.apache.solr.request.SolrQueryRequest;import org.apache.solr.update.DirectUpdateHandler2;import org.apache.solr.update.SolrIndexConfig;import org.junit.BeforeClass;@@ -93,11 +92,11 @@ public class TestConfig extends SolrTestCaseJ4 {@Testpublic void testLucene23Upgrades() throws Exception {- double bufferSize = solrConfig.getDouble("indexDefaults/ramBufferSizeMB");+ double bufferSize = solrConfig.indexConfig.ramBufferSizeMB;assertTrue(bufferSize + " does not equal: " + 32, bufferSize == 32);- String mergePolicy = solrConfig.get("indexDefaults/mergePolicy/@class");+ String mergePolicy = solrConfig.indexConfig.mergePolicyInfo.className;assertEquals(TieredMergePolicy.class.getName(), mergePolicy);- String mergeSched = solrConfig.get("indexDefaults/mergeScheduler/@class");+ String mergeSched = solrConfig.indexConfig.mergeSchedulerInfo.className;assertTrue(mergeSched + " is not equal to " + SolrIndexConfig.DEFAULT_MERGE_SCHEDULER_CLASSNAME, mergeSched.equals(SolrIndexConfig.DEFAULT_MERGE_SCHEDULER_CLASSNAME) == true);}@@ -128,6 +127,24 @@ public class TestConfig extends SolrTestCaseJ4 {assertEquals(12, sirf.termInfosIndexDivisor);}+ // If defaults change, add test methods to cover each version+ @Test+ public void testDefaults() throws Exception {+ SolrConfig sc = new SolrConfig("solrconfig-basic.xml");+ SolrIndexConfig sic = sc.indexConfig;+ assertTrue("default ramBufferSizeMB should be 32", sic.ramBufferSizeMB == 32);+ assertTrue("default useCompoundFile should be false", sic.useCompoundFile == false);+ assertTrue("default LockType should be native", sic.lockType.equals(SolrIndexConfig.LOCK_TYPE_NATIVE));+ }++ @Test+ public void testDefaults31() throws Exception {+ SolrConfig sc = new SolrConfig("solrconfig-basic-luceneVersion31.xml");+ SolrIndexConfig sic = sc.indexConfig;+ assertTrue("default ramBufferSizeMB should be 16", sic.ramBufferSizeMB == 16);+ assertTrue("default useCompoundFile should be true", sic.useCompoundFile == true);+ assertTrue("default LockType should be simple", sic.lockType.equals(SolrIndexConfig.LOCK_TYPE_SIMPLE));+ }}diff --git a/solr/core/src/test/org/apache/solr/core/TestLegacyMergeSchedulerPolicyConfig.java b/solr/core/src/test/org/apache/solr/core/TestLegacyMergeSchedulerPolicyConfig.javadeleted file mode 100644index f6e9c31dc17..00000000000--- a/solr/core/src/test/org/apache/solr/core/TestLegacyMergeSchedulerPolicyConfig.java+++ /dev/null@@ -1,41 +0,0 @@-package org.apache.solr.core;--/**- * Licensed to the Apache Software Foundation (ASF) under one or more- * contributor license agreements. See the NOTICE file distributed with- * this work for additional information regarding copyright ownership.- * The ASF licenses this file to You under the Apache License, Version 2.0- * (the "License"); you may not use this file except in compliance with- * the License. You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import org.apache.lucene.index.IndexWriter;-import org.apache.lucene.index.LogDocMergePolicy;-import org.apache.lucene.index.SerialMergeScheduler;-import org.apache.solr.SolrTestCaseJ4;-import org.apache.solr.update.DirectUpdateHandler2;-import org.junit.BeforeClass;-import org.junit.Test;--public class TestLegacyMergeSchedulerPolicyConfig extends SolrTestCaseJ4 {- @BeforeClass- public static void beforeClass() throws Exception {- initCore("solrconfig-legacy.xml", "schema.xml");- }-- @Test- public void testLegacy() throws Exception {- IndexWriter writer = ((DirectUpdateHandler2)h.getCore().getUpdateHandler()).getSolrCoreState().getIndexWriter(h.getCore());- assertTrue(writer.getConfig().getMergePolicy().getClass().getName().equals(LogDocMergePolicy.class.getName()));- assertTrue(writer.getConfig().getMergeScheduler().getClass().getName().equals(SerialMergeScheduler.class.getName()));- }--}diff --git a/solr/core/src/test/org/apache/solr/core/TestMergePolicyConfig.java b/solr/core/src/test/org/apache/solr/core/TestMergePolicyConfig.javaindex 2f3738e4db8..06b7f8002a3 100644--- a/solr/core/src/test/org/apache/solr/core/TestMergePolicyConfig.java+++ b/solr/core/src/test/org/apache/solr/core/TestMergePolicyConfig.java@@ -31,7 +31,7 @@ public class TestMergePolicyConfig extends SolrTestCaseJ4 {}public void testTieredMergePolicyConfig() throws Exception {- IndexWriterConfig iwc = solrConfig.defaultIndexConfig.toIndexWriterConfig(h.getCore().getSchema());+ IndexWriterConfig iwc = solrConfig.indexConfig.toIndexWriterConfig(h.getCore().getSchema());MergePolicy mp = iwc.getMergePolicy();assertTrue(mp instanceof TieredMergePolicy);TieredMergePolicy tieredMP = (TieredMergePolicy) mp;diff --git a/solr/core/src/test/org/apache/solr/core/TestQuerySenderListener.java b/solr/core/src/test/org/apache/solr/core/TestQuerySenderListener.javaindex 83eb8bf943c..59d7ec7b208 100644--- a/solr/core/src/test/org/apache/solr/core/TestQuerySenderListener.java+++ b/solr/core/src/test/org/apache/solr/core/TestQuerySenderListener.java@@ -75,7 +75,7 @@ public class TestQuerySenderListener extends SolrTestCaseJ4 {assertNotNull("Event is null", evt);assertTrue(evt + " is not equal to " + EventParams.FIRST_SEARCHER, evt.equals(EventParams.FIRST_SEARCHER) == true);- SolrIndexSearcher newSearcher = new SolrIndexSearcher(core, core.getNewIndexDir(), core.getSchema(), core.getSolrConfig().mainIndexConfig, "testQuerySenderListener", false, core.getDirectoryFactory());+ SolrIndexSearcher newSearcher = new SolrIndexSearcher(core, core.getNewIndexDir(), core.getSchema(), core.getSolrConfig().indexConfig, "testQuerySenderListener", false, core.getDirectoryFactory());qsl.newSearcher(newSearcher, currentSearcher);evt = mock.req.getParams().get(EventParams.EVENT);diff --git a/solr/core/src/test/org/apache/solr/core/TestQuerySenderNoQuery.java b/solr/core/src/test/org/apache/solr/core/TestQuerySenderNoQuery.javaindex e87b44c832c..be73d89bd42 100644--- a/solr/core/src/test/org/apache/solr/core/TestQuerySenderNoQuery.java+++ b/solr/core/src/test/org/apache/solr/core/TestQuerySenderNoQuery.java@@ -75,7 +75,7 @@ public class TestQuerySenderNoQuery extends SolrTestCaseJ4 {assertNotNull("Mock is null", mock);assertNull("Req (firstsearcher) is not null", mock.req);- SolrIndexSearcher newSearcher = new SolrIndexSearcher(core, core.getNewIndexDir(), core.getSchema(), core.getSolrConfig().mainIndexConfig, "testQuerySenderNoQuery", false, core.getDirectoryFactory());+ SolrIndexSearcher newSearcher = new SolrIndexSearcher(core, core.getNewIndexDir(), core.getSchema(), core.getSolrConfig().indexConfig, "testQuerySenderNoQuery", false, core.getDirectoryFactory());qsl.newSearcher(newSearcher, currentSearcher); // get newSearcher.assertNull("Req (newsearcher) is not null", mock.req);diff --git a/solr/example/example-DIH/solr/db/conf/solrconfig.xml b/solr/example/example-DIH/solr/db/conf/solrconfig.xmlindex 342adfedbfd..b67d3ce3fec 100644--- a/solr/example/example-DIH/solr/db/conf/solrconfig.xml+++ b/solr/example/example-DIH/solr/db/conf/solrconfig.xml@@ -30,80 +30,7 @@<lib dir="../../../../dist/" regex="apache-solr-dataimporthandler-.*\.jar" />- <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">diff --git a/solr/example/example-DIH/solr/mail/conf/solrconfig.xml b/solr/example/example-DIH/solr/mail/conf/solrconfig.xmlindex bbabec8f7ca..daf1021f611 100644--- a/solr/example/example-DIH/solr/mail/conf/solrconfig.xml+++ b/solr/example/example-DIH/solr/mail/conf/solrconfig.xml@@ -29,107 +29,7 @@<lib dir="../../../../contrib/dataimporthandler/lib/" regex=".*jar$" /><lib dir="../../../../dist/" regex="apache-solr-dataimporthandler-.*\.jar" />- <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.)- -->- <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>-- <!--- 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">- <!-- Keep only optimized commit points -->- <str name="keepOptimizedOnly">false</str>- <!-- The maximum number of commit points to be kept -->- <str name="maxCommitsToKeep">1</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>-- </mainIndex>+ <!-- <indexConfig> section could go here, but we want the defaults --><!-- Enables JMX if and only if an existing MBeanServer is found, usethis if you want to configure JMX through JVM parameters. Removediff --git a/solr/example/example-DIH/solr/rss/conf/solrconfig.xml b/solr/example/example-DIH/solr/rss/conf/solrconfig.xmlindex 5a1a448bd2e..4b0ce9209fd 100644--- a/solr/example/example-DIH/solr/rss/conf/solrconfig.xml+++ b/solr/example/example-DIH/solr/rss/conf/solrconfig.xml@@ -30,80 +30,7 @@<lib dir="../../../../dist/" regex="apache-solr-dataimporthandler-.*\.jar" />- <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">diff --git a/solr/example/example-DIH/solr/solr/conf/solrconfig.xml b/solr/example/example-DIH/solr/solr/conf/solrconfig.xmlindex d7c5f4eac2b..9feeb42b052 100644--- a/solr/example/example-DIH/solr/solr/conf/solrconfig.xml+++ b/solr/example/example-DIH/solr/solr/conf/solrconfig.xml@@ -30,80 +30,7 @@<lib dir="../../../../dist/" regex="apache-solr-dataimporthandler-.*\.jar" />- <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">diff --git a/solr/example/example-DIH/solr/tika/conf/solrconfig.xml b/solr/example/example-DIH/solr/tika/conf/solrconfig.xmlindex 92fe4f37e4d..978ed68db5c 100644--- a/solr/example/example-DIH/solr/tika/conf/solrconfig.xml+++ b/solr/example/example-DIH/solr/tika/conf/solrconfig.xml@@ -29,80 +29,7 @@<lib dir="../../../../contrib/extraction/lib" /><lib dir="../../../../dist/" regex="apache-solr-dataimporthandler-.*\.jar" />- <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">diff --git a/solr/example/solr/conf/solrconfig.xml b/solr/example/solr/conf/solrconfig.xmlindex c06724f8ac0..e80f1becd86 100755--- a/solr/example/solr/conf/solrconfig.xml+++ b/solr/example/solr/conf/solrconfig.xml@@ -113,53 +113,60 @@<directoryFactory name="DirectoryFactory"class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/>-- <!-- Index Defaults-- Values here affect all index writers and act as a default- unless overridden.-- WARNING: See also the <mainIndex> section below for parameters- that overfor Solr's main Lucene index.- -->- <indexDefaults>-- <useCompoundFile>false</useCompoundFile>-- <mergeFactor>10</mergeFactor>- <!-- 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>- <!-- If both ramBufferSizeMB and maxBufferedDocs is set, then- Lucene will flush based on whichever limit is hit first.- -->+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ Index Config - These settings control low-level behavior of indexing+ Most example settings here show the default value, but are commented+ out, to more easily see where customizations have been made.++ Note: This replaces <indexDefaults> and <mainIndex> from older versions+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->+ <indexConfig>+ <!-- maxFieldLength specifies max number of *tokens* indexed per field. Default: 10000 -->+ <!-- <maxFieldLength>10000</maxFieldLength> -->+ <!-- Maximum time to wait for a write lock (ms) for an IndexWriter. Default: 1000 -->+ <!-- <writeLockTimeout>1000</writeLockTimeout> -->++ <!-- Expert: Enabling compound file will use less files for the index,+ using fewer file descriptors on the expense of performance decrease.+ Default in Lucene is "true". Default in Solr is "false" (since 3.6) -->+ <!-- <useCompoundFile>false</useCompoundFile> -->++ <!-- ramBufferSizeMB 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.+ maxBufferedDocs sets a limit on the number of documents buffered+ before flushing.+ If both ramBufferSizeMB and maxBufferedDocs is set, then+ Lucene will flush based on whichever limit is hit first. -->+ <!-- <ramBufferSizeMB>32</ramBufferSizeMB> --><!-- <maxBufferedDocs>1000</maxBufferedDocs> -->- <maxFieldLength>10000</maxFieldLength>- <writeLockTimeout>1000</writeLockTimeout>-<!-- Expert: Merge Policy-- The Merge Policy in Lucene controls how merging is handled by- Lucene. The default in Solr 3.3 is TieredMergePolicy.-- The default in 2.3 was 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+ The Merge Policy in Lucene controls how merging of segments is done.+ The default since Solr/Lucene 3.3 is TieredMergePolicy.+ The default since Lucene 2.3 was the LogByteSizeMergePolicy,+ Even older versions of Lucene used LogDocMergePolicy.--><!--- <mergePolicy class="org.apache.lucene.index.TieredMergePolicy"/>- -->+ <mergePolicy class="org.apache.lucene.index.TieredMergePolicy">+ <int name="maxMergeAtOnce">10</int>+ <int name="segmentsPerTier">10</int>+ </mergePolicy>+ -->++ <!-- Merge Factor+ The merge factor controls how many segments will get merged at a time.+ For TieredMergePolicy, mergeFactor is a convenience parameter which+ will set both MaxMergeAtOnce and SegmentsPerTier at once.+ For LogByteSizeMergePolicy, mergeFactor decides how many new segments+ will be allowed before they are merged into one.+ Default is 10 for both merge policies.+ -->+ <!--+ <mergeFactor>10</mergeFactor>+ --><!-- Expert: Merge Scheduler-The Merge Scheduler in Lucene controls how merges areperformed. The ConcurrentMergeScheduler (Lucene 2.3 default)can perform merges in the background using separate threads.@@ -168,7 +175,7 @@<!--<mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>-->-+<!-- LockFactoryThis option specifies which Lucene LockFactory implementation@@ -182,66 +189,60 @@JVM are attempting to share a single index.simple = SimpleFSLockFactory - uses a plain file for locking- (For backwards compatibility with Solr 1.2, 'simple' is the- default if not specified.)+ Defaults: 'native' is default for Solr3.6 and later, otherwise+ 'simple' is the defaultMore details on the nuances of each LockFactory...http://wiki.apache.org/lucene-java/AvailableLockFactories-->- <lockType>native</lockType>-- <!-- Expert: Controls how often Lucene loads terms into memory- Default is 128 and is likely good for most everyone.- -->- <!-- <termIndexInterval>256</termIndexInterval> -->- </indexDefaults>-- <!-- Main Index-- Values here override the values in the <indexDefaults> section- for the main on disk index.- -->- <mainIndex>-- <useCompoundFile>false</useCompoundFile>- <ramBufferSizeMB>32</ramBufferSizeMB>- <mergeFactor>10</mergeFactor>+ <!-- <lockType>native</lockType> --><!-- Unlock On StartupIf true, unlock any held write or commit locks on startup.This defeats the locking mechanism that allows multipleprocesses to safely access a lucene index, and should be used- with care.+ with care. Default is "false".This is not needed if lock type is 'none' or 'single'-->+ <!--<unlockOnStartup>false</unlockOnStartup>+ -->+ <!-- Expert: Controls how often Lucene loads terms into memory+ Default is 128 and is likely good for most everyone.+ -->+ <!-- <termIndexInterval>128</termIndexInterval> -->+<!-- If true, IndexReaders will be reopened (often more efficient)- instead of closed and then opened.+ instead of closed and then opened. Default: true-->+ <!--<reopenReaders>true</reopenReaders>+ --><!-- Commit Deletion Policy- Custom deletion policies can specified here. The class must+ Custom deletion policies can be specified here. The class mustimplement org.apache.lucene.index.IndexDeletionPolicy.- http://lucene.apache.org/java/2_9_1/api/all/org/apache/lucene/index/IndexDeletionPolicy.html+ http://lucene.apache.org/java/3_5_0/api/core/org/apache/lucene/index/IndexDeletionPolicy.html- The standard Solr IndexDeletionPolicy implementation supports+ The default Solr IndexDeletionPolicy implementation supportsdeleting index commit points on number of commits, age ofcommit point and optimized status.The latest commit point should always be preserved regardlessof the criteria.-->+ <!--<deletionPolicy class="solr.SolrDeletionPolicy">+ --><!-- The number of commit points to be kept -->- <str name="maxCommitsToKeep">1</str>+ <!-- <str name="maxCommitsToKeep">1</str> --><!-- The number of optimized commit points to be kept -->- <str name="maxOptimizedCommitsToKeep">0</str>+ <!-- <str name="maxOptimizedCommitsToKeep">0</str> --><!--Delete all commit points once they have reached the given age.Supports DateMathParser syntax e.g.@@ -250,7 +251,9 @@<str name="maxCommitAge">30MINUTES</str><str name="maxCommitAge">1DAY</str>-->+ <!--</deletionPolicy>+ --><!-- Lucene Infostream@@ -260,9 +263,9 @@Setting The value to true will instruct the underlying LuceneIndexWriter to write its debugging info the specified file-->- <infoStream file="INFOSTREAM.txt">false</infoStream>+ <!-- <infoStream file="INFOSTREAM.txt">false</infoStream> -->+ </indexConfig>- </mainIndex><!-- JMX@@ -398,7 +401,9 @@</indexReaderFactory >-->-+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ Query section - these settings control query time things like caches+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --><query><!-- Max Boolean Clausesdiff --git a/solr/solrj/src/test-files/solrj/solr/conf/solrconfig-slave1.xml b/solr/solrj/src/test-files/solrj/solr/conf/solrconfig-slave1.xmlindex 36f098d953c..274fb3278bc 100644--- a/solr/solrj/src/test-files/solrj/solr/conf/solrconfig-slave1.xml+++ b/solr/solrj/src/test-files/solrj/solr/conf/solrconfig-slave1.xml@@ -26,25 +26,8 @@<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>- <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> section could go here, but we want the defaults --><updateHandler class="solr.DirectUpdateHandler2"></updateHandler>diff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.javaindex e231202f253..7f75d4f3ab9 100755--- a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java+++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java@@ -15,10 +15,8 @@* limitations under the License.*/-package org.apache.solr;-import java.io.File;import java.io.IOException;import java.io.StringWriter;@@ -36,7 +34,6 @@ import java.util.logging.Level;import javax.xml.xpath.XPathExpressionException;import org.apache.lucene.util.LuceneTestCase;-import org.apache.lucene.util.SystemPropertiesInvariantRule;import org.apache.lucene.util.SystemPropertiesRestoreRule;import org.apache.noggit.CharArr;import org.apache.noggit.JSONUtil;diff --git a/solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java b/solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.javaindex 35e41c272fa..74d756ed9ca 100644--- a/solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java+++ b/solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java@@ -19,8 +19,6 @@ package org.apache.solr.util;import java.io.File;-import org.apache.solr.SolrTestCaseJ4;-/*** Some tests need to reach outside the classpath to get certain resources (e.g. the example configuration).* This class provides some paths to allow them to do this.diff --git a/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java b/solr/test-framework/src/java/org/apache/solr/util/TestHarness.javaindex 330b740c868..2820a9ded81 100644--- a/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java+++ b/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java@@ -26,7 +26,6 @@ import org.apache.solr.core.SolrCore;import org.apache.solr.core.CoreContainer;import org.apache.solr.core.CoreDescriptor;import org.apache.solr.core.SolrResourceLoader;-import org.apache.solr.handler.JsonUpdateRequestHandler;import org.apache.solr.handler.XmlUpdateRequestHandler;import org.apache.solr.request.LocalSolrQueryRequest;import org.apache.solr.request.SolrQueryRequest;@@ -49,7 +48,6 @@ import javax.xml.xpath.XPathFactory;import java.io.ByteArrayInputStream;import java.io.IOException;-import java.io.StringReader;import java.io.StringWriter;import java.io.UnsupportedEncodingException;import java.util.HashMap;