lucene-pylucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From va...@apache.org
Subject svn commit: r950794 - in /lucene/pylucene/branches/pylucene_2_9: ./ samples/LuceneInAction/lia/advsearching/ samples/LuceneInAction/lia/common/ samples/LuceneInAction/lia/meetlucene/ samples/LuceneInAction/lia/searching/ samples/LuceneInAction/lia/tool...
Date Wed, 02 Jun 2010 22:17:51 GMT
Author: vajda
Date: Wed Jun  2 22:17:50 2010
New Revision: 950794

URL: http://svn.apache.org/viewvc?rev=950794&view=rev
Log:
 - using Lucene 2.9.3 sources
 - PyLucene built with JCC 2.6
 - updated samples and test cases to reflect JCC 2.6 changes

Modified:
    lucene/pylucene/branches/pylucene_2_9/CHANGES
    lucene/pylucene/branches/pylucene_2_9/Makefile
    lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/advsearching/BooksLikeThis.py
    lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/advsearching/PhrasePrefixQueryTest.py
    lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/advsearching/SortingExample.py
    lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/advsearching/SpanQueryTest.py
    lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/common/LiaTestCase.py
    lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/meetlucene/Searcher.py
    lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/searching/Explainer.py
    lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/tools/HighlightTest.py
    lucene/pylucene/branches/pylucene_2_9/test/test_Binary.py
    lucene/pylucene/branches/pylucene_2_9/test/test_PythonDirectory.py

Modified: lucene/pylucene/branches/pylucene_2_9/CHANGES
URL: http://svn.apache.org/viewvc/lucene/pylucene/branches/pylucene_2_9/CHANGES?rev=950794&r1=950793&r2=950794&view=diff
==============================================================================
--- lucene/pylucene/branches/pylucene_2_9/CHANGES (original)
+++ lucene/pylucene/branches/pylucene_2_9/CHANGES Wed Jun  2 22:17:50 2010
@@ -1,4 +1,11 @@
 
+Version 2.9.1 -> 2.9.3
+----------------------
+ - using Lucene 2.9.3 sources
+ - PyLucene built with JCC 2.6
+ - updated samples and test cases to reflect JCC 2.6 changes
+ - 
+
 Version 2.9.1 -> 2.9.2
 ----------------------
  - no changes other than using Lucene 2.9.2 sources

Modified: lucene/pylucene/branches/pylucene_2_9/Makefile
URL: http://svn.apache.org/viewvc/lucene/pylucene/branches/pylucene_2_9/Makefile?rev=950794&r1=950793&r2=950794&view=diff
==============================================================================
--- lucene/pylucene/branches/pylucene_2_9/Makefile (original)
+++ lucene/pylucene/branches/pylucene_2_9/Makefile Wed Jun  2 22:17:50 2010
@@ -14,10 +14,10 @@
 # site-packages directory.
 #
 
-VERSION=2.9.2-1
+VERSION=2.9.3-1
 LUCENE_SVN_VER=HEAD
-LUCENE_VER=2.9.2
-LUCENE_SVN=http://svn.apache.org/repos/asf/lucene/java/tags/lucene_2_9_2
+LUCENE_VER=2.9.3
+LUCENE_SVN=http://svn.apache.org/repos/asf/lucene/java/branches/lucene_2_9
 PYLUCENE:=$(shell pwd)
 LUCENE=lucene-java-$(LUCENE_VER)
 
@@ -196,6 +196,7 @@ JARS=$(LUCENE_JAR) $(SNOWBALL_JAR) $(ANA
 jars: $(JARS)
 
 GENERATE=$(JCC) $(foreach jar,$(JARS),--jar $(jar)) \
+           --no-generics \
            --package java.lang java.lang.System \
                                java.lang.Runtime \
            --package java.util \

Modified: lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/advsearching/BooksLikeThis.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/advsearching/BooksLikeThis.py?rev=950794&r1=950793&r2=950794&view=diff
==============================================================================
--- lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/advsearching/BooksLikeThis.py
(original)
+++ lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/advsearching/BooksLikeThis.py
Wed Jun  2 22:17:50 2010
@@ -76,7 +76,7 @@ class BooksLikeThis(object):
         hits = self.searcher.search(likeThisQuery)
 
         docs = []
-        for hit in hits:
+        for hit in hits.iterator():
             hit = Hit.cast_(hit)
             doc = hit.getDocument()
             if len(docs) < max:

Modified: lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/advsearching/PhrasePrefixQueryTest.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/advsearching/PhrasePrefixQueryTest.py?rev=950794&r1=950793&r2=950794&view=diff
==============================================================================
--- lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/advsearching/PhrasePrefixQueryTest.py
(original)
+++ lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/advsearching/PhrasePrefixQueryTest.py
Wed Jun  2 22:17:50 2010
@@ -71,5 +71,5 @@ class PhrasePrefixQueryTest(TestCase):
 
     def debug(self, hits):
 
-        for i, doc in hits:
+        for i, doc in hits.iterator():
             print "%s: %s" %(hits.score(i), doc['field'])

Modified: lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/advsearching/SortingExample.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/advsearching/SortingExample.py?rev=950794&r1=950793&r2=950794&view=diff
==============================================================================
--- lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/advsearching/SortingExample.py
(original)
+++ lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/advsearching/SortingExample.py
Wed Jun  2 22:17:50 2010
@@ -35,7 +35,7 @@ class SortingExample(object):
               "id".center(4), "score".center(15)
 
         scoreFormatter = DecimalFormat("0.######")
-        for i, doc in hits:
+        for i, doc in hits.iterator():
             title = doc["title"]
             if len(title) > 30:
                 title = title[:30]

Modified: lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/advsearching/SpanQueryTest.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/advsearching/SpanQueryTest.py?rev=950794&r1=950793&r2=950794&view=diff
==============================================================================
--- lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/advsearching/SpanQueryTest.py
(original)
+++ lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/advsearching/SpanQueryTest.py
Wed Jun  2 22:17:50 2010
@@ -171,7 +171,7 @@ class SpanQueryTest(TestCase):
 
         hits = self.searcher.search(query)
         scores = [0, 0]
-        for hit in hits:
+        for hit in hits.iterator():
             hit = Hit.cast_(hit)
             scores[hit.getId()] = hit.getScore()
 

Modified: lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/common/LiaTestCase.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/common/LiaTestCase.py?rev=950794&r1=950793&r2=950794&view=diff
==============================================================================
--- lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/common/LiaTestCase.py
(original)
+++ lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/common/LiaTestCase.py
Wed Jun  2 22:17:50 2010
@@ -41,14 +41,14 @@ class LiaTestCase(TestCase):
         if not hits:
             print "No hits"
         else:
-            for hit in hits:
+            for hit in hits.iterator():
                 hit = Hit.cast_(hit)
                 print "%s: %s" %(hit.getScore(),
                                  hit.getDocument().get('title'))
 
     def assertHitsIncludeTitle(self, hits, title):
 
-        for hit in hits:
+        for hit in hits.iterator():
             doc = Hit.cast_(hit).getDocument()
             if title == doc.get("title"):
                 self.assert_(True)

Modified: lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/meetlucene/Searcher.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/meetlucene/Searcher.py?rev=950794&r1=950793&r2=950794&view=diff
==============================================================================
--- lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/meetlucene/Searcher.py
(original)
+++ lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/meetlucene/Searcher.py
Wed Jun  2 22:17:50 2010
@@ -49,7 +49,7 @@ class Searcher(object):
 
         print "Found %d document(s) (in %s) that matched query '%s':" %(hits.length(), duration,
q)
 
-        for hit in hits:
+        for hit in hits.iterator():
             doc = Hit.cast_(hit).getDocument()
             print doc["path"]
 

Modified: lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/searching/Explainer.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/searching/Explainer.py?rev=950794&r1=950793&r2=950794&view=diff
==============================================================================
--- lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/searching/Explainer.py
(original)
+++ lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/searching/Explainer.py
Wed Jun  2 22:17:50 2010
@@ -40,7 +40,7 @@ class Explainer(object):
             searcher = IndexSearcher(directory)
             hits = searcher.search(query)
 
-            for hit in hits:
+            for hit in hits.iterator():
                 hit = Hit.cast_(hit)
                 doc = hit.getDocument()
                 id = hit.getId()

Modified: lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/tools/HighlightTest.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/tools/HighlightTest.py?rev=950794&r1=950793&r2=950794&view=diff
==============================================================================
--- lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/tools/HighlightTest.py
(original)
+++ lucene/pylucene/branches/pylucene_2_9/samples/LuceneInAction/lia/tools/HighlightTest.py
Wed Jun  2 22:17:50 2010
@@ -43,7 +43,7 @@ class HighlightTest(LiaTestCase):
         scorer = QueryScorer(query)
         highlighter = Highlighter(scorer)
 
-        for hit in hits:
+        for hit in hits.iterator():
             doc = Hit.cast_(hit).getDocument()
             title = doc["title"]
             stream = SimpleAnalyzer().tokenStream("title", StringReader(title))

Modified: lucene/pylucene/branches/pylucene_2_9/test/test_Binary.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/branches/pylucene_2_9/test/test_Binary.py?rev=950794&r1=950793&r2=950794&view=diff
==============================================================================
--- lucene/pylucene/branches/pylucene_2_9/test/test_Binary.py (original)
+++ lucene/pylucene/branches/pylucene_2_9/test/test_Binary.py Wed Jun  2 22:17:50 2010
@@ -21,22 +21,22 @@ class BinaryTestCase(TestCase):
 
     def binary(self, b):
 
-        c = JArray('byte')([chr(a) for a in b])
+        c = JArray('byte')(b)
         field = Field("bin", c, Field.Store.YES)
         v = field.binaryValue()
-        assert c == v and b == [ord(a) for a in v]
+        assert c == v and b == [a for a in v]
 
     def testBinary(self):
 
         self.binary([66, 90, 104, 57, 49, 65, 89, 38,
-                     83, 89, 105, 56, 95, 75, 0, 0, 14, 215, 128])
+                     83, 89, 105, 56, 95, 75, 0, 0, 14, -41, -128])
         self.binary([])
         self.binary([0, 0, 0])
 
 
 if __name__ == '__main__':
     import sys, lucene
-    lucene.initVM(lucene.CLASSPATH)
+    lucene.initVM()
     if '-loop' in sys.argv:
         sys.argv.remove('-loop')
         while True:

Modified: lucene/pylucene/branches/pylucene_2_9/test/test_PythonDirectory.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/branches/pylucene_2_9/test/test_PythonDirectory.py?rev=950794&r1=950793&r2=950794&view=diff
==============================================================================
--- lucene/pylucene/branches/pylucene_2_9/test/test_PythonDirectory.py (original)
+++ lucene/pylucene/branches/pylucene_2_9/test/test_PythonDirectory.py Wed Jun  2 22:17:50
2010
@@ -123,10 +123,10 @@ class PythonFileStreamOutput(PythonIndex
     def seekInternal(self, pos):
         self.fh.seek(pos)
 
-    def flushBuffer(self, buffer):
-        self.fh.write(''.join(buffer))
+    def flushBuffer(self, bytes):
+        self.fh.write(bytes.string_)
         self.fh.flush()
-        self._length += len(buffer)
+        self._length += len(bytes)
 
 
 class PythonFileDirectory(PythonDirectory):



Mime
View raw message