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

svn commit: r1363608 [10/10] - in /lucene/dev/branches/LUCENE-2878: ./ dev-tools/ dev-tools/eclipse/ dev-tools/idea/.idea/copyright/ dev-tools/idea/.idea/libraries/ dev-tools/idea/lucene/ dev-tools/maven/ dev-tools/maven/lucene/benchmark/ dev-tools/mav...

Modified: lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/core/TestPropInject.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/core/TestPropInject.java?rev=1363608&r1=1363607&r2=1363608&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/core/TestPropInject.java (original)
+++ lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/core/TestPropInject.java Fri Jul 20 01:01:39 2012
@@ -24,6 +24,7 @@ import org.apache.lucene.index.IndexWrit
 import org.apache.lucene.index.LogByteSizeMergePolicy;
 import org.apache.solr.update.DirectUpdateHandler2;
 import org.apache.solr.util.AbstractSolrTestCase;
+import org.apache.solr.util.RefCounted;
 
 public class TestPropInject extends AbstractSolrTestCase {
   @Override
@@ -37,14 +38,25 @@ public class TestPropInject extends Abst
   }
 
   public void testMergePolicy() throws Exception {
-    IndexWriter writer = ((DirectUpdateHandler2)h.getCore().getUpdateHandler()).getSolrCoreState().getIndexWriter(h.getCore());
-    LogByteSizeMergePolicy mp = (LogByteSizeMergePolicy)writer.getConfig().getMergePolicy();
+
+    RefCounted<IndexWriter> iw = ((DirectUpdateHandler2)h.getCore().getUpdateHandler()).getSolrCoreState().getIndexWriter(h.getCore());
+    LogByteSizeMergePolicy mp;
+    try {
+     mp = (LogByteSizeMergePolicy)iw.get().getConfig().getMergePolicy();
+    } finally {
+      iw.decref();
+    }
     assertEquals(64.0, mp.getMaxMergeMB(), 0);
   }
   
   public void testProps() throws Exception {
-    IndexWriter writer = ((DirectUpdateHandler2)h.getCore().getUpdateHandler()).getSolrCoreState().getIndexWriter(h.getCore());
-    ConcurrentMergeScheduler cms = (ConcurrentMergeScheduler)writer.getConfig().getMergeScheduler();
+    RefCounted<IndexWriter> iw = ((DirectUpdateHandler2)h.getCore().getUpdateHandler()).getSolrCoreState().getIndexWriter(h.getCore());
+    ConcurrentMergeScheduler cms;
+    try {
+      cms = (ConcurrentMergeScheduler)iw.get().getConfig().getMergeScheduler();
+    } finally {
+      iw.decref();
+    }
     assertEquals(2, cms.getMaxThreadCount());
   }
 }

Modified: lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/core/TestPropInjectDefaults.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/core/TestPropInjectDefaults.java?rev=1363608&r1=1363607&r2=1363608&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/core/TestPropInjectDefaults.java (original)
+++ lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/core/TestPropInjectDefaults.java Fri Jul 20 01:01:39 2012
@@ -22,6 +22,7 @@ import org.apache.lucene.index.IndexWrit
 import org.apache.lucene.index.LogByteSizeMergePolicy;
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.update.DirectUpdateHandler2;
+import org.apache.solr.util.RefCounted;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -33,15 +34,27 @@ public class TestPropInjectDefaults exte
 
   @Test
   public void testMergePolicyDefaults() throws Exception {
-    IndexWriter writer = ((DirectUpdateHandler2)h.getCore().getUpdateHandler()).getSolrCoreState().getIndexWriter(h.getCore());
-    LogByteSizeMergePolicy mp = (LogByteSizeMergePolicy)writer.getConfig().getMergePolicy();
+    RefCounted<IndexWriter> iw = ((DirectUpdateHandler2) h.getCore()
+        .getUpdateHandler()).getSolrCoreState().getIndexWriter(h.getCore());
+    LogByteSizeMergePolicy mp;
+    try {
+      mp = (LogByteSizeMergePolicy) iw.get().getConfig().getMergePolicy();
+    } finally {
+      iw.decref();
+    }
     assertEquals(32.0, mp.getMaxMergeMB(), 0);
   }
   
   @Test
   public void testPropsDefaults() throws Exception {
-    IndexWriter writer = ((DirectUpdateHandler2)h.getCore().getUpdateHandler()).getSolrCoreState().getIndexWriter(h.getCore());
-    ConcurrentMergeScheduler cms = (ConcurrentMergeScheduler)writer.getConfig().getMergeScheduler();
+    RefCounted<IndexWriter> iw = ((DirectUpdateHandler2) h.getCore()
+        .getUpdateHandler()).getSolrCoreState().getIndexWriter(h.getCore());
+    ConcurrentMergeScheduler cms;
+    try {
+      cms = (ConcurrentMergeScheduler) iw.get().getConfig().getMergeScheduler();
+    } finally {
+      iw.decref();
+    }
     assertEquals(4, cms.getMaxThreadCount());
   }
 

Modified: lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/schema/BadIndexSchemaTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/schema/BadIndexSchemaTest.java?rev=1363608&r1=1363607&r2=1363608&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/schema/BadIndexSchemaTest.java (original)
+++ lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/schema/BadIndexSchemaTest.java Fri Jul 20 01:01:39 2012
@@ -17,38 +17,15 @@
 
 package org.apache.solr.schema;
 
-import org.apache.solr.SolrTestCaseJ4;
-import org.apache.solr.common.SolrException;
-import org.apache.solr.common.SolrException.ErrorCode;
-import org.apache.solr.core.SolrConfig;
+import org.apache.solr.core.AbstractBadConfigTestBase;
 
 import java.util.regex.Pattern;
 
-import org.junit.Test;
-
-public class BadIndexSchemaTest extends SolrTestCaseJ4 {
+public class BadIndexSchemaTest extends AbstractBadConfigTestBase {
 
   private void doTest(final String schema, final String errString) 
     throws Exception {
-
-    ignoreException(Pattern.quote(errString));
-    try {
-      initCore( "solrconfig.xml", schema );
-    } catch (Exception e) {
-      // short circuit out if we found what we expected
-      if (-1 != e.getMessage().indexOf(errString)) return;
-      // Test the cause too in case the expected error is wrapped
-      if (null != e.getCause() && 
-          -1 != e.getCause().getMessage().indexOf(errString)) return;
-
-      // otherwise, rethrow it, possibly completley unrelated
-      throw new SolrException
-        (ErrorCode.SERVER_ERROR, 
-         "Unexpected error, expected error matching: " + errString, e);
-    } finally {
-      deleteCore();
-    }
-    fail("Did not encounter any exception from: " + schema);
+    assertConfigs("solrconfig.xml", schema, errString);
   }
 
   public void testSevereErrorsForInvalidFieldOptions() throws Exception {

Modified: lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/schema/CurrencyFieldTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/schema/CurrencyFieldTest.java?rev=1363608&r1=1363607&r2=1363608&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/schema/CurrencyFieldTest.java (original)
+++ lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/schema/CurrencyFieldTest.java Fri Jul 20 01:01:39 2012
@@ -158,7 +158,7 @@ public class CurrencyFieldTest extends S
 
   @Ignore
   public void testPerformance() throws Exception {
-    Random r = new Random();
+    Random r = random();
     int initDocs = 200000;
 
     for (int i = 1; i <= initDocs; i++) {

Modified: lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/schema/PreAnalyzedFieldTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/schema/PreAnalyzedFieldTest.java?rev=1363608&r1=1363607&r2=1363608&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/schema/PreAnalyzedFieldTest.java (original)
+++ lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/schema/PreAnalyzedFieldTest.java Fri Jul 20 01:01:39 2012
@@ -21,13 +21,12 @@ import java.util.Collections;
 import java.util.HashMap;
 
 import org.apache.lucene.document.Field;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.common.util.Base64;
 import org.apache.solr.schema.PreAnalyzedField.PreAnalyzedParser;
 import org.junit.Test;
 
-import junit.framework.TestCase;
-
-public class PreAnalyzedFieldTest extends TestCase {
+public class PreAnalyzedFieldTest extends LuceneTestCase {
   
   private static final String[] valid = {
     "1 one two three",                       // simple parsing
@@ -71,7 +70,8 @@ public class PreAnalyzedFieldTest extend
   int props = 
     FieldProperties.INDEXED | FieldProperties.STORED;
   
-  public void setUp() {
+  public void setUp() throws Exception {
+    super.setUp();
     field = new SchemaField("content", new TextField(), props, null);
   }
   

Modified: lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/search/TestExtendedDismaxParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/search/TestExtendedDismaxParser.java?rev=1363608&r1=1363607&r2=1363608&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/search/TestExtendedDismaxParser.java (original)
+++ lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/search/TestExtendedDismaxParser.java Fri Jul 20 01:01:39 2012
@@ -52,7 +52,7 @@ public class TestExtendedDismaxParser ex
             "text", "line up and fly directly at the enemy death cannons, clogging them with wreckage!"));
     assertU(adoc("id", "48", "text_sw", "this has gigabyte potential", "foo_i","100"));
     assertU(adoc("id", "49", "text_sw", "start the big apple end", "foo_i","-100"));
-    assertU(adoc("id", "50", "text_sw", "start new big city end"));    
+    assertU(adoc("id", "50", "text_sw", "start new big city end"));
     assertU(adoc("id", "51", "store",   "12.34,-56.78"));
     assertU(adoc("id", "52", "text_sw", "tekna theou klethomen"));
     assertU(adoc("id", "53", "text_sw", "nun tekna theou esmen"));
@@ -352,6 +352,7 @@ public class TestExtendedDismaxParser ex
   }
 
   public void testUserFields() {
+    String allr = "*[count(//doc)=10]";
     String oner = "*[count(//doc)=1]";
     String nor = "*[count(//doc)=0]";
     
@@ -365,9 +366,24 @@ public class TestExtendedDismaxParser ex
     assertQ(req("defType","edismax", "q","id:42"),
         oner);
     
-    assertQ(req("defType","edismax", "uf","*", "q","id:42"),
+    // SOLR-3377 - parens should be allowed immediately before field name
+    assertQ(req("defType","edismax", "q","( id:42 )"),
         oner);
-    
+    assertQ(req("defType","edismax", "q","(id:42)"),
+        oner);
+    assertQ(req("defType","edismax", "q","(+id:42)"),
+        oner);
+    assertQ(req("defType","edismax", "q","+(+id:42)"),
+        oner);
+    assertQ(req("defType","edismax", "q","+(+((id:42)))"),
+        oner);
+    assertQ(req("defType","edismax", "q","+(+((+id:42)))"),
+        oner);
+    assertQ(req("defType","edismax", "q"," +( +( ( +id:42) ) ) "),
+        oner);
+    assertQ(req("defType","edismax", "q","(id:(*:*)^200)"),
+        allr);
+
     assertQ(req("defType","edismax", "uf","id", "q","id:42"),
         oner);
     

Modified: lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/update/TestUpdate.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/update/TestUpdate.java?rev=1363608&r1=1363607&r2=1363608&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/update/TestUpdate.java (original)
+++ lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/update/TestUpdate.java Fri Jul 20 01:01:39 2012
@@ -150,14 +150,23 @@ public class TestUpdate extends SolrTest
     version = deleteAndGetVersion("1", null);
     afterUpdate.call();
 
+
     try {
-      // Currently, there is an implicit _version_=1 for updates (doc must exist).  This is subject to change!
-      version2 = addAndGetVersion(sdoc("id","1", "val_is",map("add",-100)), null);
+      // test that updating a non-existing doc fails if we set _version_=1
+      version2 = addAndGetVersion(sdoc("id","1", "val_is",map("add",-101), "_version_","1"), null);
       fail();
     } catch (SolrException se) {
       assertEquals(409, se.code());
     }
 
+
+    // test that by default we can update a non-existing doc
+    version = addAndGetVersion(sdoc("id","1", "val_i",102, "val_is",map("add",-102)), null);
+    afterUpdate.call();
+    assertJQ(req("qt","/get", "id","1", "fl","id,val*")
+        ,"=={'doc':{'id':'1', 'val_i':102, 'val_is':[-102]}}"
+    );
+
     version = addAndGetVersion(sdoc("id","1", "val_i",5), null);
     afterUpdate.call();
 

Modified: lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/update/processor/FieldMutatingUpdateProcessorTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/update/processor/FieldMutatingUpdateProcessorTest.java?rev=1363608&r1=1363607&r2=1363608&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/update/processor/FieldMutatingUpdateProcessorTest.java (original)
+++ lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/update/processor/FieldMutatingUpdateProcessorTest.java Fri Jul 20 01:01:39 2012
@@ -53,7 +53,7 @@ import org.junit.Test;
  * (mainly via TrimFieldUpdateProcessor) and the logic of other various 
  * subclasses.
  */
-public class FieldMutatingUpdateProcessorTest extends SolrTestCaseJ4 {
+public class FieldMutatingUpdateProcessorTest extends UpdateProcessorTestBase {
 
   @BeforeClass
   public static void beforeClass() throws Exception {
@@ -816,64 +816,4 @@ public class FieldMutatingUpdateProcesso
                  3.0F, d.getField("foo_s").getBoost(), 0.0F);
   }
 
-  /** 
-   * Convenience method for building up SolrInputDocuments
-   */
-  SolrInputDocument doc(SolrInputField... fields) {
-    SolrInputDocument d = new SolrInputDocument();
-    for (SolrInputField f : fields) {
-      d.put(f.getName(), f);
-    }
-    return d;
-  }
-
-  /** 
-   * Convenience method for building up SolrInputFields
-   */
-  SolrInputField field(String name, float boost, Object... values) {
-    SolrInputField f = new SolrInputField(name);
-    for (Object v : values) {
-      f.addValue(v, 1.0F);
-    }
-    f.setBoost(boost);
-    return f;
-  }
-
-  /** 
-   * Convenience method for building up SolrInputFields with default boost
-   */
-  SolrInputField f(String name, Object... values) {
-    return field(name, 1.0F, values);
-  }
-
-
-  /**
-   * Runs a document through the specified chain, and returns the final 
-   * document used when the chain is completed (NOTE: some chains may 
-   * modify the document in place
-   */
-  SolrInputDocument processAdd(final String chain, 
-                               final SolrInputDocument docIn) 
-    throws IOException {
-
-    SolrCore core = h.getCore();
-    UpdateRequestProcessorChain pc = core.getUpdateProcessingChain(chain);
-    assertNotNull("No Chain named: " + chain, pc);
-
-    SolrQueryResponse rsp = new SolrQueryResponse();
-
-    SolrQueryRequest req = new LocalSolrQueryRequest
-      (core, new ModifiableSolrParams());
-    try {
-      AddUpdateCommand cmd = new AddUpdateCommand(req);
-      cmd.solrDoc = docIn;
-
-      UpdateRequestProcessor processor = pc.createProcessor(req, rsp);
-      processor.processAdd(cmd);
-
-      return cmd.solrDoc;
-    } finally {
-      req.close();
-    }
-  }
 }

Modified: lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/util/CircularListTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/util/CircularListTest.java?rev=1363608&r1=1363607&r2=1363608&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/util/CircularListTest.java (original)
+++ lucene/dev/branches/LUCENE-2878/solr/core/src/test/org/apache/solr/util/CircularListTest.java Fri Jul 20 01:01:39 2012
@@ -19,15 +19,14 @@ package org.apache.solr.util;
 
 import java.io.IOException;
 
-import junit.framework.TestCase;
-
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.logging.CircularList;
 import org.junit.Test;
 
 /** 
  * Test circular list
  */
-public class CircularListTest  extends TestCase {  
+public class CircularListTest  extends LuceneTestCase {  
 
   @Test
   public void testCircularList() throws IOException {

Modified: lucene/dev/branches/LUCENE-2878/solr/example/README.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/example/README.txt?rev=1363608&r1=1363607&r2=1363608&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/example/README.txt (original)
+++ lucene/dev/branches/LUCENE-2878/solr/example/README.txt Fri Jul 20 01:01:39 2012
@@ -43,6 +43,8 @@ UIMA, the clustering component, or other
 you will need to copy the required jars into solr/lib or update the paths to
 the jars in your solrconfig.xml.
 
+-SolrHome
+
 By default, start.jar starts Solr in Jetty using the default solr home
 directory of "./solr/" -- To run other example configurations, you can
 speciy the solr.solr.home system property when starting jetty...
@@ -50,3 +52,15 @@ speciy the solr.solr.home system propert
   java -Dsolr.solr.home=multicore -jar start.jar
   java -Dsolr.solr.home=example-DIH -jar start.jar
 
+-Logging
+
+By default, Solr will log to the console. This can be convenient when first
+getting started, but eventually you will want to log to a file. To enable
+logging, you can just pass a system property to Jetty on startup:
+
+  java -Djava.util.logging.config.file=etc/logging.properties -jar start.jar
+ 
+ This will use Java Util Logging to log to a file based on the config in
+ etc/logging.properties. Logs will be written in the logs directory. It is
+ also possible to setup log4j or other popular logging frameworks.
+

Modified: lucene/dev/branches/LUCENE-2878/solr/example/etc/jetty.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/example/etc/jetty.xml?rev=1363608&r1=1363607&r2=1363608&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/example/etc/jetty.xml (original)
+++ lucene/dev/branches/LUCENE-2878/solr/example/etc/jetty.xml Fri Jul 20 01:01:39 2012
@@ -87,6 +87,32 @@
       </New>
     </Set>
     
+    <!-- =========================================================== -->
+    <!-- Configure Request Log                                       -->
+    <!-- =========================================================== -->
+    <!-- 
+    <Ref id="Handlers">
+      <Call name="addHandler">
+        <Arg>
+          <New id="RequestLog" class="org.eclipse.jetty.server.handler.RequestLogHandler">
+            <Set name="requestLog">
+              <New id="RequestLogImpl" class="org.eclipse.jetty.server.NCSARequestLog">
+                <Set name="filename">
+                   logs/request.yyyy_mm_dd.log
+                </Set>
+                <Set name="filenameDateFormat">yyyy_mm_dd</Set>
+                <Set name="retainDays">90</Set>
+                <Set name="append">true</Set>
+                <Set name="extended">false</Set>
+                <Set name="logCookies">false</Set>
+                <Set name="LogTimeZone">UTC</Set>
+              </New>
+            </Set>
+          </New>
+        </Arg>
+      </Call>
+    </Ref>
+    -->
 
     <!-- =========================================================== -->
     <!-- extra options                                               -->
@@ -134,17 +160,14 @@
     </Call>
     
     <Ref id="DeploymentManager">
-          <Call id="webappprovider" name="addAppProvider">
-            <Arg>
-              <New class="org.eclipse.jetty.deploy.providers.WebAppProvider">
-                <Set name="monitoredDirName"><Property name="jetty.home" default="." />/webapps</Set>
-                <Set name="defaultsDescriptor"><Property name="jetty.home" default="."/>/etc/webdefault.xml</Set>
-                <Set name="scanInterval">0</Set>
-                <Set name="contextXmlDir"><Property name="jetty.home" default="." />/contexts</Set>
-		<Set name="extractWars">true</Set>
-              </New>
-            </Arg>
-          </Call>
+      <Call name="addAppProvider">
+        <Arg>
+          <New class="org.eclipse.jetty.deploy.providers.ContextProvider">
+            <Set name="monitoredDirName"><SystemProperty name="jetty.home" default="."/>/contexts</Set>
+            <Set name="scanInterval">0</Set>
+          </New>
+        </Arg>
+      </Call>
     </Ref>
 
 </Configure>

Modified: lucene/dev/branches/LUCENE-2878/solr/example/solr/collection1/conf/schema.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/example/solr/collection1/conf/schema.xml?rev=1363608&r1=1363607&r2=1363608&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/example/solr/collection1/conf/schema.xml (original)
+++ lucene/dev/branches/LUCENE-2878/solr/example/solr/collection1/conf/schema.xml Fri Jul 20 01:01:39 2012
@@ -923,6 +923,8 @@
 
            See lang/userdict_ja.txt for a sample user dictionary file.
 
+           Punctuation characters are discarded by default.  Use discardPunctuation="false" to keep them.
+
            See http://wiki.apache.org/solr/JapaneseLanguageSupport for more on Japanese language support.
         -->
         <tokenizer class="solr.JapaneseTokenizerFactory" mode="search"/>

Modified: lucene/dev/branches/LUCENE-2878/solr/example/solr/collection1/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/example/solr/collection1/conf/solrconfig.xml?rev=1363608&r1=1363607&r2=1363608&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/example/solr/collection1/conf/solrconfig.xml (original)
+++ lucene/dev/branches/LUCENE-2878/solr/example/solr/collection1/conf/solrconfig.xml Fri Jul 20 01:01:39 2012
@@ -64,17 +64,17 @@
        files in that directory which completely match the regex
        (anchored on both ends) will be included.
     -->
-  <lib dir="../../dist/" regex="apache-solr-cell-\d.*\.jar" />
-  <lib dir="../../contrib/extraction/lib" regex=".*\.jar" />
+  <lib dir="../../../dist/" regex="apache-solr-cell-\d.*\.jar" />
+  <lib dir="../../../contrib/extraction/lib" regex=".*\.jar" />
 
-  <lib dir="../../dist/" regex="apache-solr-clustering-\d.*\.jar" />
-  <lib dir="../../contrib/clustering/lib/" regex=".*\.jar" />
+  <lib dir="../../../dist/" regex="apache-solr-clustering-\d.*\.jar" />
+  <lib dir="../../../contrib/clustering/lib/" regex=".*\.jar" />
 
-  <lib dir="../../dist/" regex="apache-solr-langid-\d.*\.jar" />
-  <lib dir="../../contrib/langid/lib/" regex=".*\.jar" />
+  <lib dir="../../../dist/" regex="apache-solr-langid-\d.*\.jar" />
+  <lib dir="../../../contrib/langid/lib/" regex=".*\.jar" />
 
-  <lib dir="../../dist/" regex="apache-solr-velocity-\d.*\.jar" />
-  <lib dir="../../contrib/velocity/lib" regex=".*\.jar" />
+  <lib dir="../../../dist/" regex="apache-solr-velocity-\d.*\.jar" />
+  <lib dir="../../../contrib/velocity/lib" regex=".*\.jar" />
 
   <!-- If a 'dir' option (with or without a regex) is used and nothing
        is found that matches, it will be ignored

Modified: lucene/dev/branches/LUCENE-2878/solr/example/solr/solr.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/example/solr/solr.xml?rev=1363608&r1=1363607&r2=1363608&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/example/solr/solr.xml (original)
+++ lucene/dev/branches/LUCENE-2878/solr/example/solr/solr.xml Fri Jul 20 01:01:39 2012
@@ -47,7 +47,7 @@
   All of the attributes in cores after defaultCoreName only apply when running in SolrCloud mode.
   You can read more about SolrCloud mode at http://wiki.apache.org/solr/SolrCloud
   -->
-  <cores adminPath="/admin/cores" defaultCoreName="collection1" host="${host:}" hostPort="${jetty.port:}" zkClientTimeout="${zkClientTimeout:10000}">
+  <cores adminPath="/admin/cores" defaultCoreName="collection1" host="${host:}" hostPort="${jetty.port:}" zkClientTimeout="${zkClientTimeout:15000}">
     <core name="collection1" instanceDir="collection1" />
   </cores>
 </solr>

Modified: lucene/dev/branches/LUCENE-2878/solr/solrj/ivy.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/solrj/ivy.xml?rev=1363608&r1=1363607&r2=1363608&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/solrj/ivy.xml (original)
+++ lucene/dev/branches/LUCENE-2878/solr/solrj/ivy.xml Fri Jul 20 01:01:39 2012
@@ -20,7 +20,7 @@
     <info organisation="org.apache.solr" module="solrj"/>
 
     <dependencies>
-      <dependency org="org.apache.zookeeper" name="zookeeper" rev="3.3.4" transitive="false"/>
+      <dependency org="org.apache.zookeeper" name="zookeeper" rev="3.3.5" transitive="false"/>
       <dependency org="org.slf4j" name="log4j-over-slf4j" rev="1.6.4" transitive="false"/>
       <dependency org="org.apache.httpcomponents" name="httpcore" rev="4.1.4" transitive="false"/>
       <dependency org="org.apache.httpcomponents" name="httpclient" rev="4.1.3" transitive="false"/>

Modified: lucene/dev/branches/LUCENE-2878/solr/solrj/src/java/org/apache/solr/common/SolrInputDocument.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/solrj/src/java/org/apache/solr/common/SolrInputDocument.java?rev=1363608&r1=1363607&r2=1363608&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/solrj/src/java/org/apache/solr/common/SolrInputDocument.java (original)
+++ lucene/dev/branches/LUCENE-2878/solr/solrj/src/java/org/apache/solr/common/SolrInputDocument.java Fri Jul 20 01:01:39 2012
@@ -18,10 +18,10 @@
 package org.apache.solr.common;
 
 import java.io.Serializable;
+import java.util.Collection;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.Map;
-import java.util.Collection;
 import java.util.Set;
 
 /**
@@ -182,6 +182,15 @@ public class SolrInputDocument implement
     return "SolrInputDocument" + _fields.values();
   }
   
+  public SolrInputDocument deepCopy() {
+    SolrInputDocument clone = new SolrInputDocument();
+    Set<Entry<String,SolrInputField>> entries = _fields.entrySet();
+    for (Map.Entry<String,SolrInputField> fieldEntry : entries) {
+      clone._fields.put(fieldEntry.getKey(), fieldEntry.getValue().deepCopy());
+    }
+    clone._documentBoost = _documentBoost;
+    return clone;
+  }
 
   //---------------------------------------------------
   // MAP interface

Modified: lucene/dev/branches/LUCENE-2878/solr/solrj/src/java/org/apache/solr/common/SolrInputField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/solrj/src/java/org/apache/solr/common/SolrInputField.java?rev=1363608&r1=1363607&r2=1363608&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/solrj/src/java/org/apache/solr/common/SolrInputField.java (original)
+++ lucene/dev/branches/LUCENE-2878/solr/solrj/src/java/org/apache/solr/common/SolrInputField.java Fri Jul 20 01:01:39 2012
@@ -199,4 +199,19 @@ public class SolrInputField implements I
   {
     return name + ((boost == 1.0) ? "=" : ("("+boost+")=")) + value;
   }
+
+  public SolrInputField deepCopy() {
+    SolrInputField clone = new SolrInputField(name);
+    clone.boost = boost;
+    // We can't clone here, so we rely on simple primitives
+    if (value instanceof Collection) {
+      Collection<Object> values = (Collection<Object>) value;
+      Collection<Object> cloneValues = new ArrayList<Object>(values.size());
+      cloneValues.addAll(values);
+      clone.value = cloneValues;
+    } else {
+      clone.value = value;
+    }
+    return clone;
+  }
 }

Modified: lucene/dev/branches/LUCENE-2878/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java?rev=1363608&r1=1363607&r2=1363608&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java (original)
+++ lucene/dev/branches/LUCENE-2878/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java Fri Jul 20 01:01:39 2012
@@ -689,10 +689,16 @@ public class SolrZkClient {
       return;
     }
     for (String string : children) {
-      clean(path + "/" + string);
+      if (path.equals("/")) {
+        clean(path + string);
+      } else {
+        clean(path + "/" + string);
+      }
     }
     try {
-      delete(path, -1, true);
+      if (!path.equals("/")) {
+        delete(path, -1, true);
+      }
     } catch (NoNodeException r) {
       return;
     }

Modified: lucene/dev/branches/LUCENE-2878/solr/solrj/src/java/org/apache/solr/common/params/CollectionParams.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/solrj/src/java/org/apache/solr/common/params/CollectionParams.java?rev=1363608&r1=1363607&r2=1363608&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/solrj/src/java/org/apache/solr/common/params/CollectionParams.java (original)
+++ lucene/dev/branches/LUCENE-2878/solr/solrj/src/java/org/apache/solr/common/params/CollectionParams.java Fri Jul 20 01:01:39 2012
@@ -28,7 +28,7 @@ public interface CollectionParams 
 
 
   public enum CollectionAction {
-    CREATE, DELETE;
+    CREATE, DELETE, RELOAD;
     
     public static CollectionAction get( String p )
     {

Modified: lucene/dev/branches/LUCENE-2878/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java?rev=1363608&r1=1363607&r2=1363608&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java (original)
+++ lucene/dev/branches/LUCENE-2878/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java Fri Jul 20 01:01:39 2012
@@ -458,11 +458,11 @@ public abstract class BaseDistributedSea
         break;
       }
 
-      String namea, nameb;
-      Object vala, valb = null;
+      String namea = null, nameb = null;
+      Object vala = null, valb = null;
 
-      int flagsa, flagsb;
-      for (; ;) {
+      int flagsa = 0, flagsb = 0;
+      while (posa < a.size()) {
         namea = a.getName(posa);
         vala = a.getVal(posa);
         posa++;

Modified: lucene/dev/branches/LUCENE-2878/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java?rev=1363608&r1=1363607&r2=1363608&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java (original)
+++ lucene/dev/branches/LUCENE-2878/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java Fri Jul 20 01:01:39 2012
@@ -82,7 +82,6 @@ public abstract class SolrTestCaseJ4 ext
     endTrackingSearchers();
     endTrackingZkClients();
     resetFactory();
-    resetFactory();
   }
 
   private static boolean changedFactory = false;

Modified: lucene/dev/branches/LUCENE-2878/solr/test-framework/src/java/org/apache/solr/analysis/MockCharFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/test-framework/src/java/org/apache/solr/analysis/MockCharFilterFactory.java?rev=1363608&r1=1363607&r2=1363608&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/test-framework/src/java/org/apache/solr/analysis/MockCharFilterFactory.java (original)
+++ lucene/dev/branches/LUCENE-2878/solr/test-framework/src/java/org/apache/solr/analysis/MockCharFilterFactory.java Fri Jul 20 01:01:39 2012
@@ -17,9 +17,10 @@ package org.apache.solr.analysis;
  * limitations under the License.
  */
 
+import java.io.Reader;
 import java.util.Map;
 
-import org.apache.lucene.analysis.CharStream;
+import org.apache.lucene.analysis.CharFilter;
 import org.apache.lucene.analysis.MockCharFilter;
 import org.apache.lucene.analysis.util.CharFilterFactory;
 
@@ -40,7 +41,7 @@ public class MockCharFilterFactory exten
   }
 
   @Override
-  public CharStream create(CharStream input) {
+  public CharFilter create(Reader input) {
     return new MockCharFilter(input, remainder);
   }
 }