mirror of https://github.com/apache/lucene.git
- LUCENE-796: Don't call super.get*Query(....) to let sub-classes override.
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@525682 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
80d54c70ae
commit
9d7f9911a4
|
@ -37,6 +37,10 @@ API Changes
|
|||
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)
|
||||
|
|
|
@ -35,9 +35,8 @@ import java.util.Map;
|
|||
*/
|
||||
public class MultiFieldQueryParser extends QueryParser
|
||||
{
|
||||
|
||||
private String[] fields;
|
||||
private Map boosts;
|
||||
protected String[] fields;
|
||||
protected Map boosts;
|
||||
|
||||
/**
|
||||
* Creates a MultiFieldQueryParser.
|
||||
|
@ -100,7 +99,7 @@ public class MultiFieldQueryParser extends QueryParser
|
|||
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 @@ public class MultiFieldQueryParser extends QueryParser
|
|||
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 @@ public class MultiFieldQueryParser extends QueryParser
|
|||
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 @@ public class MultiFieldQueryParser extends QueryParser
|
|||
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,7 +174,7 @@ public class MultiFieldQueryParser extends QueryParser
|
|||
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);
|
||||
|
@ -183,9 +182,6 @@ public class MultiFieldQueryParser extends QueryParser
|
|||
return super.getRangeQuery(field, part1, part2, inclusive);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Parses a query which searches on the fields specified.
|
||||
* <p>
|
||||
|
@ -217,7 +213,6 @@ public class MultiFieldQueryParser extends QueryParser
|
|||
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 @@ public class MultiFieldQueryParser extends QueryParser
|
|||
return bQuery;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Parses a query, searching on the fields specified.
|
||||
* Use this if you need to specify certain fields as required,
|
||||
|
|
Loading…
Reference in New Issue