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 2011/01/05 21:25:44 UTC

svn commit: r1055622 [8/14] - in /lucene/dev/branches/docvalues: ./ dev-tools/ dev-tools/eclipse/ dev-tools/idea/ dev-tools/idea/.idea/ dev-tools/idea/.idea/libraries/ dev-tools/idea/lucene/ dev-tools/idea/lucene/contrib/ dev-tools/idea/lucene/contrib/...

Modified: lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/core/StopAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/core/StopAnalyzer.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/core/StopAnalyzer.java (original)
+++ lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/core/StopAnalyzer.java Wed Jan  5 20:25:17 2011
@@ -26,10 +26,8 @@ import java.util.List;
 
 import org.apache.lucene.analysis.Tokenizer;
 import org.apache.lucene.analysis.util.CharArraySet;
-import org.apache.lucene.analysis.util.ReusableAnalyzerBase;
 import org.apache.lucene.analysis.util.StopwordAnalyzerBase;
 import org.apache.lucene.analysis.util.WordlistLoader;
-import org.apache.lucene.analysis.util.ReusableAnalyzerBase.TokenStreamComponents;
 import org.apache.lucene.util.Version;
 
 /** Filters {@link LetterTokenizer} with {@link LowerCaseFilter} and {@link StopFilter}.

Modified: lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/cz/CzechAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/cz/CzechAnalyzer.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/cz/CzechAnalyzer.java (original)
+++ lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/cz/CzechAnalyzer.java Wed Jan  5 20:25:17 2011
@@ -32,8 +32,6 @@ import org.apache.lucene.analysis.util.W
 import org.apache.lucene.util.Version;
 
 import java.io.*;
-import java.util.Collections;
-import java.util.HashSet;
 import java.util.Set;
 
 /**

Modified: lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/fr/FrenchAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/fr/FrenchAnalyzer.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/fr/FrenchAnalyzer.java (original)
+++ lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/fr/FrenchAnalyzer.java Wed Jan  5 20:25:17 2011
@@ -32,13 +32,9 @@ import org.apache.lucene.analysis.util.S
 import org.apache.lucene.analysis.util.WordlistLoader;
 import org.apache.lucene.util.Version;
 
-import java.io.File;
 import java.io.IOException;
 import java.io.Reader;
 import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Collections;
-import java.util.Map;
 import java.util.Set;
 
 /**

Modified: lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/fr/FrenchStemFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/fr/FrenchStemFilter.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/fr/FrenchStemFilter.java (original)
+++ lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/fr/FrenchStemFilter.java Wed Jan  5 20:25:17 2011
@@ -25,9 +25,6 @@ import org.apache.lucene.analysis.tokena
 import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
 
 import java.io.IOException;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
 
 /**
  * A {@link TokenFilter} that stems french words. 

Modified: lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/nl/DutchAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/nl/DutchAnalyzer.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/nl/DutchAnalyzer.java (original)
+++ lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/nl/DutchAnalyzer.java Wed Jan  5 20:25:17 2011
@@ -38,7 +38,6 @@ import java.io.IOException;
 import java.io.Reader;
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.Set;
 import java.util.Map;
 

Modified: lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/standard/ClassicTokenizerImpl.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/standard/ClassicTokenizerImpl.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/standard/ClassicTokenizerImpl.java (original)
+++ lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/standard/ClassicTokenizerImpl.java Wed Jan  5 20:25:17 2011
@@ -26,7 +26,6 @@ WARNING: if you change ClassicTokenizerI
 
 */
 
-import java.io.Reader;
 import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
 
 

Modified: lucene/dev/branches/docvalues/modules/analysis/common/src/test/org/apache/lucene/analysis/commongrams/CommonGramsFilterTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/modules/analysis/common/src/test/org/apache/lucene/analysis/commongrams/CommonGramsFilterTest.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/modules/analysis/common/src/test/org/apache/lucene/analysis/commongrams/CommonGramsFilterTest.java (original)
+++ lucene/dev/branches/docvalues/modules/analysis/common/src/test/org/apache/lucene/analysis/commongrams/CommonGramsFilterTest.java Wed Jan  5 20:25:17 2011
@@ -19,8 +19,6 @@ package org.apache.lucene.analysis.commo
 import java.io.Reader;
 import java.io.StringReader;
 import java.util.Arrays;
-import java.util.Set;
-
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.BaseTokenStreamTestCase;
 import org.apache.lucene.analysis.TokenFilter;

Modified: lucene/dev/branches/docvalues/modules/analysis/common/src/test/org/apache/lucene/analysis/compound/TestCompoundWordTokenFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/modules/analysis/common/src/test/org/apache/lucene/analysis/compound/TestCompoundWordTokenFilter.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/modules/analysis/common/src/test/org/apache/lucene/analysis/compound/TestCompoundWordTokenFilter.java (original)
+++ lucene/dev/branches/docvalues/modules/analysis/common/src/test/org/apache/lucene/analysis/compound/TestCompoundWordTokenFilter.java Wed Jan  5 20:25:17 2011
@@ -17,7 +17,6 @@ package org.apache.lucene.analysis.compo
  * limitations under the License.
  */
 
-import java.io.Reader;
 import java.io.StringReader;
 import org.xml.sax.InputSource;
 

Modified: lucene/dev/branches/docvalues/modules/analysis/common/src/test/org/apache/lucene/analysis/cz/TestCzechAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/modules/analysis/common/src/test/org/apache/lucene/analysis/cz/TestCzechAnalyzer.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/modules/analysis/common/src/test/org/apache/lucene/analysis/cz/TestCzechAnalyzer.java (original)
+++ lucene/dev/branches/docvalues/modules/analysis/common/src/test/org/apache/lucene/analysis/cz/TestCzechAnalyzer.java Wed Jan  5 20:25:17 2011
@@ -17,11 +17,7 @@ package org.apache.lucene.analysis.cz;
  * limitations under the License.
  */
 
-import java.io.File;
-import java.io.FileInputStream;
 import java.io.IOException;
-import java.io.InputStream;
-
 import org.apache.lucene.analysis.BaseTokenStreamTestCase;
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.util.CharArraySet;

Modified: lucene/dev/branches/docvalues/modules/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenCountAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/modules/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenCountAnalyzer.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/modules/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenCountAnalyzer.java (original)
+++ lucene/dev/branches/docvalues/modules/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestLimitTokenCountAnalyzer.java Wed Jan  5 20:25:17 2011
@@ -24,7 +24,6 @@ import org.apache.lucene.analysis.Analyz
 import org.apache.lucene.analysis.BaseTokenStreamTestCase;
 import org.apache.lucene.analysis.core.WhitespaceAnalyzer;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
-import org.apache.lucene.util.Version;
 
 public class TestLimitTokenCountAnalyzer extends BaseTokenStreamTestCase {
 

Modified: lucene/dev/branches/docvalues/modules/analysis/common/src/test/org/apache/lucene/collation/CollationTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/modules/analysis/common/src/test/org/apache/lucene/collation/CollationTestBase.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/modules/analysis/common/src/test/org/apache/lucene/collation/CollationTestBase.java (original)
+++ lucene/dev/branches/docvalues/modules/analysis/common/src/test/org/apache/lucene/collation/CollationTestBase.java Wed Jan  5 20:25:17 2011
@@ -26,13 +26,12 @@ import org.apache.lucene.index.IndexWrit
 import org.apache.lucene.index.IndexWriterConfig;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.ScoreDoc;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.TermRangeFilter;
 import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.search.TermRangeQuery;
-import org.apache.lucene.search.Searcher;
+import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.Sort;
 import org.apache.lucene.search.SortField;
 import org.apache.lucene.document.Field;
@@ -215,7 +214,7 @@ public abstract class CollationTestBase 
     }
     writer.optimize();
     writer.close();
-    Searcher searcher = new IndexSearcher(indexStore, true);
+    IndexSearcher searcher = new IndexSearcher(indexStore, true);
 
     Sort sort = new Sort();
     Query queryX = new TermQuery(new Term ("contents", "x"));
@@ -236,7 +235,7 @@ public abstract class CollationTestBase 
     
   // Make sure the documents returned by the search match the expected list
   // Copied from TestSort.java
-  private void assertMatches(Searcher searcher, Query query, Sort sort, 
+  private void assertMatches(IndexSearcher searcher, Query query, Sort sort, 
                              String expectedResult) throws IOException {
     ScoreDoc[] result = searcher.search(query, null, 1000, sort).scoreDocs;
     StringBuilder buff = new StringBuilder(10);

Modified: lucene/dev/branches/docvalues/modules/analysis/smartcn/src/test/org/apache/lucene/analysis/cn/smart/TestSmartChineseAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/modules/analysis/smartcn/src/test/org/apache/lucene/analysis/cn/smart/TestSmartChineseAnalyzer.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/modules/analysis/smartcn/src/test/org/apache/lucene/analysis/cn/smart/TestSmartChineseAnalyzer.java (original)
+++ lucene/dev/branches/docvalues/modules/analysis/smartcn/src/test/org/apache/lucene/analysis/cn/smart/TestSmartChineseAnalyzer.java Wed Jan  5 20:25:17 2011
@@ -17,15 +17,8 @@
 
 package org.apache.lucene.analysis.cn.smart;
 
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.Reader;
-import java.io.UnsupportedEncodingException;
-import java.util.Date;
-
 import org.apache.lucene.analysis.BaseTokenStreamTestCase;
 import org.apache.lucene.analysis.Analyzer;
-import org.apache.lucene.analysis.TokenStream;
 import org.apache.lucene.util.Version;
 
 public class TestSmartChineseAnalyzer extends BaseTokenStreamTestCase {

Modified: lucene/dev/branches/docvalues/modules/analysis/stempel/src/java/org/apache/lucene/analysis/pl/PolishAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/modules/analysis/stempel/src/java/org/apache/lucene/analysis/pl/PolishAnalyzer.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/modules/analysis/stempel/src/java/org/apache/lucene/analysis/pl/PolishAnalyzer.java (original)
+++ lucene/dev/branches/docvalues/modules/analysis/stempel/src/java/org/apache/lucene/analysis/pl/PolishAnalyzer.java Wed Jan  5 20:25:17 2011
@@ -18,7 +18,6 @@ package org.apache.lucene.analysis.pl;
  */
 
 import java.io.IOException;
-import java.io.InputStream;
 import java.io.Reader;
 import java.util.Set;
 

Modified: lucene/dev/branches/docvalues/modules/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/modules/build.xml?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/modules/build.xml (original)
+++ lucene/dev/branches/docvalues/modules/build.xml Wed Jan  5 20:25:17 2011
@@ -22,6 +22,7 @@
     <sequential>
       <subant target="test" inheritall="false" failonerror="true">
         <fileset dir="analysis" includes="build.xml" />
+        <fileset dir="benchmark" includes="build.xml" />
       </subant>
     </sequential>
   </target>
@@ -30,6 +31,7 @@
     <sequential>
       <subant target="compile" inheritall="false" failonerror="true">
         <fileset dir="analysis" includes="build.xml" />
+        <fileset dir="benchmark" includes="build.xml" />
       </subant>
     </sequential>
   </target>
@@ -38,6 +40,7 @@
     <sequential>
       <subant target="compile-test" inheritall="false" failonerror="true">
         <fileset dir="analysis" includes="build.xml" />
+        <fileset dir="benchmark" includes="build.xml" />
       </subant>
     </sequential>
   </target>
@@ -46,6 +49,7 @@
     <sequential>
       <subant target="javadocs" inheritall="false" failonerror="true">
         <fileset dir="analysis" includes="build.xml" />
+        <fileset dir="benchmark" includes="build.xml" />
       </subant>
     </sequential>
   </target>
@@ -54,6 +58,7 @@
     <sequential>
       <subant target="dist-maven" inheritall="false" failonerror="true">
         <fileset dir="analysis" includes="build.xml" />
+        <fileset dir="benchmark" includes="build.xml" />
       </subant>
     </sequential>
   </target>
@@ -62,6 +67,7 @@
     <sequential>
       <subant target="clean" inheritall="false" failonerror="true">
         <fileset dir="analysis" includes="build.xml" />
+        <fileset dir="benchmark" includes="build.xml" />
       </subant>
     </sequential>
   </target>

Modified: lucene/dev/branches/docvalues/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/CHANGES.txt?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/CHANGES.txt (original)
+++ lucene/dev/branches/docvalues/solr/CHANGES.txt Wed Jan  5 20:25:17 2011
@@ -572,6 +572,13 @@ Bug Fixes
 
 * SOLR-2285: duplicate SolrEventListeners no longer created (hossman)
 
+* SOLR-1993: fix String cast assumption in JavaBinCodec - specific
+  addresses "commitWithin" option on Update requests.
+  (noble, hossman, and Maxim Valyanskiy)
+
+* SOLR-2275: fix DisMax 'mm' parsing to be tolerant of whitespace
+  (Erick Erickson via hossman)
+
 Other Changes
 ----------------------
 
@@ -676,6 +683,8 @@ Other Changes
   
 * SOLR-2213: Upgrade to jQuery 1.4.3 (Erick Erickson via ryan)
 
+* SOLR-2289: Tweak spatial coords for example docs so they are a bit
+  more spread out (Erick Erickson via hossman)
 
 Build
 ----------------------
@@ -698,6 +707,9 @@ Documentation
 * SOLR-1792: Documented peculiar behavior of TestHarness.LocalRequestFactory
   (hossman)
 
+* SOLR-2232: Improved README info on solr.solr.home in examples
+  (Eric Pugh and hossman)
+
 ================== Release 1.4.0 ==================
 Release Date:  See http://lucene.apache.org/solr for the official release date.
 

Modified: lucene/dev/branches/docvalues/solr/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/build.xml?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/build.xml (original)
+++ lucene/dev/branches/docvalues/solr/build.xml Wed Jan  5 20:25:17 2011
@@ -361,6 +361,10 @@
        classpathref="test.compile.classpath">
       <src path="${src}/test" />
     </solr-javac>
+    <!-- Copy any data files present to the classpath -->
+    <copy todir="${dest}/tests">
+      <fileset dir="${src}/test-files" excludes="**/*.java"/>
+    </copy>
   </target>
 
   <!-- Run core unit tests. -->
@@ -421,7 +425,7 @@
            maxmemory="512M"
            errorProperty="tests.failed"
            failureProperty="tests.failed"
-           dir="src/test/test-files/"
+           dir="@{tempDir}/@{threadNum}"
            tempdir="@{tempDir}/@{threadNum}"
            forkmode="perBatch"
            >
@@ -730,7 +734,7 @@
         excludes="lib/README.committers.txt **/data/ **/logs/* **/classes/ **/*.sh **/bin/ src/scripts/ src/site/build/ **/target/ client/ruby/flare/ client/python contrib/**/build/ **/*.iml **/*.ipr **/*.iws contrib/clustering/example/lib/** contrib/clustering/lib/downloads/** contrib/analysis-extras/lib/**" />
       <tarfileset dir="."
         prefix="${fullnamever}"
-        includes="src/test/test-files/solr/lib/classes/empty-file-main-lib.txt" />
+        includes="src/test-files/solr/lib/classes/empty-file-main-lib.txt" />
       <tarfileset dir="."
         mode="755"
         prefix="${fullnamever}"

Modified: lucene/dev/branches/docvalues/solr/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/common-build.xml?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/common-build.xml (original)
+++ lucene/dev/branches/docvalues/solr/common-build.xml Wed Jan  5 20:25:17 2011
@@ -81,6 +81,10 @@
   <!-- Java Version we are compatible with -->
   <property name="java.compat.version" value="1.6" />
 
+  <!-- clover wants to run with -lib, otherwise we prefer a repeatable
+       classpath -->
+  <property name="javac.includeAntRuntime" value="${run.clover}"/>
+
   <!-- Solr Implementation Version -->
   <!--
        This can be any string value that does not include spaces
@@ -263,10 +267,10 @@
              source="${java.compat.version}"
              debug="on"
              encoding="utf8"
+             includeAntRuntime="${javac.includeAntRuntime}"
              sourcepath=""
              classpathref="@{classpathref}">
          <nested />
-      	<compilerarg line="-Xlint -Xlint:-deprecation -Xlint:-serial"/>
       </javac>
     </sequential>
   </macrodef>

Modified: lucene/dev/branches/docvalues/solr/contrib/analysis-extras/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/analysis-extras/build.xml?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/analysis-extras/build.xml (original)
+++ lucene/dev/branches/docvalues/solr/contrib/analysis-extras/build.xml Wed Jan  5 20:25:17 2011
@@ -118,6 +118,10 @@
                 classpathref="test.classpath">
       <src path="src/test"/>
     </solr-javac>
+    <!-- Copy any data files present to the classpath -->
+    <copy todir="${dest}/test-classes">
+      <fileset dir="src/test-files" excludes="**/*.java"/>
+    </copy>
   </target>
 
   <target name="example" depends="build,dist">
@@ -136,7 +140,7 @@
            maxmemory="512M"
            errorProperty="tests.failed"
            failureProperty="tests.failed"
-           dir="src/test/test-files/"
+           dir="${junit.output.dir}"
            tempdir="${junit.output.dir}"
            forkmode="perBatch"
             >

Modified: lucene/dev/branches/docvalues/solr/contrib/clustering/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/clustering/CHANGES.txt?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/clustering/CHANGES.txt (original)
+++ lucene/dev/branches/docvalues/solr/contrib/clustering/CHANGES.txt Wed Jan  5 20:25:17 2011
@@ -6,7 +6,7 @@ See http://wiki.apache.org/solr/Clusteri
 
 CHANGES
 
-$Id:$
+$Id$
 
 ================== Release XXXX ==================
 
@@ -17,6 +17,9 @@ $Id:$
 * SOLR-1804: Re-enabled clustering on trunk, updated to latest version of Carrot2.  No more LGPL run-time dependencies.
   This release of C2 also does not have a specific Lucene dependency.  (Stanislaw Osinski, gsingers)
 
+* SOLR-2282: Add distributed search support for search result clustering.
+  (Brad Giaccio, koji)
+
 ================== Release 1.4.0 ==================
 
 Solr Clustering will be released for the first time in Solr 1.4.  See http://wiki.apache.org/solr/ClusteringComponent

Modified: lucene/dev/branches/docvalues/solr/contrib/clustering/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/clustering/build.xml?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/clustering/build.xml (original)
+++ lucene/dev/branches/docvalues/solr/contrib/clustering/build.xml Wed Jan  5 20:25:17 2011
@@ -44,6 +44,10 @@
     <pathelement location="${common-solr.dir}/build/tests"/> <!-- include solr test code -->
     <pathelement location="${common-solr.dir}/../lucene/build/classes/test" />  <!-- include some lucene test code -->
     <path refid="common.classpath"/>
+    <!-- DistributedClusteringComponentTest uses Jetty -->
+    <fileset dir="${solr-path}/example/lib">
+      <include name="**/*.jar" />
+    </fileset>
   </path>
 
   <target name="clean">
@@ -86,6 +90,10 @@
                 classpathref="test.classpath">
       <src path="src/test/java"/>
     </solr-javac>
+    <!-- Copy any data files present to the classpath -->
+    <copy todir="${dest}/test-classes">
+      <fileset dir="src/test/resources" excludes="**/*.java"/>
+    </copy>
   </target>
 
   <target name="example" depends="build,dist">
@@ -104,7 +112,7 @@
            maxmemory="512M"
            errorProperty="tests.failed"
            failureProperty="tests.failed"
-           dir="src/test/resources/"
+           dir="${junit.output.dir}"
            tempdir="${junit.output.dir}"
            forkmode="perBatch"
             >

Modified: lucene/dev/branches/docvalues/solr/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/ClusteringComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/ClusteringComponent.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/ClusteringComponent.java (original)
+++ lucene/dev/branches/docvalues/solr/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/ClusteringComponent.java Wed Jan  5 20:25:17 2011
@@ -16,6 +16,9 @@ package org.apache.solr.handler.clusteri
  * limitations under the License.
  */
 
+import org.apache.solr.common.SolrDocument;
+import org.apache.solr.common.SolrDocumentList;
+import org.apache.solr.common.params.CommonParams;
 import org.apache.solr.common.params.SolrParams;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.core.SolrCore;
@@ -23,6 +26,7 @@ import org.apache.solr.core.SolrResource
 import org.apache.solr.handler.clustering.carrot2.CarrotClusteringEngine;
 import org.apache.solr.handler.component.ResponseBuilder;
 import org.apache.solr.handler.component.SearchComponent;
+import org.apache.solr.handler.component.ShardRequest;
 import org.apache.solr.search.DocListAndSet;
 import org.apache.solr.util.plugin.SolrCoreAware;
 import org.slf4j.Logger;
@@ -31,7 +35,9 @@ import org.slf4j.LoggerFactory;
 import java.io.IOException;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Map;
+import java.util.Set;
 
 
 /**
@@ -53,7 +59,7 @@ public class ClusteringComponent extends
   public static final String COMPONENT_NAME = "clustering";
   private NamedList initParams;
 
-
+  @Override
   public void prepare(ResponseBuilder rb) throws IOException {
     SolrParams params = rb.req.getParams();
     if (!params.getBool(COMPONENT_NAME, false)) {
@@ -61,18 +67,21 @@ public class ClusteringComponent extends
     }
   }
 
+  @Override
   public void process(ResponseBuilder rb) throws IOException {
     SolrParams params = rb.req.getParams();
     if (!params.getBool(COMPONENT_NAME, false)) {
       return;
     }
-    String name = params.get(ClusteringParams.ENGINE_NAME, ClusteringEngine.DEFAULT_ENGINE_NAME);
+    String name = getClusteringEngineName(rb);
     boolean useResults = params.getBool(ClusteringParams.USE_SEARCH_RESULTS, false);
     if (useResults == true) {
-      SearchClusteringEngine engine = searchClusteringEngines.get(name);
+      SearchClusteringEngine engine = getSearchClusteringEngine(rb);
       if (engine != null) {
         DocListAndSet results = rb.getResults();
-        Object clusters = engine.cluster(rb.getQuery(), results.docList, rb.req);
+        Map<SolrDocument,Integer> docIds = new HashMap<SolrDocument, Integer>(results.docList.size());
+        SolrDocumentList solrDocList = engine.getSolrDocumentList(results.docList, rb.req, docIds);
+        Object clusters = engine.cluster(rb.getQuery(), solrDocList, docIds, rb.req);
         rb.rsp.add("clusters", clusters);
       } else {
         log.warn("No engine for: " + name);
@@ -97,6 +106,72 @@ public class ClusteringComponent extends
       }
     }
   }
+  
+  private SearchClusteringEngine getSearchClusteringEngine(ResponseBuilder rb){
+    return searchClusteringEngines.get(getClusteringEngineName(rb));
+  }
+  
+  private String getClusteringEngineName(ResponseBuilder rb){
+    return rb.req.getParams().get(ClusteringParams.ENGINE_NAME, ClusteringEngine.DEFAULT_ENGINE_NAME);
+  }
+
+  @Override
+  public void modifyRequest(ResponseBuilder rb, SearchComponent who, ShardRequest sreq) {
+    SolrParams params = rb.req.getParams();
+    if (!params.getBool(COMPONENT_NAME, false) || !params.getBool(ClusteringParams.USE_SEARCH_RESULTS, false)) {
+      return;
+    }
+    sreq.params.remove(COMPONENT_NAME);
+    if( ( sreq.purpose & ShardRequest.PURPOSE_GET_FIELDS ) != 0 ){
+      String fl = sreq.params.get(CommonParams.FL,"*");
+      // if fl=* then we don't need check
+      if( fl.indexOf( '*' ) >= 0 ) return;
+      Set<String> fields = getSearchClusteringEngine(rb).getFieldsToLoad(rb.req);
+      if( fields == null || fields.size() == 0 ) return;
+      StringBuilder sb = new StringBuilder();
+      String[] flparams = fl.split( "[,\\s]+" );
+      Set<String> flParamSet = new HashSet<String>(flparams.length);
+      for( String flparam : flparams ){
+        // no need trim() because of split() by \s+
+        flParamSet.add(flparam);
+      }
+      for( String aFieldToLoad : fields ){
+        if( !flParamSet.contains( aFieldToLoad ) ){
+          sb.append( ',' ).append( aFieldToLoad );
+        }
+      }
+      if( sb.length() > 0 ){
+        sreq.params.set( CommonParams.FL, fl + sb.toString() );
+      }
+    }
+  }
+
+  @Override
+  public void finishStage(ResponseBuilder rb) {
+    SolrParams params = rb.req.getParams();
+    if (!params.getBool(COMPONENT_NAME, false) || !params.getBool(ClusteringParams.USE_SEARCH_RESULTS, false)) {
+      return;
+    }
+    if (rb.stage == ResponseBuilder.STAGE_GET_FIELDS) {
+      SearchClusteringEngine engine = getSearchClusteringEngine(rb);
+      if (engine != null) {
+        SolrDocumentList solrDocList = (SolrDocumentList)rb.rsp.getValues().get("response");
+        // TODO: Currently, docIds is set to null in distributed environment.
+        // This causes CarrotParams.PRODUCE_SUMMARY doesn't work.
+        // To work CarrotParams.PRODUCE_SUMMARY under distributed mode, we can choose either one of:
+        // (a) In each shard, ClusteringComponent produces summary and finishStage()
+        //     merges these summaries.
+        // (b) Adding doHighlighting(SolrDocumentList, ...) method to SolrHighlighter and
+        //     making SolrHighlighter uses "external text" rather than stored values to produce snippets.
+        Map<SolrDocument,Integer> docIds = null;
+        Object clusters = engine.cluster(rb.getQuery(), solrDocList, docIds, rb.req);
+        rb.rsp.add("clusters", clusters);
+      } else {
+        String name = getClusteringEngineName(rb);
+        log.warn("No engine for: " + name);
+      }
+    }
+  }
 
   @Override
   @SuppressWarnings("unchecked")
@@ -174,17 +249,17 @@ public class ClusteringComponent extends
 
   @Override
   public String getVersion() {
-    return "$Revision:$";
+    return "$Revision$";
   }
 
   @Override
   public String getSourceId() {
-    return "$Id:$";
+    return "$Id$";
   }
 
   @Override
   public String getSource() {
-    return "$URL:$";
+    return "$URL$";
   }
 
 }

Modified: lucene/dev/branches/docvalues/solr/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/DocumentClusteringEngine.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/DocumentClusteringEngine.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/DocumentClusteringEngine.java (original)
+++ lucene/dev/branches/docvalues/solr/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/DocumentClusteringEngine.java Wed Jan  5 20:25:17 2011
@@ -18,10 +18,7 @@ package org.apache.solr.handler.clusteri
 
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.common.params.SolrParams;
-import org.apache.solr.core.SolrCore;
-import org.apache.solr.search.DocList;
 import org.apache.solr.search.DocSet;
-import org.apache.lucene.search.Query;
 
 
 /**

Modified: lucene/dev/branches/docvalues/solr/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/SearchClusteringEngine.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/SearchClusteringEngine.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/SearchClusteringEngine.java (original)
+++ lucene/dev/branches/docvalues/solr/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/SearchClusteringEngine.java Wed Jan  5 20:25:17 2011
@@ -16,12 +16,16 @@ package org.apache.solr.handler.clusteri
  * limitations under the License.
  */
 
-import org.apache.solr.common.util.NamedList;
-import org.apache.solr.common.params.SolrParams;
-import org.apache.solr.core.SolrCore;
-import org.apache.solr.search.DocList;
-import org.apache.solr.request.SolrQueryRequest;
+import java.io.IOException;
+import java.util.Map;
+import java.util.Set;
+
 import org.apache.lucene.search.Query;
+import org.apache.solr.common.SolrDocument;
+import org.apache.solr.common.SolrDocumentList;
+import org.apache.solr.request.SolrQueryRequest;
+import org.apache.solr.search.DocList;
+import org.apache.solr.util.SolrPluginUtils;
 
 
 /**
@@ -30,8 +34,27 @@ import org.apache.lucene.search.Query;
  **/
 public abstract class SearchClusteringEngine extends ClusteringEngine {
 
-
+  @Deprecated
   public abstract Object cluster(Query query, DocList docList, SolrQueryRequest sreq);
 
-
+  // TODO: need DocList, too?
+  public abstract Object cluster(Query query, SolrDocumentList solrDocumentList,
+      Map<SolrDocument,Integer> docIds, SolrQueryRequest sreq);
+
+  /**
+   * Returns the set of field names to load.
+   * Concrete classes can override this method if needed.
+   * Default implementation returns null, that is, all stored fields are loaded.
+   * @param sreq
+   * @return set of field names to load
+   */
+  protected Set<String> getFieldsToLoad(SolrQueryRequest sreq){
+    return null;
+  }
+
+  public SolrDocumentList getSolrDocumentList(DocList docList, SolrQueryRequest sreq,
+      Map<SolrDocument, Integer> docIds) throws IOException{
+    return SolrPluginUtils.docListToSolrDocumentList(
+        docList, sreq.getSearcher(), getFieldsToLoad(sreq), docIds);
+  }
 }

Modified: lucene/dev/branches/docvalues/solr/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/carrot2/CarrotClusteringEngine.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/carrot2/CarrotClusteringEngine.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/carrot2/CarrotClusteringEngine.java (original)
+++ lucene/dev/branches/docvalues/solr/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/carrot2/CarrotClusteringEngine.java Wed Jan  5 20:25:17 2011
@@ -18,25 +18,39 @@ package org.apache.solr.handler.clusteri
  */
 
 import java.io.IOException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.lucene.document.FieldSelector;
-import org.apache.lucene.document.SetBasedFieldSelector;
 import org.apache.lucene.search.Query;
+import org.apache.solr.common.SolrDocument;
+import org.apache.solr.common.SolrDocumentList;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.SolrException.ErrorCode;
 import org.apache.solr.common.params.HighlightParams;
 import org.apache.solr.common.params.SolrParams;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.common.util.SimpleOrderedMap;
-import org.apache.solr.common.SolrException;
 import org.apache.solr.core.SolrCore;
 import org.apache.solr.handler.clustering.SearchClusteringEngine;
+import org.apache.solr.handler.component.HighlightComponent;
 import org.apache.solr.highlight.SolrHighlighter;
 import org.apache.solr.request.LocalSolrQueryRequest;
 import org.apache.solr.request.SolrQueryRequest;
-import org.apache.solr.search.*;
-import org.apache.solr.util.RefCounted;
-import org.carrot2.core.*;
+import org.apache.solr.search.DocList;
+import org.apache.solr.search.DocSlice;
+import org.apache.solr.search.SolrIndexSearcher;
+import org.apache.solr.util.SolrPluginUtils;
+import org.carrot2.core.Cluster;
+import org.carrot2.core.Controller;
+import org.carrot2.core.ControllerFactory;
+import org.carrot2.core.Document;
+import org.carrot2.core.IClusteringAlgorithm;
 import org.carrot2.core.attribute.AttributeNames;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -63,11 +77,25 @@ public class CarrotClusteringEngine exte
 
   private String idFieldName;
 
+  @Deprecated
   public Object cluster(Query query, DocList docList, SolrQueryRequest sreq) {
+    SolrIndexSearcher searcher = sreq.getSearcher();
+    SolrDocumentList solrDocList;
+    try {
+      Map<SolrDocument,Integer> docIds = new HashMap<SolrDocument, Integer>(docList.size());
+      solrDocList = SolrPluginUtils.docListToSolrDocumentList( docList, searcher, getFieldsToLoad(sreq), docIds );
+      return cluster(query, solrDocList, docIds, sreq);
+    } catch (IOException e) {
+      throw new SolrException(ErrorCode.SERVER_ERROR, e);
+    }
+  }
+
+  public Object cluster(Query query, SolrDocumentList solrDocList,
+      Map<SolrDocument, Integer> docIds, SolrQueryRequest sreq) {
     try {
       // Prepare attributes for Carrot2 clustering call
       Map<String, Object> attributes = new HashMap<String, Object>();
-      List<Document> documents = getDocuments(docList, query, sreq);
+      List<Document> documents = getDocuments(solrDocList, docIds, query, sreq);
       attributes.put(AttributeNames.DOCUMENTS, documents);
       attributes.put(AttributeNames.QUERY, query.toString());
 
@@ -79,7 +107,7 @@ public class CarrotClusteringEngine exte
               clusteringAlgorithmClass).getClusters(), sreq.getParams());
     } catch (Exception e) {
       log.error("Carrot2 clustering failed", e);
-      throw new RuntimeException(e);
+      throw new SolrException(ErrorCode.SERVER_ERROR, "Carrot2 clustering failed", e);
     }
   }
 
@@ -114,36 +142,41 @@ public class CarrotClusteringEngine exte
     return result;
   }
 
-  /**
-   * Prepares Carrot2 documents for clustering.
-   */
-  private List<Document> getDocuments(DocList docList,
-                                      Query query, final SolrQueryRequest sreq) throws IOException {
-    SolrHighlighter highlighter = null;
+  @Override
+  protected Set<String> getFieldsToLoad(SolrQueryRequest sreq){
     SolrParams solrParams = sreq.getParams();
-    SolrCore core = sreq.getCore();
 
     // Names of fields to deliver content for clustering
     String urlField = solrParams.get(CarrotParams.URL_FIELD_NAME, "url");
     String titleField = solrParams.get(CarrotParams.TITLE_FIELD_NAME, "title");
-    String snippetField = solrParams.get(CarrotParams.SNIPPET_FIELD_NAME,
-            titleField);
+    String snippetField = solrParams.get(CarrotParams.SNIPPET_FIELD_NAME, titleField);
     if (StringUtils.isBlank(snippetField)) {
       throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, CarrotParams.SNIPPET_FIELD_NAME
               + " must not be blank.");
     }
-    Set<String> fieldsToLoad = Sets.newHashSet(urlField, titleField,
-            snippetField, idFieldName);
+    return Sets.newHashSet(urlField, titleField, snippetField, idFieldName);
+  }
+  
+  /**
+   * Prepares Carrot2 documents for clustering.
+   */
+  private List<Document> getDocuments(SolrDocumentList solrDocList, Map<SolrDocument, Integer> docIds,
+                                      Query query, final SolrQueryRequest sreq) throws IOException {
+    SolrHighlighter highlighter = null;
+    SolrParams solrParams = sreq.getParams();
+    SolrCore core = sreq.getCore();
 
+    String urlField = solrParams.get(CarrotParams.URL_FIELD_NAME, "url");
+    String titleField = solrParams.get(CarrotParams.TITLE_FIELD_NAME, "title");
+    String snippetField = solrParams.get(CarrotParams.SNIPPET_FIELD_NAME, titleField);
+    
     // Get the documents
-    DocIterator docsIter = docList.iterator();
-    boolean produceSummary = solrParams.getBool(CarrotParams.PRODUCE_SUMMARY,
-            false);
+    boolean produceSummary = solrParams.getBool(CarrotParams.PRODUCE_SUMMARY, false);
 
     SolrQueryRequest req = null;
     String[] snippetFieldAry = null;
     if (produceSummary == true) {
-      highlighter = core.getHighlighter();
+      highlighter = HighlightComponent.getHighlighter(core);
       if (highlighter != null){
         Map args = new HashMap();
         snippetFieldAry = new String[]{snippetField};
@@ -164,20 +197,20 @@ public class CarrotClusteringEngine exte
       }
     }
 
-    SolrIndexSearcher searcher = sreq.getSearcher();
-    List<Document> result = new ArrayList<Document>(docList.size());
+    Iterator<SolrDocument> docsIter = solrDocList.iterator();
+    List<Document> result = new ArrayList<Document>(solrDocList.size());
 
     float[] scores = {1.0f};
     int[] docsHolder = new int[1];
     Query theQuery = query;
 
     while (docsIter.hasNext()) {
-      Integer id = docsIter.next();
-      org.apache.lucene.document.Document doc = searcher.doc(id,
-              fieldsToLoad);
-      String snippet = getValue(doc, snippetField);
-      if (produceSummary == true) {
-        docsHolder[0] = id.intValue();
+      SolrDocument sdoc = docsIter.next();
+      String snippet = getValue(sdoc, snippetField);
+      // TODO: docIds will be null when running distributed search.
+      // See comment in ClusteringComponent#finishStage().
+      if (produceSummary && docIds != null) {
+        docsHolder[0] = docIds.get(sdoc).intValue();
         DocList docAsList = new DocSlice(0, 1, docsHolder, scores, 1, 1.0f);
         NamedList highlights = highlighter.doHighlighting(docAsList, theQuery, req, snippetFieldAry);
         if (highlights != null && highlights.size() == 1) {//should only be one value given our setup
@@ -189,15 +222,16 @@ public class CarrotClusteringEngine exte
           }
         }
       }
-      Document carrotDocument = new Document(getValue(doc, titleField),
-              snippet, doc.get(urlField));
-      carrotDocument.setField("solrId", doc.get(idFieldName));
+      Document carrotDocument = new Document(getValue(sdoc, titleField),
+              snippet, (String)sdoc.getFieldValue(urlField));
+      carrotDocument.setField("solrId", sdoc.getFieldValue(idFieldName));
       result.add(carrotDocument);
     }
 
     return result;
   }
 
+  @Deprecated
   protected String getValue(org.apache.lucene.document.Document doc,
                             String field) {
     StringBuilder result = new StringBuilder();
@@ -211,6 +245,20 @@ public class CarrotClusteringEngine exte
     return result.toString().trim();
   }
 
+  protected String getValue(SolrDocument sdoc, String field) {
+    StringBuilder result = new StringBuilder();
+    Collection<Object> vals = sdoc.getFieldValues(field);
+    if(vals == null) return "";
+    Iterator<Object> ite = vals.iterator();
+    while(ite.hasNext()){
+      // Join multiple values with a period so that Carrot2 does not pick up
+      // phrases that cross field value boundaries (in most cases it would
+      // create useless phrases).
+      result.append((String)ite.next()).append(" . ");
+    }
+    return result.toString().trim();
+  }
+
   private List clustersToNamedList(List<Cluster> carrotClusters,
                                    SolrParams solrParams) {
     List result = new ArrayList();

Modified: lucene/dev/branches/docvalues/solr/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/carrot2/CarrotParams.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/carrot2/CarrotParams.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/carrot2/CarrotParams.java (original)
+++ lucene/dev/branches/docvalues/solr/contrib/clustering/src/main/java/org/apache/solr/handler/clustering/carrot2/CarrotParams.java Wed Jan  5 20:25:17 2011
@@ -3,7 +3,6 @@ package org.apache.solr.handler.clusteri
 import java.util.Set;
 
 import com.google.common.collect.ImmutableSet;
-import org.apache.solr.common.params.HighlightParams;
 
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more

Modified: lucene/dev/branches/docvalues/solr/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/AbstractClusteringTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/AbstractClusteringTestCase.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/AbstractClusteringTestCase.java (original)
+++ lucene/dev/branches/docvalues/solr/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/AbstractClusteringTestCase.java Wed Jan  5 20:25:17 2011
@@ -19,8 +19,6 @@ package org.apache.solr.handler.clusteri
 import org.apache.solr.SolrTestCaseJ4;
 import org.junit.BeforeClass;
 
-import static org.junit.Assert.*;
-
 
 /**
  *
@@ -30,7 +28,7 @@ public abstract class AbstractClustering
 
   @BeforeClass
   public static void beforeClass() throws Exception {
-    initCore("solrconfig.xml", "schema.xml");
+    initCore("solrconfig.xml", "schema.xml", "solr-clustering");
     numberOfDocs = 0;
     for (String[] doc : DOCUMENTS) {
       assertNull(h.validateUpdate(adoc("id", Integer.toString(numberOfDocs), "url", doc[0], "title", doc[1], "snippet", doc[2])));

Modified: lucene/dev/branches/docvalues/solr/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/ClusteringComponentTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/ClusteringComponentTest.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/ClusteringComponentTest.java (original)
+++ lucene/dev/branches/docvalues/solr/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/ClusteringComponentTest.java Wed Jan  5 20:25:17 2011
@@ -29,8 +29,6 @@ import org.apache.solr.response.SolrQuer
 import org.apache.solr.request.SolrRequestHandler;
 import org.junit.Test;
 
-import static org.junit.Assert.*;
-
 /**
  *
  *

Modified: lucene/dev/branches/docvalues/solr/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/carrot2/CarrotClusteringEngineTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/carrot2/CarrotClusteringEngineTest.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/carrot2/CarrotClusteringEngineTest.java (original)
+++ lucene/dev/branches/docvalues/solr/contrib/clustering/src/test/java/org/apache/solr/handler/clustering/carrot2/CarrotClusteringEngineTest.java Wed Jan  5 20:25:17 2011
@@ -22,6 +22,8 @@ import org.apache.lucene.search.MatchAll
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.Sort;
 import org.apache.lucene.search.TermQuery;
+import org.apache.solr.common.SolrDocument;
+import org.apache.solr.common.SolrDocumentList;
 import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.common.params.SolrParams;
 import org.apache.solr.common.util.NamedList;
@@ -31,13 +33,14 @@ import org.apache.solr.request.LocalSolr
 import org.apache.solr.search.DocList;
 import org.apache.solr.search.SolrIndexSearcher;
 import org.apache.solr.util.RefCounted;
+import org.apache.solr.util.SolrPluginUtils;
 import org.carrot2.util.attribute.AttributeUtils;
 import org.junit.Test;
 
 import java.io.IOException;
+import java.util.HashMap;
 import java.util.List;
-
-import static org.junit.Assert.*;
+import java.util.Map;
 
 /**
  *
@@ -133,21 +136,23 @@ public class CarrotClusteringEngineTest 
       docList = searcher.getDocList(query, (Query) null, new Sort(), 0,
               numberOfDocs);
       assertEquals("docList size", expectedNumDocs, docList.matches());
+
+      ModifiableSolrParams solrParams = new ModifiableSolrParams();
+      solrParams.add(CarrotParams.PRODUCE_SUMMARY, "true");
+      solrParams.add(clusteringParams);
+
+      // Perform clustering
+      LocalSolrQueryRequest req = new LocalSolrQueryRequest(h.getCore(), solrParams);
+      Map<SolrDocument,Integer> docIds = new HashMap<SolrDocument, Integer>(docList.size());
+      SolrDocumentList solrDocList = SolrPluginUtils.docListToSolrDocumentList( docList, searcher, engine.getFieldsToLoad(req), docIds );
+      List results = (List)engine.cluster(query, solrDocList, docIds, req);
+      req.close();
+      assertEquals("number of clusters: " + results, expectedNumClusters, results.size());
+      checkClusters(results, false);
+      return results;
     } finally {
       ref.decref();
     }
-
-    ModifiableSolrParams solrParams = new ModifiableSolrParams();
-    solrParams.add(CarrotParams.PRODUCE_SUMMARY, "true");
-    solrParams.add(clusteringParams);
-
-    // Perform clustering
-    LocalSolrQueryRequest req = new LocalSolrQueryRequest(h.getCore(), solrParams);
-    List results = (List) engine.cluster(query, docList, req);
-    req.close();
-    assertEquals("number of clusters: " + results, expectedNumClusters, results.size());
-    checkClusters(results, false);
-    return results;
   }
 
   private void checkClusters(List results, int expectedDocCount,

Modified: lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/build.xml?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/build.xml (original)
+++ lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/build.xml Wed Jan  5 20:25:17 2011
@@ -123,6 +123,10 @@
   	                classpathref="test.classpath">
   	  <src path="src/test/java" />
   	</solr-javac>
+    <!-- Copy any data files present to the classpath -->
+    <copy todir="target/test-classes">
+      <fileset dir="src/test/resources" excludes="**/*.java"/>
+    </copy>
   </target>
 
   <target name="compileExtrasTests" depends="compileExtras">
@@ -130,6 +134,10 @@
   	                classpathref="test.classpath">
   	  <src path="src/extras/test/java" />
   	</solr-javac>
+    <!-- Copy any data files present to the classpath -->
+    <copy todir="target/extras/test-classes">
+      <fileset dir="src/extras/test/resources" excludes="**/*.java"/>
+    </copy>
   </target>
 
   <property name="tempDir" value="${junit.output.dir}/temp" />
@@ -156,7 +164,7 @@
            maxmemory="512M"
            errorProperty="tests.failed"
            failureProperty="tests.failed"
-           dir="src/test/resources/"
+           dir="${tempDir}"
            tempdir="${tempDir}"
            forkmode="perBatch"
            >
@@ -217,7 +225,7 @@
            maxmemory="512M"
            errorProperty="tests.failed"
            failureProperty="tests.failed"
-           dir="src/extras/test/resources/"
+           dir="${tempDir}"
            tempdir="${tempDir}"
            forkmode="perBatch"
            >

Modified: lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/extras/test/java/org/apache/solr/handler/dataimport/TestMailEntityProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/extras/test/java/org/apache/solr/handler/dataimport/TestMailEntityProcessor.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/extras/test/java/org/apache/solr/handler/dataimport/TestMailEntityProcessor.java (original)
+++ lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/extras/test/java/org/apache/solr/handler/dataimport/TestMailEntityProcessor.java Wed Jan  5 20:25:17 2011
@@ -188,7 +188,7 @@ public class TestMailEntityProcessor ext
     Boolean commitCalled;
 
     public SolrWriterImpl() {
-      super(null, ".");
+      super(null, ".", null);
     }
 
     public boolean upload(SolrInputDocument doc) {

Modified: lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/extras/test/java/org/apache/solr/handler/dataimport/TestTikaEntityProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/extras/test/java/org/apache/solr/handler/dataimport/TestTikaEntityProcessor.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/extras/test/java/org/apache/solr/handler/dataimport/TestTikaEntityProcessor.java (original)
+++ lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/extras/test/java/org/apache/solr/handler/dataimport/TestTikaEntityProcessor.java Wed Jan  5 20:25:17 2011
@@ -25,7 +25,7 @@ import org.junit.BeforeClass;
 public class TestTikaEntityProcessor extends AbstractDataImportHandlerTestCase {
   @BeforeClass
   public static void beforeClass() throws Exception {
-    initCore("dataimport-solrconfig.xml", "dataimport-schema-no-unique-key.xml");
+    initCore("dataimport-solrconfig.xml", "dataimport-schema-no-unique-key.xml", "solr-dihextras");
   }
 
   public void testIndexingWithTikaEntityProcessor() throws Exception {
@@ -33,7 +33,7 @@ public class TestTikaEntityProcessor ext
             "<dataConfig>" +
                     "  <dataSource type=\"BinFileDataSource\"/>" +
                     "  <document>" +
-                    "    <entity processor=\"TikaEntityProcessor\" url=\"../../../../../extraction/src/test/resources/solr-word.pdf\" >" +
+                    "    <entity processor=\"TikaEntityProcessor\" url=\"" + getFile("solr-word.pdf").getAbsolutePath() + "\" >" +
                     "      <field column=\"Author\" meta=\"true\" name=\"author\"/>" +
                     "      <field column=\"title\" meta=\"true\" name=\"docTitle\"/>" +
                     "      <field column=\"text\"/>" +

Modified: lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DataImportHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DataImportHandler.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DataImportHandler.java (original)
+++ lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DataImportHandler.java Wed Jan  5 20:25:17 2011
@@ -194,7 +194,7 @@ public class DataImportHandler extends R
                 req.getCore().getUpdateProcessingChain(params.get(UpdateParams.UPDATE_PROCESSOR));
         UpdateRequestProcessor processor = processorChain.createProcessor(req, rsp);
         SolrResourceLoader loader = req.getCore().getResourceLoader();
-        SolrWriter sw = getSolrWriter(processor, loader, requestParams);
+        SolrWriter sw = getSolrWriter(processor, loader, requestParams, req);
 
         if (requestParams.debug) {
           if (debugEnabled) {
@@ -276,9 +276,9 @@ public class DataImportHandler extends R
   }
 
   private SolrWriter getSolrWriter(final UpdateRequestProcessor processor,
-                                   final SolrResourceLoader loader, final DataImporter.RequestParams requestParams) {
+                                   final SolrResourceLoader loader, final DataImporter.RequestParams requestParams, SolrQueryRequest req) {
 
-    return new SolrWriter(processor, loader.getConfigDir(), myName) {
+    return new SolrWriter(processor, loader.getConfigDir(), myName, req) {
 
       @Override
       public boolean upload(SolrInputDocument document) {

Modified: lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/HttpDataSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/HttpDataSource.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/HttpDataSource.java (original)
+++ lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/HttpDataSource.java Wed Jan  5 20:25:17 2011
@@ -16,17 +16,6 @@
  */
 package org.apache.solr.handler.dataimport;
 
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.Properties;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
 /**
  * <p>
  * A data source implementation which can be used to read character files using

Modified: lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/SolrWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/SolrWriter.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/SolrWriter.java (original)
+++ lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/SolrWriter.java Wed Jan  5 20:25:17 2011
@@ -17,6 +17,7 @@
 package org.apache.solr.handler.dataimport;
 
 import org.apache.solr.common.SolrInputDocument;
+import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.update.AddUpdateCommand;
 import org.apache.solr.update.CommitUpdateCommand;
 import org.apache.solr.update.DeleteUpdateCommand;
@@ -26,8 +27,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.io.*;
-import java.text.ParseException;
-import java.util.Date;
 import java.util.Properties;
 
 /**
@@ -53,25 +52,26 @@ public class SolrWriter {
 
   DebugLogger debugLogger;
 
-  public SolrWriter(UpdateRequestProcessor processor, String confDir) {
+  SolrQueryRequest req;
+
+  public SolrWriter(UpdateRequestProcessor processor, String confDir, SolrQueryRequest req) {
     this.processor = processor;
     configDir = confDir;
+    this.req = req;
   }
-  public SolrWriter(UpdateRequestProcessor processor, String confDir, String filePrefix) {
+  public SolrWriter(UpdateRequestProcessor processor, String confDir, String filePrefix, SolrQueryRequest req) {
     this.processor = processor;
     configDir = confDir;
     if(filePrefix != null){
       persistFilename = filePrefix+".properties";
     }
+    this.req = req;
   }
 
   public boolean upload(SolrInputDocument d) {
     try {
-      AddUpdateCommand command = new AddUpdateCommand();
+      AddUpdateCommand command = new AddUpdateCommand(req);
       command.solrDoc = d;
-      command.allowDups = false;
-      command.overwritePending = true;
-      command.overwriteCommitted = true;
       processor.processAdd(command);
     } catch (Exception e) {
       log.warn("Error creating document : " + d, e);
@@ -84,10 +84,8 @@ public class SolrWriter {
   public void deleteDoc(Object id) {
     try {
       log.info("Deleting document: " + id);
-      DeleteUpdateCommand delCmd = new DeleteUpdateCommand();
+      DeleteUpdateCommand delCmd = new DeleteUpdateCommand(req);
       delCmd.id = id.toString();
-      delCmd.fromPending = true;
-      delCmd.fromCommitted = true;
       processor.processDelete(delCmd);
     } catch (IOException e) {
       log.error("Exception while deleteing: " + id, e);
@@ -160,10 +158,8 @@ public class SolrWriter {
   public void deleteByQuery(String query) {
     try {
       log.info("Deleting documents from Solr with query: " + query);
-      DeleteUpdateCommand delCmd = new DeleteUpdateCommand();
+      DeleteUpdateCommand delCmd = new DeleteUpdateCommand(req);
       delCmd.query = query;
-      delCmd.fromCommitted = true;
-      delCmd.fromPending = true;
       processor.processDelete(delCmd);
     } catch (IOException e) {
       log.error("Exception while deleting by query: " + query, e);
@@ -172,7 +168,7 @@ public class SolrWriter {
 
   public void commit(boolean optimize) {
     try {
-      CommitUpdateCommand commit = new CommitUpdateCommand(optimize);
+      CommitUpdateCommand commit = new CommitUpdateCommand(req,optimize);
       processor.processCommit(commit);
     } catch (Throwable t) {
       log.error("Exception while solr commit.", t);
@@ -181,7 +177,7 @@ public class SolrWriter {
 
   public void rollback() {
     try {
-      RollbackUpdateCommand rollback = new RollbackUpdateCommand();
+      RollbackUpdateCommand rollback = new RollbackUpdateCommand(req);
       processor.processRollback(rollback);
     } catch (Throwable t) {
       log.error("Exception while solr rollback.", t);
@@ -190,10 +186,8 @@ public class SolrWriter {
 
   public void doDeleteAll() {
     try {
-      DeleteUpdateCommand deleteCommand = new DeleteUpdateCommand();
+      DeleteUpdateCommand deleteCommand = new DeleteUpdateCommand(req);
       deleteCommand.query = "*:*";
-      deleteCommand.fromCommitted = true;
-      deleteCommand.fromPending = true;
       processor.processDelete(deleteCommand);
     } catch (IOException e) {
       throw new DataImportHandlerException(DataImportHandlerException.SEVERE,

Modified: lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTestCase.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTestCase.java (original)
+++ lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTestCase.java Wed Jan  5 20:25:17 2011
@@ -52,6 +52,11 @@ import java.util.Map;
 public abstract class AbstractDataImportHandlerTestCase extends
         SolrTestCaseJ4 {
 
+  // note, a little twisted that we shadow this static method
+  public static void initCore(String config, String schema) throws Exception {
+    initCore(config, schema, "solr-dih");
+  }
+  
   @Override
   @Before
   public void setUp() throws Exception {

Modified: lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestContentStreamDataSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestContentStreamDataSource.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestContentStreamDataSource.java (original)
+++ lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestContentStreamDataSource.java Wed Jan  5 20:25:17 2011
@@ -39,7 +39,7 @@ import java.util.List;
  * @since solr 1.4
  */
 public class TestContentStreamDataSource extends AbstractDataImportHandlerTestCase {
-  private static final String CONF_DIR = "." + File.separator + "solr" + File.separator + "conf" + File.separator;
+  private static final String CONF_DIR = "." + File.separator + "solr-dih" + File.separator + "conf" + File.separator;
   SolrInstance instance = null;
   JettySolrRunner jetty;
 
@@ -129,12 +129,12 @@ public class TestContentStreamDataSource
       confDir.mkdirs();
 
       File f = new File(confDir, "solrconfig.xml");
-      FileUtils.copyFile(new File(getSolrConfigFile()), f);
+      FileUtils.copyFile(getFile(getSolrConfigFile()), f);
       f = new File(confDir, "schema.xml");
 
-      FileUtils.copyFile(new File(getSchemaFile()), f);
+      FileUtils.copyFile(getFile(getSchemaFile()), f);
       f = new File(confDir, "data-config.xml");
-      FileUtils.copyFile(new File(CONF_DIR + "dataconfig-contentstream.xml"), f);
+      FileUtils.copyFile(getFile(CONF_DIR + "dataconfig-contentstream.xml"), f);
     }
 
     public void tearDown() throws Exception {

Modified: lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestDocBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestDocBuilder.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestDocBuilder.java (original)
+++ lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestDocBuilder.java Wed Jan  5 20:25:17 2011
@@ -197,7 +197,7 @@ public class TestDocBuilder extends Abst
     Boolean finishCalled = Boolean.FALSE;
 
     public SolrWriterImpl() {
-      super(null, ".");
+      super(null, ".",null);
     }
 
     public boolean upload(SolrInputDocument doc) {

Modified: lucene/dev/branches/docvalues/solr/contrib/extraction/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/extraction/build.xml?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/extraction/build.xml (original)
+++ lucene/dev/branches/docvalues/solr/contrib/extraction/build.xml Wed Jan  5 20:25:17 2011
@@ -79,6 +79,10 @@
   	                classpathref="test.classpath">
   	  <src path="src/test/java" />
   	</solr-javac>
+    <!-- Copy any data files present to the classpath -->
+    <copy todir="${dest}/test-classes">
+      <fileset dir="src/test/resources" excludes="**/*.java"/>
+    </copy>
   </target>
 
   <property name="tempDir" value="${junit.output.dir}/temp" />
@@ -105,7 +109,7 @@
            maxmemory="512M"
            errorProperty="tests.failed"
            failureProperty="tests.failed"
-           dir="src/test/resources/"
+           dir="${tempDir}"
            tempdir="${tempDir}"
            forkmode="perBatch"
            >

Modified: lucene/dev/branches/docvalues/solr/contrib/extraction/src/main/java/org/apache/solr/handler/extraction/ExtractingDocumentLoader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/extraction/src/main/java/org/apache/solr/handler/extraction/ExtractingDocumentLoader.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/extraction/src/main/java/org/apache/solr/handler/extraction/ExtractingDocumentLoader.java (original)
+++ lucene/dev/branches/docvalues/solr/contrib/extraction/src/main/java/org/apache/solr/handler/extraction/ExtractingDocumentLoader.java Wed Jan  5 20:25:17 2011
@@ -89,20 +89,9 @@ public class ExtractingDocumentLoader ex
     this.config = config;
     this.processor = processor;
 
-    templateAdd = new AddUpdateCommand();
-    templateAdd.allowDups = false;
-    templateAdd.overwriteCommitted = true;
-    templateAdd.overwritePending = true;
-
-    if (params.getBool(UpdateParams.OVERWRITE, true)) {
-      templateAdd.allowDups = false;
-      templateAdd.overwriteCommitted = true;
-      templateAdd.overwritePending = true;
-    } else {
-      templateAdd.allowDups = true;
-      templateAdd.overwriteCommitted = false;
-      templateAdd.overwritePending = false;
-    }
+    templateAdd = new AddUpdateCommand(req);
+    templateAdd.overwrite = params.getBool(UpdateParams.OVERWRITE, true);
+
     //this is lightweight
     autoDetectParser = new AutoDetectParser(config);
     this.factory = factory;

Modified: lucene/dev/branches/docvalues/solr/contrib/extraction/src/main/java/org/apache/solr/handler/extraction/ExtractingRequestHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/extraction/src/main/java/org/apache/solr/handler/extraction/ExtractingRequestHandler.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/extraction/src/main/java/org/apache/solr/handler/extraction/ExtractingRequestHandler.java (original)
+++ lucene/dev/branches/docvalues/solr/contrib/extraction/src/main/java/org/apache/solr/handler/extraction/ExtractingRequestHandler.java Wed Jan  5 20:25:17 2011
@@ -28,7 +28,6 @@ import org.apache.solr.util.plugin.SolrC
 import org.apache.solr.handler.ContentStreamHandlerBase;
 import org.apache.solr.handler.ContentStreamLoader;
 import org.apache.tika.config.TikaConfig;
-import org.apache.tika.exception.TikaException;
 import org.apache.tika.mime.MimeTypeException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

Modified: lucene/dev/branches/docvalues/solr/contrib/extraction/src/main/java/org/apache/solr/handler/extraction/SolrContentHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/extraction/src/main/java/org/apache/solr/handler/extraction/SolrContentHandler.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/extraction/src/main/java/org/apache/solr/handler/extraction/SolrContentHandler.java (original)
+++ lucene/dev/branches/docvalues/solr/contrib/extraction/src/main/java/org/apache/solr/handler/extraction/SolrContentHandler.java Wed Jan  5 20:25:17 2011
@@ -17,7 +17,6 @@
 
 package org.apache.solr.handler.extraction;
 
-import org.apache.solr.common.SolrException;
 import org.apache.solr.common.SolrInputDocument;
 import org.apache.solr.common.params.SolrParams;
 import org.apache.solr.common.util.DateUtil;

Modified: lucene/dev/branches/docvalues/solr/contrib/extraction/src/test/java/org/apache/solr/handler/ExtractingRequestHandlerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/extraction/src/test/java/org/apache/solr/handler/ExtractingRequestHandlerTest.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/extraction/src/test/java/org/apache/solr/handler/ExtractingRequestHandlerTest.java (original)
+++ lucene/dev/branches/docvalues/solr/contrib/extraction/src/test/java/org/apache/solr/handler/ExtractingRequestHandlerTest.java Wed Jan  5 20:25:17 2011
@@ -31,11 +31,8 @@ import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
-import static org.junit.Assert.*;
-
 import java.util.List;
 import java.util.ArrayList;
-import java.util.Locale;
 import java.io.File;
 
 
@@ -46,7 +43,7 @@ import java.io.File;
 public class ExtractingRequestHandlerTest extends SolrTestCaseJ4 {
   @BeforeClass
   public static void beforeClass() throws Exception {
-    initCore("solrconfig.xml", "schema.xml");
+    initCore("solrconfig.xml", "schema.xml", "solr-extraction");
   }
 
   @Before
@@ -155,6 +152,7 @@ public class ExtractingRequestHandlerTes
     assertTrue("handler is null and it shouldn't be", handler != null);
     try {
       ignoreException("unknown field 'a'");
+      ignoreException("unknown field 'meta'");  // TODO: should this exception be happening?
       loadLocal("simple.html",
       "literal.id","simple2",
       "lowernames", "true",
@@ -370,7 +368,7 @@ public class ExtractingRequestHandlerTes
       // TODO: stop using locally defined streams once stream.file and
       // stream.body work everywhere
       List<ContentStream> cs = new ArrayList<ContentStream>();
-      cs.add(new ContentStreamBase.FileStream(new File(filename)));
+      cs.add(new ContentStreamBase.FileStream(getFile(filename)));
       req.setContentStreams(cs);
       return h.queryAndResponse("/update/extract", req);
     } finally {

Modified: lucene/dev/branches/docvalues/solr/example/README.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/example/README.txt?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/example/README.txt (original)
+++ lucene/dev/branches/docvalues/solr/example/README.txt Wed Jan  5 20:25:17 2011
@@ -16,19 +16,20 @@
 Solr example configuration
 --------------------------
 
-To run this example configuration, use 
+To run the default example configuration, use 
 
   java -jar start.jar
 
-in this directory, and when Solr is started connect to 
+in this example directory, and when Solr is started connect to 
 
   http://localhost:8983/solr/admin/
 
-To add documents to the index, use the post.sh script in the exampledocs
-subdirectory (while Solr is running), for example:
+To add documents to the index, use the post.jar (or post.sh script) in
+the exampledocs subdirectory (while Solr is running), for example:
 
-  cd exampledocs
-  ./post.sh *.xml
+     cd exampledocs
+     java -jar post.jar *.xml
+Or:  ./post.sh *.xml
 
 See also README.txt in the solr subdirectory, and check
 http://wiki.apache.org/solr/SolrResources for a list of tutorials and
@@ -40,3 +41,10 @@ this example server and wish to use the 
 you will need to copy the required jars into solr/lib or update the paths to
 the jars in your solrconfig.xml.
 
+By default, start.jar starts Solr in Jetty using the default SolrHome 
+directory of "./solr/" -- To run other example configurations, you can
+speciy the solr.solr.home system property when starting jetty...
+
+  java -Dsolr.solr.home=multicore -jar start.jar
+  java -Dsolr.solr.home=example-DIH -jar start.jar
+

Modified: lucene/dev/branches/docvalues/solr/example/exampledocs/ipod_other.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/example/exampledocs/ipod_other.xml?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/example/exampledocs/ipod_other.xml (original)
+++ lucene/dev/branches/docvalues/solr/example/exampledocs/ipod_other.xml Wed Jan  5 20:25:17 2011
@@ -29,7 +29,7 @@
   <field name="popularity">1</field>
   <field name="inStock">false</field>
   <!-- Buffalo store -->
-  <field name="store">45.17614,-93.87341</field>
+  <field name="store">45.18014,-93.87741</field>
   <field name="manufacturedate_dt">2005-08-01T16:30:25Z</field>
 </doc>
 

Modified: lucene/dev/branches/docvalues/solr/example/exampledocs/mem.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/example/exampledocs/mem.xml?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/example/exampledocs/mem.xml (original)
+++ lucene/dev/branches/docvalues/solr/example/exampledocs/mem.xml Wed Jan  5 20:25:17 2011
@@ -61,7 +61,7 @@
   <field name="popularity">0</field>
   <field name="inStock">true</field>
   <!-- Buffalo store -->
-  <field name="store">45.17614,-93.87341</field>
+  <field name="store">45.18414,-93.88141</field>
   <field name="manufacturedate_dt">2006-02-13T15:26:37Z</field>
 
   <field name="payloads">electronics|0.9 memory|0.1</field>

Modified: lucene/dev/branches/docvalues/solr/example/exampledocs/monitor2.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/example/exampledocs/monitor2.xml?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/example/exampledocs/monitor2.xml (original)
+++ lucene/dev/branches/docvalues/solr/example/exampledocs/monitor2.xml Wed Jan  5 20:25:17 2011
@@ -27,6 +27,6 @@
   <field name="popularity">6</field>
   <field name="inStock">true</field>
   <!-- Buffalo store -->
-  <field name="store">45.17614,-93.87341</field>
+  <field name="store">45.18814,-93.88541</field>
 </doc></add>
 

Modified: lucene/dev/branches/docvalues/solr/example/exampledocs/mp500.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/example/exampledocs/mp500.xml?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/example/exampledocs/mp500.xml (original)
+++ lucene/dev/branches/docvalues/solr/example/exampledocs/mp500.xml Wed Jan  5 20:25:17 2011
@@ -36,6 +36,6 @@
   <field name="popularity">6</field>
   <field name="inStock">true</field>
   <!-- Buffalo store -->
-  <field name="store">45.17614,-93.87341</field>
+  <field name="store">45.19214,-93.89941</field>
 </doc></add>
 

Modified: lucene/dev/branches/docvalues/solr/example/exampledocs/sd500.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/example/exampledocs/sd500.xml?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/example/exampledocs/sd500.xml (original)
+++ lucene/dev/branches/docvalues/solr/example/exampledocs/sd500.xml Wed Jan  5 20:25:17 2011
@@ -32,5 +32,5 @@
   <field name="inStock">true</field>
   <field name="manufacturedate_dt">2006-02-13T15:26:37Z</field>
   <!-- Buffalo store -->
-  <field name="store">45.17614,-93.87341</field>
+  <field name="store">45.19614,-93.90341</field>
 </doc></add>

Modified: lucene/dev/branches/docvalues/solr/example/multicore/README.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/example/multicore/README.txt?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/example/multicore/README.txt (original)
+++ lucene/dev/branches/docvalues/solr/example/multicore/README.txt Wed Jan  5 20:25:17 2011
@@ -1,3 +1,7 @@
 This is an alternative setup structure to support multiple cores.
 
-For general examples on standard solr configuration, see the "solr" directory.
\ No newline at end of file
+To run this configuration, start jetty in the example/ directory using:
+
+java -Dsolr.solr.home=multicore -jar start.jar
+
+For general examples on standard solr configuration, see the "solr" directory.

Modified: lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/SolrException.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/SolrException.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/SolrException.java (original)
+++ lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/SolrException.java Wed Jan  5 20:25:17 2011
@@ -93,43 +93,6 @@ public class SolrException extends Runti
     this.code=code;
   }
   
-  /**
-   * @deprecated Use {@link #SolrException(ErrorCode,String,boolean)}.
-   */
-  @Deprecated
-  public SolrException(int code, String msg, boolean alreadyLogged) {
-    super(msg);
-    this.code=code;
-    this.logged=alreadyLogged;
-  }
-
-  /**
-   * @deprecated Use {@link #SolrException(ErrorCode,String,Throwable,boolean)}.
-   */
-  @Deprecated
-  public SolrException(int code, String msg, Throwable th, boolean alreadyLogged) {
-    super(msg,th);
-    this.code=code;
-    logged=alreadyLogged;
-  }
-
-  /**
-   * @deprecated Use {@link #SolrException(ErrorCode,String,Throwable)}.
-   */
-  @Deprecated
-  public SolrException(int code, String msg, Throwable th) {
-    this(code,msg,th,true);
-  }
-
-  /**
-   * @deprecated Use {@link #SolrException(ErrorCode,Throwable)}.
-   */
-  @Deprecated
-  public SolrException(int code, Throwable th) {
-    super(th);
-    this.code=code;
-    logged=true;
-  }
 
   int code=0;
   public int code() { return code; }

Modified: lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/params/SolrParams.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/params/SolrParams.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/params/SolrParams.java (original)
+++ lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/params/SolrParams.java Wed Jan  5 20:25:17 2011
@@ -249,16 +249,6 @@ public abstract class SolrParams impleme
     }
   }
 
-  
-  /** how to transform a String into a boolean... more flexible than
-   * Boolean.parseBoolean() to enable easier integration with html forms.
-   * @deprecated Use org.apache.solr.common.util.StrUtils.parseBool
-   */
-  @Deprecated
-  protected boolean parseBool(String s) {
-    return StrUtils.parseBool(s);
-  }
-
   /** Create a Map<String,String> from a NamedList given no keys are repeated */
   public static Map<String,String> toMap(NamedList params) {
     HashMap<String,String> map = new HashMap<String,String>();

Modified: lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/DateUtil.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/DateUtil.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/DateUtil.java (original)
+++ lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/DateUtil.java Wed Jan  5 20:25:17 2011
@@ -17,7 +17,6 @@ package org.apache.solr.common.util;
  */
 
 import java.io.IOException;
-import java.io.Writer;
 import java.text.DateFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;

Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/ClassicTokenizerFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/ClassicTokenizerFactory.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/ClassicTokenizerFactory.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/ClassicTokenizerFactory.java Wed Jan  5 20:25:17 2011
@@ -20,8 +20,6 @@ package org.apache.solr.analysis;
 import org.apache.lucene.analysis.Tokenizer;
 import org.apache.lucene.analysis.standard.ClassicTokenizer;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
-import org.apache.lucene.analysis.standard.StandardTokenizer;
-
 import java.io.Reader;
 import java.util.Map;
 

Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/PhoneticFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/PhoneticFilterFactory.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/PhoneticFilterFactory.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/PhoneticFilterFactory.java Wed Jan  5 20:25:17 2011
@@ -31,7 +31,6 @@ import org.apache.commons.codec.language
 import org.apache.lucene.analysis.TokenStream;
 import org.apache.lucene.analysis.phonetic.PhoneticFilter;
 import org.apache.solr.common.SolrException;
-import org.apache.solr.common.util.StrUtils;
 
 /**
  * Create tokens based on phonetic encoders

Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/core/Config.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/core/Config.java?rev=1055622&r1=1055621&r2=1055622&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/core/Config.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/core/Config.java Wed Jan  5 20:25:17 2011
@@ -33,9 +33,6 @@ import java.io.*;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Locale;
-import java.util.Map;
-import java.util.LinkedHashMap;
-import java.util.Collections;
 import java.util.concurrent.atomic.AtomicBoolean;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -55,15 +52,6 @@ public class Config {
   private final SolrResourceLoader loader;
 
   /**
-   * @deprecated Use {@link #Config(SolrResourceLoader, String, InputStream, String)} instead. 
-   */
-  @Deprecated
-  public Config(String name, InputStream is, String prefix) throws ParserConfigurationException, IOException, SAXException 
-  {
-    this( null, name, is, prefix );
-  }
-
-  /**
    * Builds a config from a resource name with no xpath prefix.
    * @param loader
    * @param name
@@ -313,55 +301,4 @@ public class Config {
     
     return version;
   }
-
-  // The following functions were moved to ResourceLoader
-  //-----------------------------------------------------------------------------
-  
-   /**
-    * @deprecated Use {@link SolrResourceLoader#getConfigDir()} instead.
-    */
-  @Deprecated
-  public String getConfigDir() {
-    return loader.getConfigDir();
-  }
-
-  /**
-   * @deprecated Use {@link SolrResourceLoader#openResource(String)} instead.
-   */
-  @Deprecated
-  public InputStream openResource(String resource) {
-    return loader.openResource(resource);
-  }
-
-  /**
-   * @deprecated Use {@link SolrResourceLoader#getLines(String)} instead.
-   */
-  @Deprecated
-  public List<String> getLines(String resource) throws IOException {
-    return loader.getLines(resource);
-  }
-
-  /**
-   * @deprecated Use {@link SolrResourceLoader#findClass(String, String[])} instead.
-   */
-  @Deprecated
-  public Class findClass(String cname, String... subpackages) {
-    return loader.findClass(cname, subpackages);
-  }
-
-  /**
-   * @deprecated Use {@link SolrResourceLoader#newInstance(String, String[])} instead.
-   */
-  @Deprecated
-  public Object newInstance(String cname, String ... subpackages) {
-    return loader.newInstance(cname, subpackages);
-  }
-  
-  /**
-   * @deprecated Use {@link SolrResourceLoader#getInstanceDir()} instead.
-   */
-  @Deprecated
-  public String getInstanceDir() {
-    return loader.getInstanceDir();
-  }
 }