You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2012/01/18 23:28:20 UTC

svn commit: r1233096 [12/13] - in /lucene/dev/branches/solrcloud: ./ dev-tools/eclipse/ dev-tools/idea/.idea/ dev-tools/idea/lucene/contrib/ dev-tools/idea/modules/analysis/kuromoji/ dev-tools/idea/solr/contrib/analysis-extras/ dev-tools/maven/modules/...

Modified: lucene/dev/branches/solrcloud/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/ReverseOrdFieldSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/ReverseOrdFieldSource.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/ReverseOrdFieldSource.java (original)
+++ lucene/dev/branches/solrcloud/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/ReverseOrdFieldSource.java Wed Jan 18 22:28:07 2012
@@ -19,6 +19,7 @@ package org.apache.lucene.queries.functi
 
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexReader.AtomicReaderContext;
+import org.apache.lucene.index.SlowMultiReaderWrapper;
 import org.apache.lucene.queries.function.FunctionValues;
 import org.apache.lucene.queries.function.ValueSource;
 import org.apache.lucene.queries.function.docvalues.IntDocValues;
@@ -61,12 +62,13 @@ public class ReverseOrdFieldSource exten
     return "rord("+field+')';
   }
 
+  // TODO: this is trappy? perhaps this query instead should make you pass a slow reader yourself?
   @Override
   public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
     final IndexReader topReader = ReaderUtil.getTopLevelContext(readerContext).reader;
     final int off = readerContext.docBase;
 
-    final FieldCache.DocTermsIndex sindex = FieldCache.DEFAULT.getTermsIndex(topReader, field);
+    final FieldCache.DocTermsIndex sindex = FieldCache.DEFAULT.getTermsIndex(new SlowMultiReaderWrapper(topReader), field);
     final int end = sindex.numOrd();
 
     return new IntDocValues(this) {

Modified: lucene/dev/branches/solrcloud/modules/queries/src/java/org/apache/lucene/queries/mlt/MoreLikeThis.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/modules/queries/src/java/org/apache/lucene/queries/mlt/MoreLikeThis.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/modules/queries/src/java/org/apache/lucene/queries/mlt/MoreLikeThis.java (original)
+++ lucene/dev/branches/solrcloud/modules/queries/src/java/org/apache/lucene/queries/mlt/MoreLikeThis.java Wed Jan 18 22:28:07 2012
@@ -34,6 +34,7 @@ import org.apache.lucene.search.similari
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.CharsRef;
 import org.apache.lucene.util.PriorityQueue;
+import org.apache.lucene.util.ReaderUtil;
 import org.apache.lucene.util.UnicodeUtil;
 
 
@@ -569,7 +570,7 @@ public final class MoreLikeThis {
   public Query like(int docNum) throws IOException {
     if (fieldNames == null) {
       // gather list of valid fields from lucene
-      Collection<String> fields = ir.getFieldNames(IndexReader.FieldOption.INDEXED);
+      Collection<String> fields = ReaderUtil.getIndexedFields(ir);
       fieldNames = fields.toArray(new String[fields.size()]);
     }
 

Modified: lucene/dev/branches/solrcloud/modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestNumericQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestNumericQueryParser.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestNumericQueryParser.java (original)
+++ lucene/dev/branches/solrcloud/modules/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestNumericQueryParser.java Wed Jan 18 22:28:07 2012
@@ -33,6 +33,7 @@ import java.util.TimeZone;
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.Document;
+import org.apache.lucene.document.FieldType;
 import org.apache.lucene.document.NumericField;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.RandomIndexWriter;
@@ -192,17 +193,37 @@ public class TestNumericQueryParser exte
     for (NumericField.DataType type : NumericField.DataType.values()) {
       numericConfigMap.put(type.name(), new NumericConfig(PRECISION_STEP,
           NUMBER_FORMAT, type));
-      
-      NumericField field = new NumericField(type.name(), PRECISION_STEP, NumericField.TYPE_STORED);
-      
+
+      FieldType ft = new FieldType(NumericField.getFieldType(type, true));
+      ft.setNumericPrecisionStep(PRECISION_STEP);
+      final NumericField field;
+
+      switch(type) {
+      case INT:
+        field = new NumericField(type.name(), 0, ft);
+        break;
+      case FLOAT:
+        field = new NumericField(type.name(), 0.0f, ft);
+        break;
+      case LONG:
+        field = new NumericField(type.name(), 0l, ft);
+        break;
+      case DOUBLE:
+        field = new NumericField(type.name(), 0.0, ft);
+        break;
+      default:
+        assert false;
+        field = null;
+      }
       numericFieldMap.put(type.name(), field);
       doc.add(field);
-      
     }
     
     numericConfigMap.put(DATE_FIELD_NAME, new NumericConfig(PRECISION_STEP,
         DATE_FORMAT, NumericField.DataType.LONG));
-    NumericField dateField = new NumericField(DATE_FIELD_NAME, PRECISION_STEP, NumericField.TYPE_STORED);
+    FieldType ft = new FieldType(NumericField.getFieldType(NumericField.DataType.LONG, true));
+    ft.setNumericPrecisionStep(PRECISION_STEP);
+    NumericField dateField = new NumericField(DATE_FIELD_NAME, 0l, ft);
     numericFieldMap.put(DATE_FIELD_NAME, dateField);
     doc.add(dateField);
     
@@ -264,24 +285,23 @@ public class TestNumericQueryParser exte
     
     Number number = getNumberType(numberType, NumericField.DataType.DOUBLE
         .name());
-    numericFieldMap.get(NumericField.DataType.DOUBLE.name()).setDoubleValue(
+    numericFieldMap.get(NumericField.DataType.DOUBLE.name()).setValue(
         number.doubleValue());
     
     number = getNumberType(numberType, NumericField.DataType.INT.name());
-    numericFieldMap.get(NumericField.DataType.INT.name()).setIntValue(
+    numericFieldMap.get(NumericField.DataType.INT.name()).setValue(
         number.intValue());
     
     number = getNumberType(numberType, NumericField.DataType.LONG.name());
-    numericFieldMap.get(NumericField.DataType.LONG.name()).setLongValue(
+    numericFieldMap.get(NumericField.DataType.LONG.name()).setValue(
         number.longValue());
     
     number = getNumberType(numberType, NumericField.DataType.FLOAT.name());
-    numericFieldMap.get(NumericField.DataType.FLOAT.name()).setFloatValue(
+    numericFieldMap.get(NumericField.DataType.FLOAT.name()).setValue(
         number.floatValue());
     
     number = getNumberType(numberType, DATE_FIELD_NAME);
-    numericFieldMap.get(DATE_FIELD_NAME).setLongValue(number.longValue());
-    
+    numericFieldMap.get(DATE_FIELD_NAME).setValue(number.longValue());
   }
   
   private static int randomDateStyle(Random random) {

Modified: lucene/dev/branches/solrcloud/modules/queryparser/src/test/org/apache/lucene/queryparser/xml/TestParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/modules/queryparser/src/test/org/apache/lucene/queryparser/xml/TestParser.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/modules/queryparser/src/test/org/apache/lucene/queryparser/xml/TestParser.java (original)
+++ lucene/dev/branches/solrcloud/modules/queryparser/src/test/org/apache/lucene/queryparser/xml/TestParser.java Wed Jan 18 22:28:07 2012
@@ -68,9 +68,7 @@ public class TestParser extends LuceneTe
       Document doc = new Document();
       doc.add(newField("date", date, TextField.TYPE_STORED));
       doc.add(newField("contents", content, TextField.TYPE_STORED));
-      NumericField numericField = new NumericField("date2");
-      numericField.setIntValue(Integer.valueOf(date));
-      doc.add(numericField);
+      doc.add(new NumericField("date2", Integer.valueOf(date)));
       writer.addDocument(doc);
       line = d.readLine();
     }

Modified: lucene/dev/branches/solrcloud/modules/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/modules/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionBuilder.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/modules/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionBuilder.java (original)
+++ lucene/dev/branches/solrcloud/modules/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionBuilder.java Wed Jan 18 22:28:07 2012
@@ -5,6 +5,7 @@ import java.io.IOException;
 import java.util.Iterator;
 
 import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.IntsRef;
 import org.apache.lucene.util.fst.*;
 
 /**
@@ -219,11 +220,12 @@ public class FSTCompletionBuilder {
         shareMaxTailLength, outputs, null);
     
     BytesRef scratch = new BytesRef();
+    final IntsRef scratchIntsRef = new IntsRef();
     int count = 0;
     for (Iterator<BytesRef> i = sorter.iterator(); i.hasNext(); count++) {
       BytesRef entry = i.next();
       if (scratch.compareTo(entry) != 0) {
-        builder.add(entry, empty);
+        builder.add(Util.toIntsRef(entry, scratchIntsRef), empty);
         scratch.copyBytes(entry);
       }
     }

Modified: lucene/dev/branches/solrcloud/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/CHANGES.txt?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/CHANGES.txt (original)
+++ lucene/dev/branches/solrcloud/solr/CHANGES.txt Wed Jan 18 22:28:07 2012
@@ -31,7 +31,7 @@ Apache UIMA 2.3.1
 Apache ZooKeeper 3.3.4
 
 
-Upgrading from Solr 3.5-dev
+Upgrading from Solr 3.6-dev
 ----------------------
 
 * The Lucene index format has changed and as a result, once you upgrade, 
@@ -54,14 +54,15 @@ Upgrading from Solr 3.5-dev
   legacy behavior should set a default value for the 'mm' param in
   their solrconfig.xml file.
   
-* FacetComponent no longer catches and embeds exceptions occurred during facet
-  processing, it throws HTTP 400 or 500 exceptions instead.
-  
 * The VelocityResponseWriter is no longer built into the core.  Its JAR and
   dependencies now need to be added (via <lib> or solr/home lib inclusion),
   and it needs to be registered in solrconfig.xml like this:
     <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter"/>
 
+* The update request parameter to choose Update Request Processor Chain is 
+  renamed from "update.processor" to "update.chain". The old parameter was
+  deprecated but still working since Solr3.2, but is now removed entirely.
+
 Detailed Change List
 ----------------------
 
@@ -99,11 +100,6 @@ New Features
   SOLR-2799: Update CloudState incrementally rather than always reading the data at each zk 
   node. (Jamie Johnson via Mark Miller)
 
-* SOLR-1729: Evaluation of NOW for date math is done only once per request for
-  consistency, and is also propagated to shards in distributed search.
-  Adding a parameter NOW=<time_in_ms> to the request will override the
-  current time.  (Peter Sturge, yonik)
-
 * SOLR-1566: Transforming documents in the ResponseWriters.  This will allow
   for more complex results in responses and open the door for function queries
   as results. 
@@ -122,9 +118,6 @@ New Features
 * SOLR-2335: New 'field("...")' function syntax for refering to complex 
   field names (containing whitespace or special characters) in functions.
 
-* SOLR-1709: Distributed support for Date and Numeric Range Faceting
-  (Peter Sturge, David Smiley, hossman)
-
 * SOLR-2383: /browse improvements: generalize range and date facet display
   (Jan Høydahl via yonik)
 
@@ -200,15 +193,11 @@ New Features
 * SOLR-2992: Add support for IndexWriter.prepareCommit() via prepareCommit=true
   on update URLs. (yonik)
 
+* SOLR-2906: Added LFU cache options to Solr. (Shawn Heisey via Erick Erickson)
 
 Optimizations
 ----------------------
 
-* SOLR-2888: FSTSuggester refactoring: internal storage is now UTF-8, 
-  external sorting (on disk) prevents OOMs even with large data sets
-  (the bottleneck is now FST construction), code cleanups and API cleanups.
-  (Dawid Weiss, Robert Muir)
-
 * SOLR-1875: Per-segment field faceting for single valued string fields.
   Enable with facet.method=fcs, control the number of threads used with
   the "threads" local param on the facet.field param.  This algorithm will
@@ -296,6 +285,10 @@ Bug Fixes
   
 * SOLR-1520: QueryElevationComponent now supports non-string ids (gsingers)
 
+* SOLR-3037: When using binary format in solrj the codec screws up parameters
+  (Sami Siren via yonik)
+
+
 Other Changes
 ----------------------
 
@@ -388,6 +381,15 @@ Other Changes
   
 * SOLR-2607: Removed deprecated client/ruby directory, which included solr-ruby and flare.
   (ehatcher)
+  
+* Solr-3032: logOnce from SolrException logOnce and all the supporting
+  structure is gone. abortOnConfugrationError is also gone as it is no longer referenced.
+  Errors should be caught and logged at the top-most level or logged and NOT propagated up the 
+  chain. (Erick Erickson)
+
+* SOLR-2105: Remove support for deprecated "update.processor" (since 3.2), in favor of 
+  "update.chain" (janhoy)
+
 
 Documentation
 ----------------------
@@ -397,6 +399,11 @@ Documentation
   
 ==================  3.6.0  ==================
 
+Upgrading from Solr 3.5
+----------------------
+* As doGet() methods in SimplePostTool was changed to static, the client applications of this
+  class need to be recompiled.
+
 New Features
 ----------------------
 * SOLR-2904: BinaryUpdateRequestHandler should be able to accept multiple update requests from
@@ -421,13 +428,36 @@ New Features
   Solr will use it as the root name for all MBeans Solr exposes via
   JMX.  The default root name is "solr" followed by the core name.
   (Constantijn Visinescu, hossman)
+  
+* SOLR-2906: Added LFU cache options to Solr. (Shawn Heisey via Erick Erickson)
+
+* SOLR-3036: Ability to specify overwrite=false on the URL for XML updates.
+  (Sami Siren via yonik)
+
+* SOLR-2603: Add the encoding function for alternate fields in highlighting.
+  (Massimo Schiavon, koji)
+  
+* SOLR-1729: Evaluation of NOW for date math is done only once per request for
+  consistency, and is also propagated to shards in distributed search.
+  Adding a parameter NOW=<time_in_ms> to the request will override the
+  current time.  (Peter Sturge, yonik, Simon Willnauer)
+  
+* SOLR-1709: Distributed support for Date and Numeric Range Faceting
+  (Peter Sturge, David Smiley, hossman, Simon Willnauer)
 
 Optimizations
 ----------------------
-* SOLR-1931 Speedup for LukeRequestHandler and admin/schema browser. New parameter
+* SOLR-1931: Speedup for LukeRequestHandler and admin/schema browser. New parameter
   reportDocCount defaults to 'false'. Old behavior still possible by specifying this as 'true'
   (Erick Erickson)
 
+* SOLR-3012: Move System.getProperty("type") in postData() to main() and add type argument so that
+  the client applications of SimplePostTool can set content type via method argument. (koji)
+
+* SOLR-2888: FSTSuggester refactoring: internal storage is now UTF-8, 
+  external sorting (on disk) prevents OOMs even with large data sets
+  (the bottleneck is now FST construction), code cleanups and API cleanups.
+  (Dawid Weiss, Robert Muir)
 
 Bug Fixes
 ----------------------
@@ -444,7 +474,18 @@ Bug Fixes
 
 * SOLR-2956: Fixed inconsistencies in the flags (and flag key) reported by 
   the LukeRequestHandler (hossman)
+
+* SOLR-3024: Fixed JSONTestUtil.matchObj, in previous releases it was not 
+  respecting the 'delta' arg (David Smiley via hossman)
+  
+* SOLR-2542: Fixed DIH Context variables which were broken for all scopes other 
+  then SCOPE_ENTITY (Linbin Chen & Frank Wesemann via hossman)
   
+* SOLR-3042: Fixed Maven Jetty plugin configuration. 
+  (David Smiley via Steve Rowe)
+
+* SOLR-2970: CSV ResponseWriter returns fields defined as stored=false in schema (janhoy)
+
 Other Changes
 ----------------------
 * SOLR-2922: Upgrade commons-io and commons-lang to 2.1 and 2.6, respectively. (koji)
@@ -453,6 +494,14 @@ Other Changes
   AppendedSolrParams into factory methods.
   (David Smiley via hossman)
 
+* Solr-3032: Deprecate logOnce from SolrException logOnce and all the supporting
+  structure will disappear in 4.0. Errors should be caught and logged at the
+  top-most level or logged and NOT propagated up the chain. (Erick Erickson)
+
+Build
+----------------------
+* SOLR-2487: Add build target to package war without slf4j jars (janhoy)
+
 ==================  3.5.0  ==================
 
 New Features
@@ -588,6 +637,9 @@ Upgrading from Solr 3.3
   "true" for consistent behavior with previous Solr versions.  This
   situation has now been fixed to cause an error on startup when these
   contradictory options.  See SOLR-2669.
+  
+* FacetComponent no longer catches and embeds exceptions occurred during facet
+  processing, it throws HTTP 400 or 500 exceptions instead.
 
 New Features
 ----------------------

Modified: lucene/dev/branches/solrcloud/solr/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/build.xml?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/build.xml (original)
+++ lucene/dev/branches/solrcloud/solr/build.xml Wed Jan 18 22:28:07 2012
@@ -291,7 +291,16 @@
     </ant>
   </target>
   
-  <target name="prepare-release"
+  <target name="dist-war-excl-slf4j"
+          description="Creates a Solr WAR Distribution file, excluding slf4j bindings.">
+    <ant dir="webapp" target="dist" inheritall="false">
+      <propertyset refid="uptodate.and.compiled.properties"/>
+      <property name="exclude.from.war" value="*over-slf4j*,slf4j-jdk14*" />
+      <property name="solr.war.suffix" value="-excl-slf4j" />
+    </ant>
+  </target>
+
+	<target name="prepare-release"
           depends="clean, package, generate-maven-artifacts, sign-artifacts"/>
  
   <!-- make a distribution -->

Modified: lucene/dev/branches/solrcloud/solr/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/common-build.xml?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/common-build.xml (original)
+++ lucene/dev/branches/solrcloud/solr/common-build.xml Wed Jan 18 22:28:07 2012
@@ -35,6 +35,7 @@
   <!-- solr uses 1.6 -->
   <property name="javac.source" value="1.6"/>
   <property name="javac.target" value="1.6"/>
+  <property name="javac.args" value=""/>
   
   <property name="dest" value="${common-solr.dir}/build" />
   <property name="build.dir" location="${dest}/${ant.project.name}"/>

Modified: lucene/dev/branches/solrcloud/solr/contrib/analysis-extras/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/contrib/analysis-extras/CHANGES.txt?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/contrib/analysis-extras/CHANGES.txt (original)
+++ lucene/dev/branches/solrcloud/solr/contrib/analysis-extras/CHANGES.txt Wed Jan 18 22:28:07 2012
@@ -19,6 +19,9 @@ $Id$
 
 ==================  3.6.0 ==================
 
+* LUCENE-3305: Added Kuromoji morphological analyzer for Japanese.
+  (Christian Moen, Masaru Hasegawa via Robert Muir)
+
 * SOLR-2919: Added parametric tailoring options to ICUCollationKeyFilterFactory.
   These can be used to customize range query/sort behavior, for example to
   support numeric collation, ignore punctuation/whitespace, ignore accents but

Modified: lucene/dev/branches/solrcloud/solr/contrib/analysis-extras/README.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/contrib/analysis-extras/README.txt?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/contrib/analysis-extras/README.txt (original)
+++ lucene/dev/branches/solrcloud/solr/contrib/analysis-extras/README.txt Wed Jan 18 22:28:07 2012
@@ -2,15 +2,16 @@ The analysis-extras plugin provides addi
 upon large dependencies/dictionaries.
 
 It includes integration with ICU for multilingual support, and 
-analyzers for Chinese and Polish.
+analyzers for Chinese, Japanese, and Polish.
 
 Relies upon the following lucene components (in lucene-libs/):
 
  * lucene-analyzers-icu-X.Y.jar
+ * lucene-analyzers-kuromoji-X.Y.jar
  * lucene-analyzers-smartcn-X.Y.jar
  * lucene-analyzers-stempel-X.Y.jar
  
 And the ICU library (in lib/):
 
  * icu4j-X.Y.jar
- 
\ No newline at end of file
+ 

Modified: lucene/dev/branches/solrcloud/solr/contrib/analysis-extras/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/contrib/analysis-extras/build.xml?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/contrib/analysis-extras/build.xml (original)
+++ lucene/dev/branches/solrcloud/solr/contrib/analysis-extras/build.xml Wed Jan 18 22:28:07 2012
@@ -27,21 +27,23 @@
 
   <path id="classpath">
   	<pathelement path="${analyzers-icu.jar}"/>
+        <pathelement path="${analyzers-kuromoji.jar}"/>
   	<pathelement path="${analyzers-smartcn.jar}"/>
   	<pathelement path="${analyzers-stempel.jar}"/>
     <path refid="solr.base.classpath"/>
   </path>
 
   <target name="module-jars-to-solr"
-          depends="jar-analyzers-icu, jar-analyzers-smartcn, jar-analyzers-stempel">
+          depends="jar-analyzers-icu, jar-analyzers-kuromoji, jar-analyzers-smartcn, jar-analyzers-stempel">
     <mkdir dir="${build.dir}/lucene-libs"/>
     <copy todir="${build.dir}/lucene-libs" preservelastmodified="true" flatten="true" failonerror="true" overwrite="true">
       <fileset file="${analyzers-icu.jar}"/>
+      <fileset file="${analyzers-kuromoji.jar}"/>
       <fileset file="${analyzers-smartcn.jar}"/>
       <fileset file="${analyzers-stempel.jar}"/>
     </copy>
   </target>
 
-  <target name="compile-core" depends="jar-analyzers-icu, jar-analyzers-smartcn, jar-analyzers-stempel, solr-contrib-build.compile-core"/>
+  <target name="compile-core" depends="jar-analyzers-icu, jar-analyzers-kuromoji, jar-analyzers-smartcn, jar-analyzers-stempel, solr-contrib-build.compile-core"/>
   <target name="dist" depends="module-jars-to-solr, common-solr.dist"/>
 </project>

Modified: lucene/dev/branches/solrcloud/solr/contrib/analysis-extras/src/test/org/apache/solr/analysis/TestICUCollationKeyFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/contrib/analysis-extras/src/test/org/apache/solr/analysis/TestICUCollationKeyFilterFactory.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/contrib/analysis-extras/src/test/org/apache/solr/analysis/TestICUCollationKeyFilterFactory.java (original)
+++ lucene/dev/branches/solrcloud/solr/contrib/analysis-extras/src/test/org/apache/solr/analysis/TestICUCollationKeyFilterFactory.java Wed Jan 18 22:28:07 2012
@@ -17,18 +17,14 @@ package org.apache.solr.analysis;
  * limitations under the License.
  */
 
-import java.io.ByteArrayInputStream;
 import java.io.IOException;
-import java.io.InputStream;
 import java.io.StringReader;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
 import org.apache.lucene.analysis.TokenStream;
 import org.apache.lucene.analysis.core.KeywordTokenizer;
 import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
-import org.apache.solr.common.ResourceLoader;
 
 import com.ibm.icu.text.Collator;
 import com.ibm.icu.text.RuleBasedCollator;
@@ -263,26 +259,6 @@ public class TestICUCollationKeyFilterFa
     assertCollatesToSame(tsUmlaut, tsOE);
   }
   
-  private class StringMockSolrResourceLoader implements ResourceLoader {
-    String text;
-
-    StringMockSolrResourceLoader(String text) {
-      this.text = text;
-    }
-
-    public List<String> getLines(String resource) throws IOException {
-      return null;
-    }
-
-    public Object newInstance(String cname, String... subpackages) {
-      return null;
-    }
-
-    public InputStream openResource(String resource) throws IOException {
-      return new ByteArrayInputStream(text.getBytes("UTF-8"));
-    }
-  }
-  
   private void assertCollatesToSame(TokenStream stream1, TokenStream stream2) throws IOException {
     assertCollation(stream1, stream2, 0);
   }

Modified: lucene/dev/branches/solrcloud/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/ContextImpl.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/ContextImpl.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/ContextImpl.java (original)
+++ lucene/dev/branches/solrcloud/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/ContextImpl.java Wed Jan 18 22:28:07 2012
@@ -155,7 +155,7 @@ public class ContextImpl extends Context
 
   private void putVal(String name, Object val, Map map) {
     if(val == null) map.remove(name);
-    else entitySession.put(name, val);
+    else map.put(name, val);
   }
 
   @Override

Modified: lucene/dev/branches/solrcloud/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DataImportHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DataImportHandler.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DataImportHandler.java (original)
+++ lucene/dev/branches/solrcloud/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DataImportHandler.java Wed Jan 18 22:28:07 2012
@@ -22,6 +22,7 @@ import org.apache.solr.common.SolrInputD
 import org.apache.solr.common.params.CommonParams;
 import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.common.params.SolrParams;
+import org.apache.solr.common.params.UpdateParams;
 import org.apache.solr.common.util.ContentStreamBase;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.common.util.ContentStream;
@@ -115,7 +116,6 @@ public class DataImportHandler extends R
         }
       }
     } catch (Throwable e) {
-      SolrConfig.severeErrors.add(e);
       LOG.error( DataImporter.MSG.LOAD_EXP, e);
       throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,
               DataImporter.MSG.INVALID_CONFIG, e);
@@ -191,7 +191,7 @@ public class DataImportHandler extends R
               IMPORT_CMD.equals(command)) {
 
         UpdateRequestProcessorChain processorChain =
-                req.getCore().getUpdateProcessingChain(SolrPluginUtils.resolveUpdateChainParam(params, LOG));
+                req.getCore().getUpdateProcessingChain(params.get(UpdateParams.UPDATE_CHAIN));
         UpdateRequestProcessor processor = processorChain.createProcessor(req, rsp);
         SolrResourceLoader loader = req.getCore().getResourceLoader();
         SolrWriter sw = getSolrWriter(processor, loader, requestParams, req);

Modified: lucene/dev/branches/solrcloud/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DataImporter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DataImporter.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DataImporter.java (original)
+++ lucene/dev/branches/solrcloud/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DataImporter.java Wed Jan 18 22:28:07 2012
@@ -225,7 +225,6 @@ public class DataImporter {
       config.readFromXml((Element) elems.item(0));
       LOG.info("Data Configuration loaded successfully");
     } catch (Exception e) {
-      SolrConfig.severeErrors.add(e);
       throw new DataImportHandlerException(SEVERE,
               "Exception occurred while initializing context", e);
     }

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/analysis/PhoneticFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/analysis/PhoneticFilterFactory.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/analysis/PhoneticFilterFactory.java (original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/analysis/PhoneticFilterFactory.java Wed Jan 18 22:28:07 2012
@@ -111,7 +111,7 @@ public class PhoneticFilterFactory exten
       }
     } 
     catch (Exception e) {
-      throw new SolrException( SolrException.ErrorCode.SERVER_ERROR, "Error initializing: "+name + "/"+clazz, e , false);
+      throw new SolrException( SolrException.ErrorCode.SERVER_ERROR, "Error initializing: "+name + "/"+clazz, e);
     }
   }
   

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/core/Config.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/core/Config.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/core/Config.java (original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/core/Config.java Wed Jan 18 22:28:07 2012
@@ -182,7 +182,7 @@ public class Config {
       return o;
 
     } catch (XPathExpressionException e) {
-      throw new SolrException( SolrException.ErrorCode.SERVER_ERROR,"Error in xpath:" + path +" for " + name,e,false);
+      throw new SolrException( SolrException.ErrorCode.SERVER_ERROR,"Error in xpath:" + path +" for " + name,e);
     }
   }
 
@@ -208,12 +208,12 @@ public class Config {
 
     } catch (XPathExpressionException e) {
       SolrException.log(log,"Error in xpath",e);
-      throw new SolrException( SolrException.ErrorCode.SERVER_ERROR,"Error in xpath:" + xstr + " for " + name,e,false);
+      throw new SolrException( SolrException.ErrorCode.SERVER_ERROR,"Error in xpath:" + xstr + " for " + name,e);
     } catch (SolrException e) {
       throw(e);
     } catch (Throwable e) {
       SolrException.log(log,"Error in xpath",e);
-      throw new SolrException( SolrException.ErrorCode.SERVER_ERROR,"Error in xpath:" + xstr+ " for " + name,e,false);
+      throw new SolrException( SolrException.ErrorCode.SERVER_ERROR,"Error in xpath:" + xstr+ " for " + name,e);
     }
   }
 
@@ -309,7 +309,7 @@ public class Config {
       throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,
         "Invalid luceneMatchVersion '" + matchVersion +
         "', valid values are: " + Arrays.toString(Version.values()) +
-        " or a string in format 'V.V'", iae, false);    
+        " or a string in format 'V.V'", iae);
     }
     
     if (version == Version.LUCENE_CURRENT && !versionWarningAlreadyLogged.getAndSet(true)) {

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/core/CoreContainer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/core/CoreContainer.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/core/CoreContainer.java (original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/core/CoreContainer.java Wed Jan 18 22:28:07 2012
@@ -342,8 +342,7 @@ public class CoreContainer 
     try {
       containerProperties = readProperties(cfg, ((NodeList) cfg.evaluate("solr", XPathConstants.NODESET)).item(0));
     } catch (Throwable e) {
-      SolrConfig.severeErrors.add(e);
-      SolrException.logOnce(log,null,e);
+      SolrException.log(log,null,e);
     }
 
     NodeList nodes = (NodeList)cfg.evaluate("solr/cores/core", XPathConstants.NODESET);
@@ -403,8 +402,7 @@ public class CoreContainer 
         register(name, core, false);
       }
       catch (Throwable ex) {
-        SolrConfig.severeErrors.add( ex );
-        SolrException.logOnce(log,null,ex);
+        SolrException.log(log,null,ex);
       }
     }
   }

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/core/RequestHandlers.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/core/RequestHandlers.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/core/RequestHandlers.java (original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/core/RequestHandlers.java Wed Jan 18 22:28:07 2012
@@ -166,11 +166,8 @@ public final class RequestHandlers {
         }
         log.info("created "+info.name+": " + info.className);
       } catch (Exception ex) {
-          SolrConfig.severeErrors.add( ex );
-          SolrException e = new SolrException
+          throw new SolrException
             (ErrorCode.SERVER_ERROR, "RequestHandler init failure", ex);
-          SolrException.logOnce(log,null,e);
-          throw e;
       }
     }
 

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/core/SolrConfig.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/core/SolrConfig.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/core/SolrConfig.java (original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/core/SolrConfig.java Wed Jan 18 22:28:07 2012
@@ -69,14 +69,6 @@ public class SolrConfig extends Config {
   public static final String DEFAULT_CONF_FILE = "solrconfig.xml";
 
 
-  /**
-   * Singleton keeping track of configuration errors
-   *
-   * @deprecated All exceptions encountered during config parsing are now thrown by the respective constructors, preventing initialization.
-   */
-  @Deprecated
-  public static final Collection<Throwable> severeErrors = new HashSet<Throwable>();
-
   /** Creates a default instance from the solrconfig.xml. */
   public SolrConfig()
   throws ParserConfigurationException, IOException, SAXException {

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/core/SolrCore.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/core/SolrCore.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/core/SolrCore.java (original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/core/SolrCore.java Wed Jan 18 22:28:07 2012
@@ -60,7 +60,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import java.net.URL;
 import java.lang.reflect.Constructor;
-import java.util.concurrent.locks.ReentrantLock;
 
 
 /**
@@ -414,7 +413,7 @@ public final class SolrCore implements S
     } catch (SolrException e) {
       throw e;
     } catch (Exception e) {
-      throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,"Error Instantiating "+msg+", "+className+ " failed to instantiate " +cast.getName(), e, false);
+      throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,"Error Instantiating "+msg+", "+className+ " failed to instantiate " +cast.getName(), e);
     }
   }
   
@@ -436,11 +435,11 @@ public final class SolrCore implements S
             return (T)con.newInstance(this, updateHandler);
           } 
         }
-        throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,"Error Instantiating "+msg+", "+className+ " could not find proper constructor for " +class1.getName(), false);
+        throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,"Error Instantiating "+msg+", "+className+ " could not find proper constructor for " +class1.getName());
     } catch (SolrException e) {
       throw e;
     } catch (Exception e) {
-      throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,"Error Instantiating "+msg+", "+className+ " failed to instantiate " +class1.getName(), e, false);
+      throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,"Error Instantiating "+msg+", "+className+ " failed to instantiate " +class1.getName(), e);
     }
   }
 
@@ -476,6 +475,20 @@ public final class SolrCore implements S
   }
   
   /**
+   * 
+   * @param dataDir
+   * @param schema
+   * @throws SAXException 
+   * @throws IOException 
+   * @throws ParserConfigurationException 
+   * 
+   * @since solr 1.0
+   */
+  public SolrCore(String dataDir, IndexSchema schema) throws ParserConfigurationException, IOException, SAXException {
+    this(null, dataDir, new SolrConfig(), schema, null);
+  }
+  
+  /**
    * Creates a new core and register it in the list of cores.
    * If a core with the same name already exists, it will be stopped and replaced by this one.
    *
@@ -603,7 +616,7 @@ public final class SolrCore implements S
       latch.countDown();//release the latch, otherwise we block trying to do the close.  This should be fine, since counting down on a latch of 0 is still fine
       //close down the searcher and any other resources, if it exists, as this is not recoverable
       close();
-      throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, null, e, false);
+      throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, null, e);
     } finally {
       // allow firstSearcher events to fire and make sure it is released
       latch.countDown();
@@ -948,21 +961,15 @@ public final class SolrCore implements S
   // This reference is protected by searcherLock.
   private RefCounted<SolrIndexSearcher> _searcher;
 
-  // All of the normal open searchers.  Don't access this directly.
+  // All of the open searchers.  Don't access this directly.
   // protected by synchronizing on searcherLock.
   private final LinkedList<RefCounted<SolrIndexSearcher>> _searchers = new LinkedList<RefCounted<SolrIndexSearcher>>();
-  private final LinkedList<RefCounted<SolrIndexSearcher>> _realtimeSearchers = new LinkedList<RefCounted<SolrIndexSearcher>>();
 
   final ExecutorService searcherExecutor = Executors.newSingleThreadExecutor();
   private int onDeckSearchers;  // number of searchers preparing
-  // Lock ordering: one can acquire the openSearcherLock and then the searcherLock, but not vice-versa.
   private Object searcherLock = new Object();  // the sync object for the searcher
-  private ReentrantLock openSearcherLock = new ReentrantLock(true);     // used to serialize opens/reopens for absolute ordering
   private final int maxWarmingSearchers;  // max number of on-deck searchers allowed
 
-  private RefCounted<SolrIndexSearcher> realtimeSearcher;
-
-
   /**
   * Return a registered {@link RefCounted}&lt;{@link SolrIndexSearcher}&gt; with
   * the reference count incremented.  It <b>must</b> be decremented when no longer needed.
@@ -981,162 +988,29 @@ public final class SolrCore implements S
   }
 
   /**
-  * Return the newest normal {@link RefCounted}&lt;{@link SolrIndexSearcher}&gt; with
+  * Return the newest {@link RefCounted}&lt;{@link SolrIndexSearcher}&gt; with
   * the reference count incremented.  It <b>must</b> be decremented when no longer needed.
   * If no searcher is currently open, then if openNew==true a new searcher will be opened,
   * or null is returned if openNew==false.
   */
   public RefCounted<SolrIndexSearcher> getNewestSearcher(boolean openNew) {
     synchronized (searcherLock) {
-      if (!_searchers.isEmpty()) {
-        RefCounted<SolrIndexSearcher> newest = _searchers.getLast();
-        newest.incref();
-        return newest;
-      }
+      if (_searchers.isEmpty()) {
+        if (!openNew) return null;
+        // Not currently implemented since simply calling getSearcher during inform()
+        // can result in a deadlock.  Right now, solr always opens a searcher first
+        // before calling inform() anyway, so this should never happen.
+        throw new UnsupportedOperationException();
+      }
+      RefCounted<SolrIndexSearcher> newest = _searchers.getLast();
+      newest.incref();
+      return newest;
     }
-
-    return openNew ? getRealtimeSearcher() : null;
   }
 
-
-  /** Gets the latest real-time searcher w/o forcing open a new searcher if one already exists.
-   * The reference count will be incremented.
-   */
-  public RefCounted<SolrIndexSearcher> getRealtimeSearcher() {
-    synchronized (searcherLock) {
-      if (realtimeSearcher != null) {
-        realtimeSearcher.incref();
-        return realtimeSearcher;
-      }
-    }
-
-    // use the searcher lock to prevent multiple people from trying to open at once
-    openSearcherLock.lock();
-    try {
-
-      // try again
-      synchronized (searcherLock) {
-        if (realtimeSearcher != null) {
-          realtimeSearcher.incref();
-          return realtimeSearcher;
-        }
-      }
-
-      // force a new searcher open
-      return openNewSearcher(true, true);
-    } finally {
-      openSearcherLock.unlock();
-    }
-  }
-
-
   public RefCounted<SolrIndexSearcher> getSearcher(boolean forceNew, boolean returnSearcher, final Future[] waitSearcher) throws IOException {
     return getSearcher(forceNew, returnSearcher, waitSearcher, false);
   }
-
-
-  /** Opens a new searcher and returns a RefCounted<SolrIndexSearcher> with it's reference incremented.
-   *
-   * "realtime" means that we need to open quickly for a realtime view of the index, hence don't do any
-   * autowarming and add to the _realtimeSearchers queue rather than the _searchers queue (so it won't
-   * be used for autowarming by a future normal searcher).  A "realtime" searcher will currently never
-   * become "registered" (since it currently lacks caching).
-   *
-   * realtimeSearcher is updated to the latest opened searcher, regardless of the value of "realtime".
-   *
-   * This method aquires openSearcherLock - do not call with searckLock held!
-   */
-  public RefCounted<SolrIndexSearcher> openNewSearcher(boolean updateHandlerReopens, boolean realtime) {
-    SolrIndexSearcher tmp;
-    RefCounted<SolrIndexSearcher> newestSearcher = null;
-    boolean nrt = solrConfig.reopenReaders && updateHandlerReopens;
-
-    openSearcherLock.lock();
-    try {
-      String newIndexDir = null;
-      File indexDirFile = null;
-      File newIndexDirFile = null;
-
-      // if it's not a normal near-realtime update, check that paths haven't changed.
-      if (!nrt) {
-        indexDirFile = new File(getIndexDir()).getCanonicalFile();
-        newIndexDir = getNewIndexDir();
-        newIndexDirFile = new File(newIndexDir).getCanonicalFile();
-      }
-
-      synchronized (searcherLock) {
-        newestSearcher = realtimeSearcher;
-        if (newestSearcher != null) {
-          newestSearcher.incref();      // the matching decref is in the finally block
-        }
-      }
-
-      if (newestSearcher != null && solrConfig.reopenReaders
-          && (nrt || indexDirFile.equals(newIndexDirFile))) {
-
-        IndexReader newReader;
-        IndexReader currentReader = newestSearcher.get().getIndexReader();
-
-        if (updateHandlerReopens) {
-          // SolrCore.verbose("start reopen from",previousSearcher,"writer=",writer);
-          IndexWriter writer = getUpdateHandler().getSolrCoreState().getIndexWriter(this);
-          newReader = IndexReader.openIfChanged(currentReader, writer, true);
-
-        } else {
-          // verbose("start reopen without writer, reader=", currentReader);
-          newReader = IndexReader.openIfChanged(currentReader);
-          // verbose("reopen result", newReader);
-        }
-
-        if (newReader == null) {
-          // if this is a request for a realtime searcher, just return the same searcher if there haven't been any changes.
-          if (realtime) {
-            newestSearcher.incref();
-            return newestSearcher;
-          }
-
-          currentReader.incRef();
-          newReader = currentReader;
-        }
-
-       // for now, turn off caches if this is for a realtime reader (caches take a little while to instantiate)
-        tmp = new SolrIndexSearcher(this, schema, (realtime ? "realtime":"main"), newReader, true, !realtime, true, directoryFactory);
-
-      } else {
-        // verbose("non-reopen START:");
-        tmp = new SolrIndexSearcher(this, newIndexDir, schema, getSolrConfig().mainIndexConfig, "main", true, directoryFactory);
-        // verbose("non-reopen DONE: searcher=",tmp);
-      }
-
-      List<RefCounted<SolrIndexSearcher>> searcherList = realtime ? _realtimeSearchers : _searchers;
-      RefCounted<SolrIndexSearcher> newSearcher = newHolder(tmp, searcherList);    // refcount now at 1
-
-      // Increment reference again for "realtimeSearcher" variable.  It should be at 2 after.
-      // When it's decremented by both the caller of this method, and by realtimeSearcher being replaced,
-      // it will be closed.
-      newSearcher.incref();
-
-      synchronized (searcherLock) {
-        if (realtimeSearcher != null) {
-          realtimeSearcher.decref();
-        }
-        realtimeSearcher = newSearcher;
-        searcherList.add(realtimeSearcher);
-      }
-
-      return newSearcher;
-
-    } catch (Exception e) {
-      throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Error opening new searcher", e);
-    }
-    finally {
-      openSearcherLock.unlock();
-      if (newestSearcher != null) {
-        newestSearcher.decref();
-      }
-    }
-
-  }
   
   /**
    * Get a {@link SolrIndexSearcher} or start the process of creating a new one.
@@ -1226,34 +1100,86 @@ public final class SolrCore implements S
         String msg="Error opening new searcher. exceeded limit of maxWarmingSearchers="+maxWarmingSearchers + ", try again later.";
         log.warn(logid+""+ msg);
         // HTTP 503==service unavailable, or 409==Conflict
-        throw new SolrException(SolrException.ErrorCode.SERVICE_UNAVAILABLE,msg,true);
+        throw new SolrException(SolrException.ErrorCode.SERVICE_UNAVAILABLE,msg);
       } else if (onDeckSearchers > 1) {
         log.info(logid+"PERFORMANCE WARNING: Overlapping onDeckSearchers=" + onDeckSearchers);
       }
     }
 
-    // a signal to decrement onDeckSearchers if something goes wrong.
-    final boolean[] decrementOnDeckCount=new boolean[]{true};
-    RefCounted<SolrIndexSearcher> currSearcherHolder = null;     // searcher we are autowarming from
-    RefCounted<SolrIndexSearcher> searchHolder = null;
-    boolean success = false;
+    // open the index synchronously
+    // if this fails, we need to decrement onDeckSearchers again.
+    SolrIndexSearcher tmp;
+    RefCounted<SolrIndexSearcher> newestSearcher = null;
 
-    openSearcherLock.lock();
     try {
-      searchHolder = openNewSearcher(updateHandlerReopens, false);
-       // the searchHolder will be incremented once already (and it will eventually be assigned to _searcher when registered)
-       // increment it again if we are going to return it to the caller.
-      if (returnSearcher) {
-        searchHolder.incref();
+      newestSearcher = getNewestSearcher(false);
+      String newIndexDir = getNewIndexDir();
+      File indexDirFile = new File(getIndexDir()).getCanonicalFile();
+      File newIndexDirFile = new File(newIndexDir).getCanonicalFile();
+      
+      if (newestSearcher != null && solrConfig.reopenReaders
+          && indexDirFile.equals(newIndexDirFile)) {
+
+        if (updateHandlerReopens) {
+          
+          tmp = getUpdateHandler().reopenSearcher(newestSearcher.get());
+        } else {
+          
+          IndexReader currentReader = newestSearcher.get().getIndexReader();
+          IndexReader newReader;
+          
+          // verbose("start reopen without writer, reader=", currentReader);
+          newReader = IndexReader.openIfChanged(currentReader);
+          // verbose("reopen result", newReader);
+
+
+          if (newReader == null) {
+            currentReader.incRef();
+            newReader = currentReader;
+          }
+          
+          tmp = new SolrIndexSearcher(this, schema, "main", newReader, true, true, true, directoryFactory);
+        }
+
+
+      } else {
+        // verbose("non-reopen START:");
+        tmp = new SolrIndexSearcher(this, newIndexDir, schema, getSolrConfig().mainIndexConfig, "main", true, directoryFactory);
+        // verbose("non-reopen DONE: searcher=",tmp);
       }
+    } catch (Throwable th) {
+      synchronized(searcherLock) {
+        onDeckSearchers--;
+        // notify another waiter to continue... it may succeed
+        // and wake any others.
+        searcherLock.notify();
+      }
+      // need to close the searcher here??? we shouldn't have to.
+      throw new RuntimeException(th);
+    } finally {
+      if (newestSearcher != null) {
+        newestSearcher.decref();
+      }
+    }
+    
+    final SolrIndexSearcher newSearcher=tmp;
 
+    RefCounted<SolrIndexSearcher> currSearcherHolder=null;
+    final RefCounted<SolrIndexSearcher> newSearchHolder=newHolder(newSearcher);
 
-      final RefCounted<SolrIndexSearcher> newSearchHolder = searchHolder;
-      final SolrIndexSearcher newSearcher = newSearchHolder.get();
+    if (returnSearcher) newSearchHolder.incref();
 
+    // a signal to decrement onDeckSearchers if something goes wrong.
+    final boolean[] decrementOnDeckCount=new boolean[1];
+    decrementOnDeckCount[0]=true;
+
+    try {
 
       boolean alreadyRegistered = false;
       synchronized (searcherLock) {
+        _searchers.add(newSearchHolder);
+        // verbose("added searcher ",newSearchHolder.get()," to _searchers");
+
         if (_searcher == null) {
           // if there isn't a current searcher then we may
           // want to register this one before warming is complete instead of waiting.
@@ -1272,133 +1198,174 @@ public final class SolrCore implements S
 
       final SolrIndexSearcher currSearcher = currSearcherHolder==null ? null : currSearcherHolder.get();
 
+      //
+      // Note! if we registered the new searcher (but didn't increment it's
+      // reference count because returnSearcher==false, it's possible for
+      // someone else to register another searcher, and thus cause newSearcher
+      // to close while we are warming.
+      //
+      // Should we protect against that by incrementing the reference count?
+      // Maybe we should just let it fail?   After all, if returnSearcher==false
+      // and newSearcher has been de-registered, what's the point of continuing?
+      //
+
       Future future=null;
 
       // warm the new searcher based on the current searcher.
       // should this go before the other event handlers or after?
       if (currSearcher != null) {
-        future = searcherExecutor.submit(
-            new Callable() {
-              public Object call() throws Exception {
-                try {
-                  newSearcher.warm(currSearcher);
-                } catch (Throwable e) {
-                  SolrException.log(log,e);
-                }
-                return null;
-              }
+        try {
+          future = searcherExecutor.submit(
+                  new Callable() {
+                    public Object call() throws Exception {
+                      try {
+                        newSearcher.warm(currSearcher);
+                      } catch (Throwable e) {
+                        SolrException.log(log, null, e);
+                      }
+                      return null;
+                    }
+                  }
+          );
+        } catch(Exception e) {
+          // if submit fails, newSearchHolder does not get decref'd
+          if (newSearchHolder != null) {
+            newSearchHolder.decref();
+            if (returnSearcher) {
+              newSearchHolder.decref();
             }
-        );
+          }
+          throw e;
+        }
       }
-
+      
       if (currSearcher==null && firstSearcherListeners.size() > 0) {
-        future = searcherExecutor.submit(
-            new Callable() {
-              public Object call() throws Exception {
-                try {
-                  for (SolrEventListener listener : firstSearcherListeners) {
-                    listener.newSearcher(newSearcher,null);
+        try {
+          future = searcherExecutor.submit(
+                  new Callable() {
+                    public Object call() throws Exception {
+                      try {
+                        for (SolrEventListener listener : firstSearcherListeners) {
+                          listener.newSearcher(newSearcher,null);
+                        }
+                      } catch (Throwable e) {
+                        SolrException.log(log, null, e);
+                      }
+                      return null;
+                    }
                   }
-                } catch (Throwable e) {
-                  SolrException.logOnce(log,null,e);
-                }
-                return null;
-              }
+          );
+        } catch(Exception e) {
+          // if submit fails, newSearchHolder does not get decref'd
+          if (newSearchHolder != null) {
+            newSearchHolder.decref();
+            if (returnSearcher) {
+              newSearchHolder.decref();
             }
-        );
+          }
+          throw e;
+        }
       }
 
       if (currSearcher!=null && newSearcherListeners.size() > 0) {
-        future = searcherExecutor.submit(
-            new Callable() {
-              public Object call() throws Exception {
-                try {
-                  for (SolrEventListener listener : newSearcherListeners) {
-                    listener.newSearcher(newSearcher, currSearcher);
+        try {
+          future = searcherExecutor.submit(
+                  new Callable() {
+                    public Object call() throws Exception {
+                      try {
+                        for (SolrEventListener listener : newSearcherListeners) {
+                          listener.newSearcher(newSearcher, currSearcher);
+                        }
+                      } catch (Throwable e) {
+                        SolrException.log(log, null, e);
+                      }
+                      return null;
+                    }
                   }
-                } catch (Throwable e) {
-                  SolrException.logOnce(log,null,e);
-                }
-                return null;
-              }
-            }
-        );
+          );
+      } catch(Exception e) {
+        // if submit fails, newSearchHolder does not get decref'd
+        if (newSearchHolder != null) {
+          newSearchHolder.decref();
+          if (returnSearcher) {
+            newSearchHolder.decref();
+          }
+        }
+        throw e;
+      }
       }
 
       // WARNING: this code assumes a single threaded executor (that all tasks
       // queued will finish first).
       final RefCounted<SolrIndexSearcher> currSearcherHolderF = currSearcherHolder;
       if (!alreadyRegistered) {
-        future = searcherExecutor.submit(
-            new Callable() {
-              public Object call() throws Exception {
-                try {
-                  // registerSearcher will decrement onDeckSearchers and
-                  // do a notify, even if it fails.
-                  registerSearcher(newSearchHolder);
-                } catch (Throwable e) {
-                  SolrException.log(log, e);
-                } finally {
-                  // we are all done with the old searcher we used
-                  // for warming...
-                  if (currSearcherHolderF!=null) currSearcherHolderF.decref();
-                }
-                return null;
-              }
+        try {
+          future = searcherExecutor.submit(
+                  new Callable() {
+                    public Object call() throws Exception {
+                      try {
+                        // signal that we no longer need to decrement
+                        // the count *before* registering the searcher since
+                        // registerSearcher will decrement even if it errors.
+                        decrementOnDeckCount[0]=false;
+                        registerSearcher(newSearchHolder);
+                      } catch (Throwable e) {
+                        SolrException.log(log, null, e);
+                      } finally {
+                        // we are all done with the old searcher we used
+                        // for warming...
+                        if (currSearcherHolderF!=null) currSearcherHolderF.decref();
+                      }
+                      return null;
+                    }
+                  }
+          );
+        } catch(Exception e) {
+          // if submit fails, newSearchHolder does not get decref'd
+          if (newSearchHolder != null) {
+            newSearchHolder.decref();
+            if (returnSearcher) {
+              newSearchHolder.decref();
             }
-        );
+          }
+          throw e;
+        }
       }
 
       if (waitSearcher != null) {
         waitSearcher[0] = future;
       }
 
-      success = true;
-
       // Return the searcher as the warming tasks run in parallel
       // callers may wait on the waitSearcher future returned.
       return returnSearcher ? newSearchHolder : null;
 
     } catch (Exception e) {
-      if (e instanceof SolrException) throw (SolrException)e;
-      throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);
-    } finally {
+      SolrException.log(log, null, e);
+      if (currSearcherHolder != null) currSearcherHolder.decref();
 
-      if (!success) {
-        synchronized (searcherLock) {
+      synchronized (searcherLock) {
+        if (decrementOnDeckCount[0]) {
           onDeckSearchers--;
-
-          if (onDeckSearchers < 0) {
-            // sanity check... should never happen
-            log.error(logid+"ERROR!!! onDeckSearchers after decrement=" + onDeckSearchers);
-            onDeckSearchers=0; // try and recover
-          }
-          // if we failed, we need to wake up at least one waiter to continue the process
-          searcherLock.notify();
         }
-
-        if (currSearcherHolder != null) {
-          currSearcherHolder.decref();
-        }
-
-        if (searchHolder != null) {
-          searchHolder.decref();      // decrement 1 for _searcher (searchHolder will never become _searcher now)
-          if (returnSearcher) {
-            searchHolder.decref();    // decrement 1 because we won't be returning the searcher to the user
-          }
+        if (onDeckSearchers < 0) {
+          // sanity check... should never happen
+          log.error(logid+"ERROR!!! onDeckSearchers after decrement=" + onDeckSearchers);
+          onDeckSearchers=0; // try and recover
         }
+        // if we failed, we need to wake up at least one waiter to continue the process
+        searcherLock.notify();
       }
 
-      // we want to do this after we decrement onDeckSearchers so another thread
-      // doesn't increment first and throw a false warning.
-      openSearcherLock.unlock();
-
+      // since the indexreader was already opened, assume we can continue on
+      // even though we got an exception.
+      return returnSearcher ? newSearchHolder : null;
     }
 
   }
 
 
-  private RefCounted<SolrIndexSearcher> newHolder(SolrIndexSearcher newSearcher, final List<RefCounted<SolrIndexSearcher>> searcherList) {
+  private RefCounted<SolrIndexSearcher> newHolder(SolrIndexSearcher newSearcher) {
     RefCounted<SolrIndexSearcher> holder = new RefCounted<SolrIndexSearcher>(newSearcher) {
       @Override
       public void close() {
@@ -1410,13 +1377,11 @@ public final class SolrCore implements S
             // This relies on the RefCounted class allowing close() to be called every
             // time the counter hits zero.
             if (refcount.get() > 0) return;
-            searcherList.remove(this);
+            _searchers.remove(this);
           }
           resource.close();
-        } catch (Throwable e) {
-          // do not allow decref() operations to fail since they are typically called in finally blocks
-          // and throwing another exception would be very unexpected.
-          SolrException.log(log, "Error closing searcher:", e);
+        } catch (IOException e) {
+          log.error("Error closing searcher:" + SolrException.toStr(e));
         }
       }
     };
@@ -1424,9 +1389,6 @@ public final class SolrCore implements S
     return holder;
   }
 
-  public boolean isReloaded() {
-    return isReloaded;
-  }
 
   // Take control of newSearcherHolder (which should have a reference count of at
   // least 1 already.  If the caller wishes to use the newSearcherHolder directly
@@ -1462,7 +1424,6 @@ public final class SolrCore implements S
         log.info(logid+"Registered new searcher " + newSearcher);
 
       } catch (Throwable e) {
-        // an exception in register() shouldn't be fatal.
         log(e);
       } finally {
         // wake up anyone waiting for a searcher
@@ -1478,13 +1439,9 @@ public final class SolrCore implements S
   public void closeSearcher() {
     log.info(logid+"Closing main searcher on request.");
     synchronized (searcherLock) {
-      if (realtimeSearcher != null) {
-        realtimeSearcher.decref();
-        realtimeSearcher = null;
-      }
       if (_searcher != null) {
         _searcher.decref();   // dec refcount for this._searcher
-        _searcher = null; // isClosed() does check this
+        _searcher=null; // isClosed() does check this
         infoRegistry.remove("currentSearcher");
       }
     }
@@ -1498,7 +1455,7 @@ public final class SolrCore implements S
       
       if (log.isWarnEnabled()) log.warn(logid + msg + ":" + req);
       
-      throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, msg, true);
+      throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, msg);
     }
     // setup response header and handle request
     final NamedList<Object> responseHeader = new SimpleOrderedMap<Object>();
@@ -1514,7 +1471,7 @@ public final class SolrCore implements S
     
     handler.handleRequest(req,rsp);
     setResponseHeaderValues(handler,req,rsp);
-
+    
     if (log.isInfoEnabled()) {
       StringBuilder sb = new StringBuilder(logid);
       for (int i=0; i<toLog.size(); i++) {
@@ -1569,7 +1526,7 @@ public final class SolrCore implements S
 
 
   final public static void log(Throwable e) {
-    SolrException.logOnce(log,null,e);
+    SolrException.log(log, null, e);
   }
 
   
@@ -1623,11 +1580,8 @@ public final class SolrCore implements S
         }
         log.info("created "+info.name+": " + info.className);
       } catch (Exception ex) {
-          SolrConfig.severeErrors.add( ex );
-          SolrException e = new SolrException
+          throw new SolrException
             (SolrException.ErrorCode.SERVER_ERROR, "QueryResponseWriter init failure", ex);
-          SolrException.logOnce(log,null,e);
-          throw e;
       }
     }
 
@@ -1942,6 +1896,10 @@ public final class SolrCore implements S
       return getWrappedWriter().getContentType(request, response);
     }
   }
+
+  public boolean isReloaded() {
+    return isReloaded;
+  }
 }
 
 

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java (original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java Wed Jan 18 22:28:07 2012
@@ -406,7 +406,7 @@ public class SolrResourceLoader implemen
         }
       }
   
-      throw new SolrException( SolrException.ErrorCode.SERVER_ERROR, "Error loading class '" + cname + "'", e, false);
+      throw new SolrException( SolrException.ErrorCode.SERVER_ERROR, "Error loading class '" + cname + "'", e);
     }finally{
       //cache the shortname vs FQN if it is loaded by the webapp classloader  and it is loaded
       // using a shortname
@@ -424,7 +424,7 @@ public class SolrResourceLoader implemen
     Class clazz = findClass(cname,subpackages);
     if( clazz == null ) {
       throw new SolrException( SolrException.ErrorCode.SERVER_ERROR,
-          "Can not find class: "+cname + " in " + classLoader, false);
+          "Can not find class: "+cname + " in " + classLoader);
     }
     
     Object obj = null;
@@ -433,7 +433,7 @@ public class SolrResourceLoader implemen
     } 
     catch (Exception e) {
       throw new SolrException( SolrException.ErrorCode.SERVER_ERROR,
-          "Error instantiating class: '" + clazz.getName()+"'", e, false );
+          "Error instantiating class: '" + clazz.getName()+"'", e);
     }
 
     if (!live) {
@@ -457,7 +457,7 @@ public class SolrResourceLoader implemen
     Class clazz = findClass(cname,subpackages);
     if( clazz == null ) {
       throw new SolrException( SolrException.ErrorCode.SERVER_ERROR,
-          "Can not find class: "+cname + " in " + classLoader, false);
+          "Can not find class: "+cname + " in " + classLoader);
     }
     
     Object obj = null;
@@ -467,7 +467,7 @@ public class SolrResourceLoader implemen
     } 
     catch (Exception e) {
       throw new SolrException( SolrException.ErrorCode.SERVER_ERROR,
-          "Error instantiating class: '" + clazz.getName()+"'", e, false );
+          "Error instantiating class: '" + clazz.getName()+"'", e);
     }
 
     if (!live) {
@@ -488,7 +488,7 @@ public class SolrResourceLoader implemen
     Class clazz = findClass(cName,subPackages);
     if( clazz == null ) {
       throw new SolrException( SolrException.ErrorCode.SERVER_ERROR,
-          "Can not find class: "+cName + " in " + classLoader, false);
+          "Can not find class: "+cName + " in " + classLoader);
     }
 
     Object obj = null;
@@ -499,7 +499,7 @@ public class SolrResourceLoader implemen
     }
     catch (Exception e) {
       throw new SolrException( SolrException.ErrorCode.SERVER_ERROR,
-          "Error instantiating class: '" + clazz.getName()+"'", e, false );
+          "Error instantiating class: '" + clazz.getName()+"'", e);
     }
 
     if (!live) {

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/ContentStreamHandlerBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/ContentStreamHandlerBase.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/ContentStreamHandlerBase.java (original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/ContentStreamHandlerBase.java Wed Jan 18 22:28:07 2012
@@ -18,6 +18,7 @@ package org.apache.solr.handler;
 
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.params.SolrParams;
+import org.apache.solr.common.params.UpdateParams;
 import org.apache.solr.common.util.ContentStream;
 import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.response.SolrQueryResponse;
@@ -39,7 +40,7 @@ public abstract class ContentStreamHandl
   public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
     SolrParams params = req.getParams();
     UpdateRequestProcessorChain processorChain =
-            req.getCore().getUpdateProcessingChain(SolrPluginUtils.resolveUpdateChainParam(params, log));
+            req.getCore().getUpdateProcessingChain(params.get(UpdateParams.UPDATE_CHAIN));
 
     UpdateRequestProcessor processor = processorChain.createProcessor(req, rsp);
 

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/MoreLikeThisHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/MoreLikeThisHandler.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/MoreLikeThisHandler.java (original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/MoreLikeThisHandler.java Wed Jan 18 22:28:07 2012
@@ -246,7 +246,7 @@ public class MoreLikeThisHandler extends
           rsp.add("debug", dbgInfo);
         }
       } catch (Exception e) {
-        SolrException.logOnce(SolrCore.log, "Exception during debug", e);
+        SolrException.log(SolrCore.log, "Exception during debug", e);
         rsp.add("exception_during_debug", SolrException.toStr(e));
       }
     }

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/PingRequestHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/PingRequestHandler.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/PingRequestHandler.java (original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/PingRequestHandler.java Wed Jan 18 22:28:07 2012
@@ -45,7 +45,7 @@ public class PingRequestHandler extends 
     // Check if the service is available
     String healthcheck = core.getSolrConfig().get("admin/healthcheck/text()", null );
     if( healthcheck != null && !new File(healthcheck).exists() ) {
-      throw new SolrException(SolrException.ErrorCode.SERVICE_UNAVAILABLE, "Service disabled", true);
+      throw new SolrException(SolrException.ErrorCode.SERVICE_UNAVAILABLE, "Service disabled");
     }
     
     // Get the RequestHandler

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/XMLLoader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/XMLLoader.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/XMLLoader.java (original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/XMLLoader.java Wed Jan 18 22:28:07 2012
@@ -112,6 +112,7 @@ class XMLLoader extends ContentStreamLoa
 
             // First look for commitWithin parameter on the request, will be overwritten for individual <add>'s
             addCmd.commitWithin = params.getInt(UpdateParams.COMMIT_WITHIN, -1);
+            addCmd.overwrite = params.getBool(UpdateParams.OVERWRITE, true);
             
             for (int i = 0; i < parser.getAttributeCount(); i++) {
               String attrName = parser.getAttributeLocalName(i);

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/XmlUpdateRequestHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/XmlUpdateRequestHandler.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/XmlUpdateRequestHandler.java (original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/XmlUpdateRequestHandler.java Wed Jan 18 22:28:07 2012
@@ -33,8 +33,6 @@ public class XmlUpdateRequestHandler ext
   public static Logger log = LoggerFactory.getLogger(XmlUpdateRequestHandler.class);
   private static final XMLErrorLogger xmllog = new XMLErrorLogger(log);
 
-  public static final String UPDATE_PROCESSOR = "update.processor";
-
   // XML Constants
   public static final String ADD = "add";
   public static final String DELETE = "delete";

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/XsltUpdateRequestHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/XsltUpdateRequestHandler.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/XsltUpdateRequestHandler.java (original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/XsltUpdateRequestHandler.java Wed Jan 18 22:28:07 2012
@@ -34,9 +34,6 @@ public class XsltUpdateRequestHandler ex
   public static Logger log = LoggerFactory.getLogger(XsltUpdateRequestHandler.class);
   public static final XMLErrorLogger xmllog = new XMLErrorLogger(log);
 
-  public static final String UPDATE_PROCESSOR = "update.processor";
-
-
   public static final int XSLT_CACHE_DEFAULT = 60;
   private static final String XSLT_CACHE_PARAM = "xsltCacheLifetimeSeconds"; 
 

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java (original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java Wed Jan 18 22:28:07 2012
@@ -44,6 +44,7 @@ import org.apache.solr.common.params.Cor
 import org.apache.solr.common.params.CoreAdminParams.CoreAdminAction;
 import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.common.params.SolrParams;
+import org.apache.solr.common.params.UpdateParams;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.common.util.SimpleOrderedMap;
 import org.apache.solr.core.CloseHook;
@@ -265,7 +266,7 @@ public class CoreAdminHandler extends Re
         }
 
         UpdateRequestProcessorChain processorChain =
-                core.getUpdateProcessingChain(SolrPluginUtils.resolveUpdateChainParam(params, log));
+                core.getUpdateProcessingChain(params.get(UpdateParams.UPDATE_CHAIN));
         wrappedReq = new LocalSolrQueryRequest(core, req.getParams());
         UpdateRequestProcessor processor =
                 processorChain.createProcessor(wrappedReq, rsp);
@@ -658,8 +659,7 @@ public class CoreAdminHandler extends Re
       Thread.sleep(4000);
       
       UpdateRequestProcessorChain processorChain = core
-          .getUpdateProcessingChain(SolrPluginUtils.resolveUpdateChainParam(
-              params, log));
+          .getUpdateProcessingChain(params.get(UpdateParams.UPDATE_CHAIN));
       
       ModifiableSolrParams reqParams = new ModifiableSolrParams(req.getParams());
       reqParams.set(DistributedUpdateProcessor.COMMIT_END_POINT, "true");

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java (original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java Wed Jan 18 22:28:07 2012
@@ -27,13 +27,11 @@ import org.apache.lucene.document.Docume
 import org.apache.lucene.document.Field;
 import org.apache.lucene.index.*;
 import org.apache.lucene.index.FieldInfo.IndexOptions;
-import static org.apache.lucene.index.FieldInfo.IndexOptions.DOCS_ONLY;
-import static org.apache.lucene.index.FieldInfo.IndexOptions.DOCS_AND_FREQS;
-
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.CharsRef;
 import org.apache.lucene.util.PriorityQueue;
+import org.apache.lucene.util.ReaderUtil;
 import org.apache.lucene.util.UnicodeUtil;
 import org.apache.solr.analysis.CharFilterFactory;
 import org.apache.solr.analysis.TokenFilterFactory;
@@ -55,7 +53,9 @@ import org.apache.solr.schema.SchemaFiel
 import org.apache.solr.search.SolrIndexSearcher;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.apache.lucene.index.DocsEnum;
+
+import static org.apache.lucene.index.FieldInfo.IndexOptions.DOCS_AND_FREQS;
+import static org.apache.lucene.index.FieldInfo.IndexOptions.DOCS_ONLY;
 
 /**
  * This handler exposes the internal lucene index.  It is inspired by and 
@@ -289,11 +289,15 @@ public class LukeRequestHandler extends 
     IndexReader reader = searcher.getIndexReader();
     IndexSchema schema = searcher.getSchema();
 
+    Set<String> fieldNames = new TreeSet<String>();
+    for(FieldInfo fieldInfo : ReaderUtil.getMergedFieldInfos(reader)) {
+      fieldNames.add(fieldInfo.name);
+    }
+
     // Walk the term enum and keep a priority queue for each map in our set
     SimpleOrderedMap<Object> finfo = new SimpleOrderedMap<Object>();
     Fields theFields = MultiFields.getFields(reader);
 
-    Set<String> fieldNames = new TreeSet<String>(reader.getFieldNames(IndexReader.FieldOption.ALL));
     for (String fieldName : fieldNames) {
       if (fields != null && ! fields.contains(fieldName)) {
         continue; // we're not interested in this term

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java (original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java Wed Jan 18 22:28:07 2012
@@ -216,7 +216,7 @@ public class QueryElevationComponent ext
       }
     } catch (Exception ex) {
       throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,
-          "Error initializing QueryElevationComponent.", ex, false);
+          "Error initializing QueryElevationComponent.", ex);
     }
   }
 

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/component/StatsComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/component/StatsComponent.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/component/StatsComponent.java (original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/component/StatsComponent.java Wed Jan 18 22:28:07 2012
@@ -23,6 +23,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.lucene.index.SlowMultiReaderWrapper;
 import org.apache.lucene.search.FieldCache;
 import org.apache.lucene.util.BytesRef;
 import org.apache.solr.common.SolrException;
@@ -246,12 +247,13 @@ class SimpleStats {
     return res;
   }
   
+  // why does this use a top-level field cache?
   public NamedList<?> getFieldCacheStats(String fieldName, String[] facet ) {
     SchemaField sf = searcher.getSchema().getField(fieldName);
     
     FieldCache.DocTermsIndex si;
     try {
-      si = FieldCache.DEFAULT.getTermsIndex(searcher.getIndexReader(), fieldName);
+      si = FieldCache.DEFAULT.getTermsIndex(new SlowMultiReaderWrapper(searcher.getIndexReader()), fieldName);
     } 
     catch (IOException e) {
       throw new RuntimeException( "failed to open field cache for: "+fieldName, e );
@@ -273,7 +275,7 @@ class SimpleStats {
           + "[" + facetFieldType + "]");
         }
       try {
-        facetTermsIndex = FieldCache.DEFAULT.getTermsIndex(searcher.getIndexReader(), facetField);
+        facetTermsIndex = FieldCache.DEFAULT.getTermsIndex(new SlowMultiReaderWrapper(searcher.getIndexReader()), facetField);
       }
       catch (IOException e) {
         throw new RuntimeException( "failed to open field cache for: "

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/component/TermVectorComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/component/TermVectorComponent.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/component/TermVectorComponent.java (original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/component/TermVectorComponent.java Wed Jan 18 22:28:07 2012
@@ -8,7 +8,6 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
 import org.apache.lucene.index.DocsAndPositionsEnum;
 import org.apache.lucene.index.FieldInfo;
 import org.apache.lucene.index.Fields;
@@ -283,18 +282,17 @@ public class TermVectorComponent extends
         termInfo.add("tf", freq);
       }
 
-      dpEnum = termsEnum.docsAndPositions(null, dpEnum);
+      dpEnum = termsEnum.docsAndPositions(null, dpEnum, fieldOptions.offsets);
+      boolean useOffsets = fieldOptions.offsets;
+      if (dpEnum == null) {
+        useOffsets = false;
+        dpEnum = termsEnum.docsAndPositions(null, dpEnum, false);
+      }
 
       boolean usePositions = false;
-      boolean useOffsets = false;
-      OffsetAttribute offsetAtt = null;
       if (dpEnum != null) {
         dpEnum.nextDoc();
         usePositions = fieldOptions.positions;
-        if (fieldOptions.offsets && dpEnum.attributes().hasAttribute(OffsetAttribute.class)) {
-          useOffsets = true;
-          offsetAtt = dpEnum.attributes().getAttribute(OffsetAttribute.class);
-        }
       }
 
       NamedList<Number> theOffsets = null;
@@ -317,8 +315,8 @@ public class TermVectorComponent extends
           }
 
           if (theOffsets != null) {
-            theOffsets.add("start", offsetAtt.startOffset());
-            theOffsets.add("end", offsetAtt.endOffset());
+            theOffsets.add("start", dpEnum.startOffset());
+            theOffsets.add("end", dpEnum.endOffset());
           }
         }
       }

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java (original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java Wed Jan 18 22:28:07 2012
@@ -577,21 +577,23 @@ public class DefaultSolrHighlighter exte
       String[] altTexts = listFields.toArray(new String[listFields.size()]);
 
       if (altTexts != null && altTexts.length > 0){
+        Encoder encoder = getEncoder(fieldName, params);
         int alternateFieldLen = params.getFieldInt(fieldName, HighlightParams.ALTERNATE_FIELD_LENGTH,0);
-        if( alternateFieldLen <= 0 ){
-          docSummaries.add(fieldName, altTexts);
-        }
-        else{
-          List<String> altList = new ArrayList<String>();
-          int len = 0;
-          for( String altText: altTexts ){
+        List<String> altList = new ArrayList<String>();
+        int len = 0;
+        for( String altText: altTexts ){
+          if( alternateFieldLen <= 0 ){
+            altList.add(encoder.encodeText(altText));
+          }
+          else{
             altList.add( len + altText.length() > alternateFieldLen ?
-                new String(altText.substring( 0, alternateFieldLen - len )) : altText );
+                encoder.encodeText(new String(altText.substring( 0, alternateFieldLen - len ))) :
+                encoder.encodeText(altText) );
             len += altText.length();
             if( len >= alternateFieldLen ) break;
           }
-          docSummaries.add(fieldName, altList);
         }
+        docSummaries.add(fieldName, altList);
       }
     }
   }

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/request/SimpleFacets.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/request/SimpleFacets.java?rev=1233096&r1=1233095&r2=1233096&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/request/SimpleFacets.java (original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/request/SimpleFacets.java Wed Jan 18 22:28:07 2012
@@ -209,10 +209,8 @@ public class SimpleFacets {
       facetResponse.add("facet_ranges", getFacetRangeCounts());
 
     } catch (IOException e) {
-      SolrException.logOnce(SolrCore.log, "Exception during facet counts", e);
       throw new SolrException(ErrorCode.SERVER_ERROR, e);
     } catch (ParseException e) {
-      SolrException.logOnce(SolrCore.log, "Exception during facet counts", e);
       throw new SolrException(ErrorCode.BAD_REQUEST, e);
     }
     return facetResponse;
@@ -410,7 +408,7 @@ public class SimpleFacets {
     FieldType ft = searcher.getSchema().getFieldType(fieldName);
     NamedList<Integer> res = new NamedList<Integer>();
 
-    FieldCache.DocTermsIndex si = FieldCache.DEFAULT.getTermsIndex(searcher.getIndexReader(), fieldName);
+    FieldCache.DocTermsIndex si = FieldCache.DEFAULT.getTermsIndex(new SlowMultiReaderWrapper(searcher.getIndexReader()), fieldName);
 
     final BytesRef prefixRef;
     if (prefix == null) {