lucene-pylucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From va...@apache.org
Subject svn commit: r1757514 - in /lucene/pylucene/trunk: ./ java/org/apache/pylucene/search/ test/
Date Wed, 24 Aug 2016 12:33:36 GMT
Author: vajda
Date: Wed Aug 24 12:33:36 2016
New Revision: 1757514

URL: http://svn.apache.org/viewvc?rev=1757514&view=rev
Log:
test_DocBoost.py now passes

Added:
    lucene/pylucene/trunk/java/org/apache/pylucene/search/PythonSimpleCollector.java
      - copied, changed from r1757206, lucene/pylucene/trunk/java/org/apache/pylucene/search/PythonCollector.java
Removed:
    lucene/pylucene/trunk/java/org/apache/pylucene/search/PythonCollector.java
    lucene/pylucene/trunk/java/org/apache/pylucene/search/PythonFieldComparator.java
    lucene/pylucene/trunk/java/org/apache/pylucene/search/PythonFieldComparatorSource.java
    lucene/pylucene/trunk/java/org/apache/pylucene/search/PythonFilter.java
Modified:
    lucene/pylucene/trunk/extensions.xml
    lucene/pylucene/trunk/test/test_DocBoost.py

Modified: lucene/pylucene/trunk/extensions.xml
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/extensions.xml?rev=1757514&r1=1757513&r2=1757514&view=diff
==============================================================================
--- lucene/pylucene/trunk/extensions.xml (original)
+++ lucene/pylucene/trunk/extensions.xml Wed Aug 24 12:33:36 2016
@@ -20,6 +20,9 @@
            destdir="${classes.dir}" classpathref="classpath" />
     <javac srcdir="java/org/apache/pylucene/util"
            destdir="${classes.dir}" classpathref="classpath" />
+    <javac srcdir="java/org/apache/pylucene/search" 
+           excludes="similarities/*,spans/*"
+           destdir="${classes.dir}" classpathref="classpath" />
   </target>
 
   <target name="jar" depends="compile">

Copied: lucene/pylucene/trunk/java/org/apache/pylucene/search/PythonSimpleCollector.java (from
r1757206, lucene/pylucene/trunk/java/org/apache/pylucene/search/PythonCollector.java)
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/java/org/apache/pylucene/search/PythonSimpleCollector.java?p2=lucene/pylucene/trunk/java/org/apache/pylucene/search/PythonSimpleCollector.java&p1=lucene/pylucene/trunk/java/org/apache/pylucene/search/PythonCollector.java&r1=1757206&r2=1757514&rev=1757514&view=diff
==============================================================================
--- lucene/pylucene/trunk/java/org/apache/pylucene/search/PythonCollector.java (original)
+++ lucene/pylucene/trunk/java/org/apache/pylucene/search/PythonSimpleCollector.java Wed Aug
24 12:33:36 2016
@@ -17,15 +17,16 @@ package org.apache.pylucene.search;
 
 import java.io.IOException;
 
-import org.apache.lucene.search.Collector;
+import org.apache.lucene.index.LeafReaderContext;
+import org.apache.lucene.search.SimpleCollector;
 import org.apache.lucene.search.Scorer;
 
 
-public class PythonCollector extends Collector {
+public class PythonSimpleCollector extends SimpleCollector {
 
     private long pythonObject;
 
-    public PythonCollector()
+    public PythonSimpleCollector()
     {
     }
 
@@ -61,7 +62,7 @@ public class PythonCollector extends Col
     public native void pythonDecRef();
     public native void collect(int doc, float score)
         throws IOException;
-    public native void setNextReader(AtomicReaderContext context)
+    public native void doSetNextReader(LeafReaderContext context)
         throws IOException;
-    public native boolean acceptsDocsOutOfOrder();
+    public native boolean needsScores();
 }

Modified: lucene/pylucene/trunk/test/test_DocBoost.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/test/test_DocBoost.py?rev=1757514&r1=1757513&r2=1757514&view=diff
==============================================================================
--- lucene/pylucene/trunk/test/test_DocBoost.py (original)
+++ lucene/pylucene/trunk/test/test_DocBoost.py Wed Aug 24 12:33:36 2016
@@ -19,50 +19,49 @@ from org.apache.lucene.analysis.core imp
 from org.apache.lucene.document import Document, Field, TextField
 from org.apache.lucene.index import Term
 from org.apache.lucene.search import TermQuery
-from org.apache.pylucene.search import PythonCollector
-from org.apache.lucene.util import Version
+from org.apache.pylucene.search import PythonSimpleCollector
 
 
 class DocBoostTestCase(PyLuceneTestCase):
     """
     Unit tests ported from Java Lucene
     """
-  
+
     def testDocBoost(self):
 
-        writer = self.getWriter(analyzer=SimpleAnalyzer(Version.LUCENE_CURRENT))
-    
+        writer = self.getWriter(analyzer=SimpleAnalyzer())
+
         f1 = Field("field", "word", TextField.TYPE_STORED)
         f2 = Field("field", "word", TextField.TYPE_STORED)
         f2.setBoost(2.0)
-    
+
         d1 = Document()
         d2 = Document()
-    
+
         d1.add(f1)                                 # boost = 1
         d2.add(f2)                                 # boost = 2
-    
+
         writer.addDocument(d1)
         writer.addDocument(d2)
         writer.close()
 
         scores = [0.0] * 2
 
-        class collector(PythonCollector):
+        class collector(PythonSimpleCollector):
             def __init__(_self, scores):
                 super(collector, _self).__init__()
                 _self.scores = scores
                 _self.base = 0
             def collect(_self, doc, score):
                 _self.scores[doc + _self.base] = score
-            def setNextReader(_self, context):
+            def doSetNextReader(_self, context):
                 _self.base = context.docBase
-            def acceptsDocsOutOfOrder(_self):
+            def needsScores(_self):
                 return True
 
         self.getSearcher().search(TermQuery(Term("field", "word")),
                                   collector(scores))
-    
+
         lastScore = 0.0
         for score in scores:
             self.assert_(score > lastScore)



Mime
View raw message