lucene-pylucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From va...@apache.org
Subject svn commit: r1758057 - in /lucene/pylucene/trunk: java/org/apache/pylucene/queryparser/classic/PythonQueryParser.java test/test_PythonQueryParser.py
Date Sat, 27 Aug 2016 16:00:26 GMT
Author: vajda
Date: Sat Aug 27 16:00:26 2016
New Revision: 1758057

URL: http://svn.apache.org/viewvc?rev=1758057&view=rev
Log:
test_PythonQueryParser.py passes

Modified:
    lucene/pylucene/trunk/java/org/apache/pylucene/queryparser/classic/PythonQueryParser.java
    lucene/pylucene/trunk/test/test_PythonQueryParser.py

Modified: lucene/pylucene/trunk/java/org/apache/pylucene/queryparser/classic/PythonQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/java/org/apache/pylucene/queryparser/classic/PythonQueryParser.java?rev=1758057&r1=1758056&r2=1758057&view=diff
==============================================================================
--- lucene/pylucene/trunk/java/org/apache/pylucene/queryparser/classic/PythonQueryParser.java
(original)
+++ lucene/pylucene/trunk/java/org/apache/pylucene/queryparser/classic/PythonQueryParser.java
Sat Aug 27 16:00:26 2016
@@ -54,7 +54,7 @@ public class PythonQueryParser extends Q
     }
 
     public native void pythonDecRef();
-    public native Query getBooleanQuery(List clauses, boolean disableCoord);
+    public native Query getBooleanQuery(List clauses);
     public native Query getFuzzyQuery(String field, String termText,
                                       float minSimilarity);
     public native Query getPrefixQuery(String field, String termText);

Modified: lucene/pylucene/trunk/test/test_PythonQueryParser.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/test/test_PythonQueryParser.py?rev=1758057&r1=1758056&r2=1758057&view=diff
==============================================================================
--- lucene/pylucene/trunk/test/test_PythonQueryParser.py (original)
+++ lucene/pylucene/trunk/test/test_PythonQueryParser.py Sat Aug 27 16:00:26 2016
@@ -18,21 +18,19 @@ from PyLuceneTestCase import PyLuceneTes
 from org.apache.lucene.analysis.standard import StandardAnalyzer
 from org.apache.lucene.index import Term
 from org.apache.lucene.search import BooleanClause, TermQuery
-from org.apache.lucene.util import Version
 from org.apache.pylucene.queryparser.classic import \
     PythonQueryParser, PythonMultiFieldQueryParser
 
 
 class BooleanTestMixin(object):
 
-    def getBooleanQuery(self, clauses, disableCoord):
+    def getBooleanQuery(self, clauses):
 
         extra_query = TermQuery(Term("all", "extra_clause"))
         extra_clause = BooleanClause(extra_query, BooleanClause.Occur.SHOULD)
         clauses.add(extra_clause)
-                                             
-        return super(BooleanTestMixin, self).getBooleanQuery(clauses,
-                                                             disableCoord)
+
+        return super(BooleanTestMixin, self).getBooleanQuery(clauses)
 
 
 class PythonQueryParserTestCase(PyLuceneTestCase):
@@ -42,9 +40,8 @@ class PythonQueryParserTestCase(PyLucene
         class TestQueryParser(BooleanTestMixin, PythonQueryParser):
             def getFieldQuery_quoted(_self, field, queryText, quoted):
                 return super(TestQueryParser, _self).getFieldQuery_quoted_super(field, queryText,
quoted)
-        
-        qp = TestQueryParser(Version.LUCENE_CURRENT, 'all',
-                             StandardAnalyzer(Version.LUCENE_CURRENT))
+
+        qp = TestQueryParser('all', StandardAnalyzer())
 
         q = qp.parse("foo bar")
         self.assertEquals(str(q), "all:foo all:bar all:extra_clause")
@@ -58,11 +55,10 @@ class PythonMultiFieldQueryParserTestCas
             def getFieldQuery_quoted(_self, field, queryText, quoted):
                 return super(TestQueryParser, _self).getFieldQuery_quoted_super(field, queryText,
quoted)
 
-        qp = TestQueryParser(Version.LUCENE_CURRENT, ['one', 'two'],
-                             StandardAnalyzer(Version.LUCENE_CURRENT))
-        q = qp.parse(Version.LUCENE_CURRENT, "foo bar", ['one', 'two'],
+        qp = TestQueryParser(['one', 'two'], StandardAnalyzer())
+        q = qp.parse("foo bar", ['one', 'two'],
                      [BooleanClause.Occur.SHOULD, BooleanClause.Occur.SHOULD],
-                     StandardAnalyzer(Version.LUCENE_CURRENT))
+                     StandardAnalyzer())
         self.assertEquals(str(q), "(one:foo one:bar) (two:foo two:bar)")
 
 



Mime
View raw message