lucene-pylucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From va...@apache.org
Subject svn commit: r984223 - in /lucene/pylucene/trunk: java/org/apache/pylucene/queryParser/ samples/ samples/LuceneInAction/lia/analysis/queryparser/ samples/LuceneInAction/lia/extsearch/queryparser/ samples/LuceneInAction/lia/meetlucene/ test/
Date Tue, 10 Aug 2010 21:55:55 GMT
Author: vajda
Date: Tue Aug 10 21:55:54 2010
New Revision: 984223

URL: http://svn.apache.org/viewvc?rev=984223&view=rev
Log:
merged branch_3x revs 984140 and 984146

Modified:
    lucene/pylucene/trunk/java/org/apache/pylucene/queryParser/PythonMultiFieldQueryParser.java
    lucene/pylucene/trunk/java/org/apache/pylucene/queryParser/PythonQueryParser.java
    lucene/pylucene/trunk/samples/   (props changed)
    lucene/pylucene/trunk/samples/LuceneInAction/lia/analysis/queryparser/AnalysisParalysisTest.py
    lucene/pylucene/trunk/samples/LuceneInAction/lia/extsearch/queryparser/CustomQueryParser.py
    lucene/pylucene/trunk/samples/LuceneInAction/lia/meetlucene/   (props changed)
    lucene/pylucene/trunk/test/test_PythonQueryParser.py

Modified: lucene/pylucene/trunk/java/org/apache/pylucene/queryParser/PythonMultiFieldQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/java/org/apache/pylucene/queryParser/PythonMultiFieldQueryParser.java?rev=984223&r1=984222&r2=984223&view=diff
==============================================================================
--- lucene/pylucene/trunk/java/org/apache/pylucene/queryParser/PythonMultiFieldQueryParser.java
(original)
+++ lucene/pylucene/trunk/java/org/apache/pylucene/queryParser/PythonMultiFieldQueryParser.java
Tue Aug 10 21:55:54 2010
@@ -51,8 +51,7 @@ public class PythonMultiFieldQueryParser
 
     public native void pythonDecRef();
     public native Query getBooleanQuery(List clauses, boolean disableCoord);
-    public native Query getFieldQuery(String field, String queryText);
-    public native Query getFieldQuery(String field, String queryText, int slop);
+
     public native Query getFuzzyQuery(String field, String termText,
                                       float minSimilarity);
     public native Query getPrefixQuery(String field, String termText);
@@ -60,4 +59,33 @@ public class PythonMultiFieldQueryParser
                                       String part1, String part2,
                                       boolean inclusive);
     public native Query getWildcardQuery(String field, String termText);
+
+    public native Query getFieldQuery_quoted(String field, String queryText,
+                                             boolean quoted);
+    public native Query getFieldQuery_slop(String field, String queryText,
+                                           int slop);
+
+    public Query getFieldQuery_quoted_super(String field, String queryText,
+                                            boolean quoted)
+        throws ParseException
+    {
+        return super.getFieldQuery(field, queryText, quoted);
+    }
+
+    public Query getFieldQuery_slop_super(String field, String queryText,
+                                          int slop)
+        throws ParseException
+    {
+        return super.getFieldQuery(field, queryText, slop);
+    }
+
+    public Query getFieldQuery(String field, String queryText, boolean quoted)
+    {
+        return getFieldQuery_quoted(field, queryText, quoted);
+    }
+
+    public Query getFieldQuery(String field, String queryText, int slop)
+    {
+        return getFieldQuery_slop(field, queryText, slop);
+    }
 }

Modified: lucene/pylucene/trunk/java/org/apache/pylucene/queryParser/PythonQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/java/org/apache/pylucene/queryParser/PythonQueryParser.java?rev=984223&r1=984222&r2=984223&view=diff
==============================================================================
--- lucene/pylucene/trunk/java/org/apache/pylucene/queryParser/PythonQueryParser.java (original)
+++ lucene/pylucene/trunk/java/org/apache/pylucene/queryParser/PythonQueryParser.java Tue
Aug 10 21:55:54 2010
@@ -56,8 +56,6 @@ public class PythonQueryParser extends Q
 
     public native void pythonDecRef();
     public native Query getBooleanQuery(List clauses, boolean disableCoord);
-    public native Query getFieldQuery(String field, String queryText);
-    public native Query getFieldQuery(String field, String queryText, int slop);
     public native Query getFuzzyQuery(String field, String termText,
                                       float minSimilarity);
     public native Query getPrefixQuery(String field, String termText);
@@ -65,4 +63,33 @@ public class PythonQueryParser extends Q
                                       String part1, String part2,
                                       boolean inclusive);
     public native Query getWildcardQuery(String field, String termText);
+
+    public native Query getFieldQuery_quoted(String field, String queryText,
+                                             boolean quoted);
+    public native Query getFieldQuery_slop(String field, String queryText,
+                                           int slop);
+
+    public Query getFieldQuery_quoted_super(String field, String queryText,
+                                            boolean quoted)
+        throws ParseException
+    {
+        return super.getFieldQuery(field, queryText, quoted);
+    }
+
+    public Query getFieldQuery_slop_super(String field, String queryText,
+                                          int slop)
+        throws ParseException
+    {
+        return super.getFieldQuery(field, queryText, slop);
+    }
+
+    public Query getFieldQuery(String field, String queryText, boolean quoted)
+    {
+        return getFieldQuery_quoted(field, queryText, quoted);
+    }
+
+    public Query getFieldQuery(String field, String queryText, int slop)
+    {
+        return getFieldQuery_slop(field, queryText, slop);
+    }
 }

Propchange: lucene/pylucene/trunk/samples/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 10 21:55:54 2010
@@ -1 +1,2 @@
-/lucene/pylucene/branches/branch_3x/samples:944953-944954,945800
+/lucene/pylucene/branches/branch_3x/samples:944953-944954,945800,984140,984146
+/lucene/pylucene/branches/pylucene_3_0/samples:984140

Modified: lucene/pylucene/trunk/samples/LuceneInAction/lia/analysis/queryparser/AnalysisParalysisTest.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/samples/LuceneInAction/lia/analysis/queryparser/AnalysisParalysisTest.py?rev=984223&r1=984222&r2=984223&view=diff
==============================================================================
--- lucene/pylucene/trunk/samples/LuceneInAction/lia/analysis/queryparser/AnalysisParalysisTest.py
(original)
+++ lucene/pylucene/trunk/samples/LuceneInAction/lia/analysis/queryparser/AnalysisParalysisTest.py
Tue Aug 10 21:55:54 2010
@@ -26,8 +26,9 @@ class AnalysisParalysisTest(LiaTestCase)
         analyzer = StandardAnalyzer(Version.LUCENE_CURRENT)
         queryString = "category:/philosophy/eastern"
 
-        query = QueryParser(Version.LUCENE_CURRENT,
-                            "contents", analyzer).parse(queryString)
+        parser = QueryParser(Version.LUCENE_CURRENT, "contents", analyzer)
+        parser.setAutoGeneratePhraseQueries(True)
+        query = parser.parse(queryString)
 
         self.assertEqual("category:\"philosophy eastern\"",
                          query.toString("contents"), "path got split, yikes!")

Modified: lucene/pylucene/trunk/samples/LuceneInAction/lia/extsearch/queryparser/CustomQueryParser.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/samples/LuceneInAction/lia/extsearch/queryparser/CustomQueryParser.py?rev=984223&r1=984222&r2=984223&view=diff
==============================================================================
--- lucene/pylucene/trunk/samples/LuceneInAction/lia/extsearch/queryparser/CustomQueryParser.py
(original)
+++ lucene/pylucene/trunk/samples/LuceneInAction/lia/extsearch/queryparser/CustomQueryParser.py
Tue Aug 10 21:55:54 2010
@@ -58,19 +58,20 @@ class CustomQueryParser(PythonQueryParse
         return super(CustomQueryParser,
                      self).getRangeQuery(field, part1, part2, inclusive)
 
+
+    def getFieldQuery_quoted(self, field, queryText, quoted):
+
+        return super(CustomQueryParser,
+                     self).getFieldQuery_quoted_super(field, queryText, quoted)
+
     #
     # Replace PhraseQuery with SpanNearQuery to force in-order
     # phrase matching rather than reverse.
     #
-    def getFieldQuery(self, field, queryText, slop=None):
-
-        if slop is None:
-            return super(CustomQueryParser,
-                         self).getFieldQuery(field, queryText)
+    def getFieldQuery_slop(self, field, queryText, slop):
 
-        # let QueryParser's implementation do the analysis
         orig = super(CustomQueryParser,
-                     self).getFieldQuery(field, queryText, slop)
+                     self).getFieldQuery_slop_super(field, queryText, slop)
 
         if not PhraseQuery.instance_(orig):
             return orig
@@ -117,19 +118,20 @@ class MultiFieldCustomQueryParser(Python
         return super(CustomQueryParser,
                      self).getRangeQuery(field, part1, part2, inclusive)
 
+    def getFieldQuery_quoted(self, field, queryText, quoted):
+
+        return super(CustomQueryParser,
+                     self).getFieldQuery_quoted_super(field, queryText, quoted)
+
     #
     # Replace PhraseQuery with SpanNearQuery to force in-order
     # phrase matching rather than reverse.
     #
-    def getFieldQuery(self, field, queryText, slop=None):
-
-        if slop is None:
-            return super(CustomQueryParser,
-                         self).getFieldQuery(field, queryText)
+    def getFieldQuery_slop(self, field, queryText, slop):
 
         # let QueryParser's implementation do the analysis
         orig = super(CustomQueryParser,
-                     self).getFieldQuery(field, queryText, slop)
+                     self).getFieldQuery_slop_super(field, queryText, slop)
 
         if not PhraseQuery.instance_(orig):
             return orig

Propchange: lucene/pylucene/trunk/samples/LuceneInAction/lia/meetlucene/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 10 21:55:54 2010
@@ -1,2 +1,2 @@
-/lucene/pylucene/branches/branch_3x/samples/LuceneInAction/lia/meetlucene:944953-944954,945800
-/lucene/pylucene/branches/pylucene_3_0/samples/LuceneInAction/lia/meetlucene:984081
+/lucene/pylucene/branches/branch_3x/samples/LuceneInAction/lia/meetlucene:944953-944954,945800,984140,984146
+/lucene/pylucene/branches/pylucene_3_0/samples/LuceneInAction/lia/meetlucene:984081,984140

Modified: lucene/pylucene/trunk/test/test_PythonQueryParser.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/test/test_PythonQueryParser.py?rev=984223&r1=984222&r2=984223&view=diff
==============================================================================
--- lucene/pylucene/trunk/test/test_PythonQueryParser.py (original)
+++ lucene/pylucene/trunk/test/test_PythonQueryParser.py Tue Aug 10 21:55:54 2010
@@ -33,7 +33,8 @@ class PythonQueryParserTestCase(TestCase
     def testOverrideBooleanQuery(self):
 
         class TestQueryParser(BooleanTestMixin, PythonQueryParser):
-            pass
+            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))
@@ -46,7 +47,8 @@ class PythonMultiFieldQueryParserTestCas
     def testOverrideBooleanQuery(self):
 
         class TestQueryParser(BooleanTestMixin, PythonMultiFieldQueryParser):
-            pass
+            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))



Mime
View raw message