lucene-pylucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From va...@apache.org
Subject svn commit: r1663019 - in /lucene/pylucene/branches/pylucene_4_10: java/org/apache/pylucene/queryparser/classic/PythonQueryParser.java test/test_PythonQueryParser.py
Date Sun, 01 Mar 2015 01:35:40 GMT
Author: vajda
Date: Sun Mar  1 01:35:40 2015
New Revision: 1663019

URL: http://svn.apache.org/r1663019
Log:
added newTermQuery override and test

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

Modified: lucene/pylucene/branches/pylucene_4_10/java/org/apache/pylucene/queryparser/classic/PythonQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/pylucene/branches/pylucene_4_10/java/org/apache/pylucene/queryparser/classic/PythonQueryParser.java?rev=1663019&r1=1663018&r2=1663019&view=diff
==============================================================================
--- lucene/pylucene/branches/pylucene_4_10/java/org/apache/pylucene/queryparser/classic/PythonQueryParser.java
(original)
+++ lucene/pylucene/branches/pylucene_4_10/java/org/apache/pylucene/queryparser/classic/PythonQueryParser.java
Sun Mar  1 01:35:40 2015
@@ -18,6 +18,7 @@ package org.apache.pylucene.queryparser.
 import java.util.List;
 
 import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.index.Term;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.queryparser.classic.QueryParser;
 import org.apache.lucene.queryparser.classic.CharStream;
@@ -70,6 +71,8 @@ public class PythonQueryParser extends Q
     public native Query getFieldQuery_slop(String field, String queryText,
                                            int slop);
 
+    public native Query newTermQuery(Term term);
+
     public Query getFieldQuery_quoted_super(String field, String queryText,
                                             boolean quoted)
         throws ParseException

Modified: lucene/pylucene/branches/pylucene_4_10/test/test_PythonQueryParser.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/branches/pylucene_4_10/test/test_PythonQueryParser.py?rev=1663019&r1=1663018&r2=1663019&view=diff
==============================================================================
--- lucene/pylucene/branches/pylucene_4_10/test/test_PythonQueryParser.py (original)
+++ lucene/pylucene/branches/pylucene_4_10/test/test_PythonQueryParser.py Sun Mar  1 01:35:40
2015
@@ -42,6 +42,9 @@ class PythonQueryParserTestCase(PyLucene
         class TestQueryParser(BooleanTestMixin, PythonQueryParser):
             def getFieldQuery_quoted(_self, field, queryText, quoted):
                 return super(TestQueryParser, _self).getFieldQuery_quoted_super(field, queryText,
quoted)
+            def newTermQuery(_self, term):
+                print "CALLING newTermQuery with", term
+                return TermQuery(term)
         
         qp = TestQueryParser(Version.LUCENE_CURRENT, 'all',
                              StandardAnalyzer(Version.LUCENE_CURRENT))



Mime
View raw message