lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o...@apache.org
Subject svn commit: r525682 - in /lucene/java/trunk: CHANGES.txt src/java/org/apache/lucene/queryParser/MultiFieldQueryParser.java
Date Thu, 05 Apr 2007 02:06:47 GMT
Author: otis
Date: Wed Apr  4 19:06:46 2007
New Revision: 525682

URL: http://svn.apache.org/viewvc?view=rev&rev=525682
Log:
- LUCENE-796: Don't call super.get*Query(....) to let sub-classes override.

Modified:
    lucene/java/trunk/CHANGES.txt
    lucene/java/trunk/src/java/org/apache/lucene/queryParser/MultiFieldQueryParser.java

Modified: lucene/java/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/CHANGES.txt?view=diff&rev=525682&r1=525681&r2=525682
==============================================================================
--- lucene/java/trunk/CHANGES.txt (original)
+++ lucene/java/trunk/CHANGES.txt Wed Apr  4 19:06:46 2007
@@ -37,6 +37,10 @@
  5. LUCENE-834: Changed some access levels for certain Span classes to allow them to be overridden.
 They have
     been marked expert only and not for public consumption. (Grant Ingersoll) 
 
+ 6. LUCENE-796: Removed calls to super.* from various get*Query methods in
+    MultiFieldQueryParser, in order to allow sub-classes to override them.
+    (Steven Parkes via Otis Gospodnetic)
+
 Bug fixes
 
  1. LUCENE-804: Fixed build.xml to pack a fully compilable src dist.  (Doron Cohen)

Modified: lucene/java/trunk/src/java/org/apache/lucene/queryParser/MultiFieldQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/queryParser/MultiFieldQueryParser.java?view=diff&rev=525682&r1=525681&r2=525682
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/queryParser/MultiFieldQueryParser.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/queryParser/MultiFieldQueryParser.java Wed
Apr  4 19:06:46 2007
@@ -35,9 +35,8 @@
  */
 public class MultiFieldQueryParser extends QueryParser
 {
-  
-  private String[] fields;
-  private Map      boosts;
+  protected String[] fields;
+  protected Map      boosts;
 
   /**
    * Creates a MultiFieldQueryParser. 
@@ -100,7 +99,7 @@
     if (field == null) {
       Vector clauses = new Vector();
       for (int i = 0; i < fields.length; i++) {
-        Query q = super.getFieldQuery(fields[i], queryText);
+        Query q = getFieldQuery(fields[i], queryText);
         if (q != null) {
           //If the user passes a map of boosts
           if (boosts != null) {
@@ -137,7 +136,7 @@
     if (field == null) {
       Vector clauses = new Vector();
       for (int i = 0; i < fields.length; i++) {
-        clauses.add(new BooleanClause(super.getFuzzyQuery(fields[i], termStr, minSimilarity),
+        clauses.add(new BooleanClause(getFuzzyQuery(fields[i], termStr, minSimilarity),
             BooleanClause.Occur.SHOULD));
       }
       return getBooleanQuery(clauses, true);
@@ -150,7 +149,7 @@
     if (field == null) {
       Vector clauses = new Vector();
       for (int i = 0; i < fields.length; i++) {
-        clauses.add(new BooleanClause(super.getPrefixQuery(fields[i], termStr),
+        clauses.add(new BooleanClause(getPrefixQuery(fields[i], termStr),
             BooleanClause.Occur.SHOULD));
       }
       return getBooleanQuery(clauses, true);
@@ -162,7 +161,7 @@
     if (field == null) {
       Vector clauses = new Vector();
       for (int i = 0; i < fields.length; i++) {
-        clauses.add(new BooleanClause(super.getWildcardQuery(fields[i], termStr),
+        clauses.add(new BooleanClause(getWildcardQuery(fields[i], termStr),
             BooleanClause.Occur.SHOULD));
       }
       return getBooleanQuery(clauses, true);
@@ -175,16 +174,13 @@
     if (field == null) {
       Vector clauses = new Vector();
       for (int i = 0; i < fields.length; i++) {
-        clauses.add(new BooleanClause(super.getRangeQuery(fields[i], part1, part2, inclusive),
+        clauses.add(new BooleanClause(getRangeQuery(fields[i], part1, part2, inclusive),
             BooleanClause.Occur.SHOULD));
       }
       return getBooleanQuery(clauses, true);
     }
     return super.getRangeQuery(field, part1, part2, inclusive);
   }
- 
-
-
 
   /**
    * Parses a query which searches on the fields specified.
@@ -217,7 +213,6 @@
     return bQuery;
   }
 
-
   /**
    * Parses a query, searching on the fields specified.
    * Use this if you need to specify certain fields as required,
@@ -261,7 +256,6 @@
     return bQuery;
   }
 
-  
   /**
    * Parses a query, searching on the fields specified.
    * Use this if you need to specify certain fields as required,



Mime
View raw message