lucene-pylucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From va...@apache.org
Subject svn commit: r1758136 - in /lucene/pylucene/trunk/test: test_bug1564.py test_bug1763.py test_bug1842.py
Date Sun, 28 Aug 2016 18:39:50 GMT
Author: vajda
Date: Sun Aug 28 18:39:50 2016
New Revision: 1758136

URL: http://svn.apache.org/viewvc?rev=1758136&view=rev
Log:
test_bug????.py pass

Modified:
    lucene/pylucene/trunk/test/test_bug1564.py
    lucene/pylucene/trunk/test/test_bug1763.py
    lucene/pylucene/trunk/test/test_bug1842.py

Modified: lucene/pylucene/trunk/test/test_bug1564.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/test/test_bug1564.py?rev=1758136&r1=1758135&r2=1758136&view=diff
==============================================================================
--- lucene/pylucene/trunk/test/test_bug1564.py (original)
+++ lucene/pylucene/trunk/test/test_bug1564.py Sun Aug 28 18:39:50 2016
@@ -18,15 +18,14 @@ from PyLuceneTestCase import PyLuceneTes
 from org.apache.lucene.analysis.standard import StandardAnalyzer
 from org.apache.lucene.document import Document, Field, StoredField, TextField
 from org.apache.lucene.queryparser.classic import QueryParser
-from org.apache.lucene.util import Version
 
 
 class Test_Bug1564(PyLuceneTestCase):
 
     def setUp(self):
         super(Test_Bug1564, self).setUp()
-        
-        self.analyzer = StandardAnalyzer(Version.LUCENE_CURRENT)
+
+        self.analyzer = StandardAnalyzer()
         writer = self.getWriter(analyzer=self.analyzer)
 
         doc = Document()
@@ -43,8 +42,7 @@ class Test_Bug1564(PyLuceneTestCase):
     def test_bug1564(self):
 
         searcher = self.getSearcher()
-        query = QueryParser(Version.LUCENE_CURRENT, 'all',
-                            self.analyzer).parse('supreme')
+        query = QueryParser('all', self.analyzer).parse('supreme')
         topDocs = searcher.search(query, 50)
         self.assertEqual(topDocs.totalHits, 1)
 

Modified: lucene/pylucene/trunk/test/test_bug1763.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/test/test_bug1763.py?rev=1758136&r1=1758135&r2=1758136&view=diff
==============================================================================
--- lucene/pylucene/trunk/test/test_bug1763.py (original)
+++ lucene/pylucene/trunk/test/test_bug1763.py Sun Aug 28 18:39:50 2016
@@ -19,7 +19,6 @@ from org.apache.lucene.analysis.standard
 from org.apache.lucene.document import Document, Field, StoredField, TextField
 from org.apache.lucene.queryparser.classic import QueryParser
 from org.apache.lucene.store import RAMDirectory
-from org.apache.lucene.util import Version
 
 
 class Test_Bug1763(PyLuceneTestCase):
@@ -27,10 +26,10 @@ class Test_Bug1763(PyLuceneTestCase):
     def setUp(self):
         super(Test_Bug1763, self).setUp()
 
-        self.analyzer = StandardAnalyzer(Version.LUCENE_CURRENT)
+        self.analyzer = StandardAnalyzer()
         self.d1 = RAMDirectory()
         self.d2 = RAMDirectory()
-        
+
         w1, w2 = [self.getWriter(directory=d, analyzer=self.analyzer)
                   for d in [self.d1, self.d2]]
         doc1 = Document()
@@ -47,14 +46,13 @@ class Test_Bug1763(PyLuceneTestCase):
             w.close()
 
     def test_bug1763(self):
-            
+
         w1 = self.getWriter(directory=self.d1, analyzer=self.analyzer)
-        w1.addIndexes([self.getReader(directory=self.d2)])
+        w1.addIndexes([self.d2])
         w1.close()
 
         searcher = self.getSearcher(self.d1)
-        q = QueryParser(Version.LUCENE_CURRENT, 'all',
-                        self.analyzer).parse('brown')
+        q = QueryParser('all', self.analyzer).parse('brown')
         topDocs = searcher.search(q, 50)
         self.assertEqual(searcher.doc(topDocs.scoreDocs[0].doc).get('id'), '2')
 

Modified: lucene/pylucene/trunk/test/test_bug1842.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/test/test_bug1842.py?rev=1758136&r1=1758135&r2=1758136&view=diff
==============================================================================
--- lucene/pylucene/trunk/test/test_bug1842.py (original)
+++ lucene/pylucene/trunk/test/test_bug1842.py Sun Aug 28 18:39:50 2016
@@ -17,9 +17,9 @@ from PyLuceneTestCase import PyLuceneTes
 
 from org.apache.lucene.analysis.standard import StandardAnalyzer
 from org.apache.lucene.document import Document, Field, FieldType, StringField
-from org.apache.lucene.index import Term
+from org.apache.lucene.index import Term, IndexOptions
 from org.apache.lucene.search import TermQuery
-from org.apache.lucene.util import BytesRefIterator, Version
+from org.apache.lucene.util import BytesRefIterator
 
 
 class Test_Bug1842(PyLuceneTestCase):
@@ -27,15 +27,17 @@ class Test_Bug1842(PyLuceneTestCase):
     def setUp(self):
         super(Test_Bug1842, self).setUp()
 
-        self.analyzer = StandardAnalyzer(Version.LUCENE_CURRENT)
-        
+        self.analyzer = StandardAnalyzer()
+
         w1 = self.getWriter(analyzer=self.analyzer)
         doc1 = Document()
 
         ftype = FieldType()
-        ftype.setStored(False)
-        ftype.setIndexed(True)
+        ftype.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS)
+        ftype.setTokenized(True)
         ftype.setStoreTermVectors(True)
+        ftype.freeze()
+
         doc1.add(Field("all", "blah blah blah Gesundheit", ftype))
         doc1.add(Field('id', '1', StringField.TYPE_NOT_STORED))
 
@@ -52,7 +54,7 @@ class Test_Bug1842(PyLuceneTestCase):
         termvec = reader.getTermVector(topDocs.scoreDocs[0].doc, "all")
         terms = []
         freqs = []
-        termsEnum = termvec.iterator(None)
+        termsEnum = termvec.iterator()
         for term in BytesRefIterator.cast_(termsEnum):
             terms.append(term.utf8ToString())
             freqs.append(termsEnum.totalTermFreq())



Mime
View raw message