lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sim...@apache.org
Subject svn commit: r1063188 [3/3] - in /lucene/dev/branches/bulkpostings: ./ dev-tools/idea/.idea/ dev-tools/idea/solr/contrib/uima/ dev-tools/maven/ dev-tools/maven/solr/contrib/ dev-tools/maven/solr/contrib/uima/ lucene/ lucene/contrib/instantiated/src/java...
Date Tue, 25 Jan 2011 09:39:54 GMT
Modified: lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/spans/TestSpans.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/spans/TestSpans.java?rev=1063188&r1=1063187&r2=1063188&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/spans/TestSpans.java
(original)
+++ lucene/dev/branches/bulkpostings/lucene/src/test/org/apache/lucene/search/spans/TestSpans.java
Tue Jan 25 09:39:51 2011
@@ -20,9 +20,9 @@ package org.apache.lucene.search.spans;
 import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.CheckHits;
-import org.apache.lucene.search.Similarity;
 import org.apache.lucene.search.DefaultSimilarity;
 import org.apache.lucene.search.Scorer;
+import org.apache.lucene.search.SimilarityProvider;
 import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.Weight.ScorerContext;
@@ -410,17 +410,17 @@ public class TestSpans extends LuceneTes
     for (int i = 0; i < leaves.length; i++) {
       
      
-      final Similarity sim = new DefaultSimilarity() {
+      final SimilarityProvider sim = new DefaultSimilarity() {
         @Override
         public float sloppyFreq(int distance) {
           return 0.0f;
         }
       };
   
-      final Similarity oldSim = searcher.getSimilarity();
+      final SimilarityProvider oldSim = searcher.getSimilarityProvider();
       Scorer spanScorer;
       try {
-        searcher.setSimilarity(sim);
+        searcher.setSimilarityProvider(sim);
         SpanNearQuery snq = new SpanNearQuery(
                                 new SpanQuery[] {
                                   makeSpanTermQuery("t1"),
@@ -430,7 +430,7 @@ public class TestSpans extends LuceneTes
   
         spanScorer = snq.weight(searcher).scorer(leaves[i], ScorerContext.def());
       } finally {
-        searcher.setSimilarity(oldSim);
+        searcher.setSimilarityProvider(oldSim);
       }
       if (i == subIndex) {
         assertTrue("first doc", spanScorer.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);

Modified: lucene/dev/branches/bulkpostings/modules/benchmark/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/modules/benchmark/CHANGES.txt?rev=1063188&r1=1063187&r2=1063188&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/modules/benchmark/CHANGES.txt (original)
+++ lucene/dev/branches/bulkpostings/modules/benchmark/CHANGES.txt Tue Jan 25 09:39:51 2011
@@ -2,6 +2,10 @@ Lucene Benchmark Contrib Change Log
 
 The Benchmark contrib package contains code for benchmarking Lucene in a variety of ways.
 
+01/24/2011
+  LUCENE-2885: Add WaitForMerges task (calls IndexWriter.waitForMerges()).
+  (Mike McCandless)
+
 10/10/2010
   The locally built patched version of the Xerces-J jar introduced
   as part of LUCENE-1591 is no longer required, because Xerces

Modified: lucene/dev/branches/bulkpostings/modules/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/modules/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java?rev=1063188&r1=1063187&r2=1063188&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/modules/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
(original)
+++ lucene/dev/branches/bulkpostings/modules/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
Tue Jan 25 09:39:51 2011
@@ -514,6 +514,7 @@ public class TestPerfTasksLogic extends 
         "{ [ AddDoc]: 4} : * ",
         "ResetInputs ",
         "{ [ AddDoc]: 4} : * ",
+        "WaitForMerges",
         "CloseIndex",
     };
     
@@ -549,6 +550,7 @@ public class TestPerfTasksLogic extends 
         "  ResetSystemErase",
         "  CreateIndex",
         "  { \"AddDocs\"  AddDoc > : * ",
+        "  WaitForMerges",
         "  CloseIndex",
         "} : 2",
     };

Modified: lucene/dev/branches/bulkpostings/modules/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/modules/build.xml?rev=1063188&r1=1063187&r2=1063188&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/modules/build.xml (original)
+++ lucene/dev/branches/bulkpostings/modules/build.xml Tue Jan 25 09:39:51 2011
@@ -56,7 +56,7 @@
 
   <target name="generate-maven-artifacts" description="Generate Maven Artifacts for Modules">
     <sequential>
-      <ant target="get-maven-poms" inheritAll="false" dir=".."/>
+      <ant target="get-maven-poms" dir=".."/>
       <subant target="dist-maven" inheritall="false" failonerror="true">
         <fileset dir="analysis" includes="build.xml" />
         <fileset dir="benchmark" includes="build.xml" />

Modified: lucene/dev/branches/bulkpostings/solr/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/build.xml?rev=1063188&r1=1063187&r2=1063188&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/build.xml (original)
+++ lucene/dev/branches/bulkpostings/solr/build.xml Tue Jan 25 09:39:51 2011
@@ -846,7 +846,7 @@
 
   <target name="generate-maven-artifacts" depends="maven.ant.tasks-check, create-package">
     <sequential>
-	  <ant target="get-maven-poms" inheritAll="false" dir=".."/>
+	  <ant target="get-maven-poms" dir=".."/>
 
       <!--
 
@@ -912,7 +912,7 @@
         </artifact-attachments>
       </m2-deploy>
 
-      <m2-deploy pom.xml="contrib/extraction/solr-uima-pom.xml.template"
+      <m2-deploy pom.xml="contrib/uima/pom.xml"
                  jar.file="${dist}/apache-solr-uima-${version}.jar">
         <artifact-attachments>
           <attach file="${dist}/apache-solr-uima-src-${version}.jar" classifier="sources"/>

Modified: lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/request/SimpleFacets.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/request/SimpleFacets.java?rev=1063188&r1=1063187&r2=1063188&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/request/SimpleFacets.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/request/SimpleFacets.java
Tue Jan 25 09:39:51 2011
@@ -1013,7 +1013,7 @@ public class SimpleFacets {
     
     final String f = sf.getName();
     final NamedList<Object> res = new SimpleOrderedMap<Object>();
-    final NamedList<Integer> counts = new SimpleOrderedMap<Integer>();
+    final NamedList<Integer> counts = new NamedList<Integer>();
     res.add("counts", counts);
 
     final T start = calc.getValue(required.getFieldParam(f,FacetParams.FACET_RANGE_START));

Modified: lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/schema/IndexSchema.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/schema/IndexSchema.java?rev=1063188&r1=1063187&r2=1063188&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/schema/IndexSchema.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/schema/IndexSchema.java
Tue Jan 25 09:39:51 2011
@@ -20,7 +20,8 @@ package org.apache.solr.schema;
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.TokenStream;
 import org.apache.lucene.document.Fieldable;
-import org.apache.lucene.search.Similarity;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.SimilarityProvider;
 import org.apache.lucene.queryParser.QueryParser;
 import org.apache.lucene.util.Version;
 import org.apache.solr.common.ResourceLoader;
@@ -192,7 +193,7 @@ public final class IndexSchema {
   /**
    * Returns the Similarity used for this index
    */
-  public Similarity getSimilarity() { return similarityFactory.getSimilarity(); }
+  public SimilarityProvider getSimilarityProvider() { return similarityFactory.getSimilarityProvider();
}
 
   /**
    * Returns the SimilarityFactory used for this index
@@ -496,8 +497,8 @@ public final class IndexSchema {
     Node node = (Node) xpath.evaluate("/schema/similarity", document, XPathConstants.NODE);
     if (node==null) {
       similarityFactory = new SimilarityFactory() {
-        public Similarity getSimilarity() {
-          return Similarity.getDefault();
+        public SimilarityProvider getSimilarityProvider() {
+          return IndexSearcher.getDefaultSimilarityProvider();
         }
       };
       log.debug("using default similarity");
@@ -509,10 +510,10 @@ public final class IndexSchema {
         similarityFactory = (SimilarityFactory)obj;
         similarityFactory.init(params);
       } else {
-        // just like always, assume it's a Similarlity and get a ClassCastException - reasonable
error handling
+        // just like always, assume it's a SimilarityProvider and get a ClassCastException
- reasonable error handling
         similarityFactory = new SimilarityFactory() {
-          public Similarity getSimilarity() {
-            return (Similarity) obj;
+          public SimilarityProvider getSimilarityProvider() {
+            return (SimilarityProvider) obj;
           }
         };
       }

Modified: lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/schema/SimilarityFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/schema/SimilarityFactory.java?rev=1063188&r1=1063187&r2=1063188&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/schema/SimilarityFactory.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/schema/SimilarityFactory.java
Tue Jan 25 09:39:51 2011
@@ -16,7 +16,7 @@ package org.apache.solr.schema;
  * limitations under the License.
  */
 
-import org.apache.lucene.search.Similarity;
+import org.apache.lucene.search.SimilarityProvider;
 import org.apache.solr.common.params.SolrParams;
 
 public abstract class SimilarityFactory {
@@ -25,5 +25,5 @@ public abstract class SimilarityFactory 
   public void init(SolrParams params) { this.params = params; }
   public SolrParams getParams() { return params; }
 
-  public abstract Similarity getSimilarity();
+  public abstract SimilarityProvider getSimilarityProvider();
 }

Modified: lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/search/SolrConstantScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/search/SolrConstantScoreQuery.java?rev=1063188&r1=1063187&r2=1063188&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/search/SolrConstantScoreQuery.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/search/SolrConstantScoreQuery.java
Tue Jan 25 09:39:51 2011
@@ -55,13 +55,11 @@ public class SolrConstantScoreQuery exte
   }
 
   protected class ConstantWeight extends Weight {
-    private Similarity similarity;
     private float queryNorm;
     private float queryWeight;
     private Map context;
 
     public ConstantWeight(IndexSearcher searcher) throws IOException {
-      this.similarity = searcher.getSimilarity();
       this.context = ValueSource.newContext(searcher);
       if (filter instanceof SolrFilter)
         ((SolrFilter)filter).createWeight(context, searcher);

Modified: lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/search/SolrIndexSearcher.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/search/SolrIndexSearcher.java?rev=1063188&r1=1063187&r2=1063188&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/search/SolrIndexSearcher.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/search/SolrIndexSearcher.java
Tue Jan 25 09:39:51 2011
@@ -153,7 +153,7 @@ public class SolrIndexSearcher extends I
     }
 
     this.closeReader = closeReader;
-    setSimilarity(schema.getSimilarity());
+    setSimilarityProvider(schema.getSimilarityProvider());
 
     SolrConfig solrConfig = core.getSolrConfig();
     queryResultWindowSize = solrConfig.queryResultWindowSize;

Modified: lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/search/function/IDFValueSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/search/function/IDFValueSource.java?rev=1063188&r1=1063187&r2=1063188&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/search/function/IDFValueSource.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/search/function/IDFValueSource.java
Tue Jan 25 09:39:51 2011
@@ -41,7 +41,7 @@ public class IDFValueSource extends DocF
   @Override
   public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException
{
     IndexSearcher searcher = (IndexSearcher)context.get("searcher");
-    Similarity sim = searcher.getSimilarity();
+    Similarity sim = searcher.getSimilarityProvider().get(field);
     // todo: we need docFreq that takes a BytesRef
     String strVal = ByteUtils.UTF8toUTF16(indexedBytes);
     int docfreq = searcher.docFreq(new Term(indexedField, strVal));

Modified: lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/search/function/NormValueSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/search/function/NormValueSource.java?rev=1063188&r1=1063187&r2=1063188&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/search/function/NormValueSource.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/search/function/NormValueSource.java
Tue Jan 25 09:39:51 2011
@@ -46,7 +46,7 @@ public class NormValueSource extends Val
   @Override
   public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException
{
     IndexSearcher searcher = (IndexSearcher)context.get("searcher");
-    final Similarity similarity = searcher.getSimilarity();
+    final Similarity similarity = searcher.getSimilarityProvider().get(field);
     final byte[] norms = readerContext.reader.norms(field);
     if (norms == null) {
       return new ConstDoubleDocValues(0.0, this);

Modified: lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/search/function/TFValueSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/search/function/TFValueSource.java?rev=1063188&r1=1063187&r2=1063188&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/search/function/TFValueSource.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/search/function/TFValueSource.java
Tue Jan 25 09:39:51 2011
@@ -25,7 +25,7 @@ public class TFValueSource extends TermF
   public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException
{
     Fields fields = readerContext.reader.fields();
     final Terms terms = fields.terms(field);
-    final Similarity similarity = ((IndexSearcher)context.get("searcher")).getSimilarity();
+    final Similarity similarity = ((IndexSearcher)context.get("searcher")).getSimilarityProvider().get(field);
 
     return new FloatDocValues(this) {
       DocsEnum docs ;

Modified: lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/update/SolrIndexConfig.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/update/SolrIndexConfig.java?rev=1063188&r1=1063187&r2=1063188&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/update/SolrIndexConfig.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/update/SolrIndexConfig.java
Tue Jan 25 09:39:51 2011
@@ -153,7 +153,7 @@ public class SolrIndexConfig {
     if (writeLockTimeout != -1)
       iwc.setWriteLockTimeout(writeLockTimeout);
 
-    iwc.setSimilarity(schema.getSimilarity());
+    iwc.setSimilarityProvider(schema.getSimilarityProvider());
     iwc.setMergePolicy(buildMergePolicy(schema));
     iwc.setMergeScheduler(buildMergeScheduler(schema));
 

Modified: lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/schema/CustomSimilarityFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/schema/CustomSimilarityFactory.java?rev=1063188&r1=1063187&r2=1063188&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/schema/CustomSimilarityFactory.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/schema/CustomSimilarityFactory.java
Tue Jan 25 09:39:51 2011
@@ -16,10 +16,10 @@
  */
 package org.apache.solr.schema;
 
-import org.apache.lucene.search.Similarity;
+import org.apache.lucene.search.SimilarityProvider;
 
 public class CustomSimilarityFactory extends SimilarityFactory {
-  public Similarity getSimilarity() {
+  public SimilarityProvider getSimilarityProvider() {
     return new MockConfigurableSimilarity(params.get("echo"));
   }
 }

Modified: lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/schema/IndexSchemaTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/schema/IndexSchemaTest.java?rev=1063188&r1=1063187&r2=1063188&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/schema/IndexSchemaTest.java
(original)
+++ lucene/dev/branches/bulkpostings/solr/src/test/org/apache/solr/schema/IndexSchemaTest.java
Tue Jan 25 09:39:51 2011
@@ -27,7 +27,7 @@ import org.apache.solr.common.params.Map
 import org.apache.solr.core.SolrCore;
 import org.apache.solr.request.LocalSolrQueryRequest;
 import org.apache.solr.request.SolrQueryRequest;
-import org.apache.lucene.search.Similarity;
+import org.apache.lucene.search.SimilarityProvider;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -83,7 +83,7 @@ public class IndexSchemaTest extends Sol
   @Test
   public void testSimilarityFactory() {
     SolrCore core = h.getCore();
-    Similarity similarity = core.getSchema().getSimilarity();
+    SimilarityProvider similarity = core.getSchema().getSimilarityProvider();
     assertTrue("wrong class", similarity instanceof MockConfigurableSimilarity);
     assertEquals("is there an echo?", ((MockConfigurableSimilarity)similarity).getPassthrough());
   }



Mime
View raw message