Apache Lucene open-source search software
LUCENE-1784: make Weight impls for BooleanQuery & DisjunctionMaxQuery protected to permit expert subclassing
Michael McCandless7b9856b7d213
diff --git a/src/java/org/apache/lucene/search/BooleanQuery.java b/src/java/org/apache/lucene/search/BooleanQuery.javaindex b156a7bf62e..52b1fd04ed3 100644--- a/src/java/org/apache/lucene/search/BooleanQuery.java+++ b/src/java/org/apache/lucene/search/BooleanQuery.java@@ -172,8 +172,18 @@ public class BooleanQuery extends Query {/** Returns the list of clauses in this query. */public List clauses() { return clauses; }- private class BooleanWeight extends QueryWeight {+ /**+ * Expert: the Weight for BooleanQuery, used to+ * normalize, score and explain these queries.+ *+ * <p>NOTE: this API and implementation is subject to+ * change suddenly in the next release.</p>+ */+ protected class BooleanWeight extends QueryWeight {+ /** The Similarity implementation. */protected Similarity similarity;++ /** The Weights for our subqueries, in 1-1 correspondence with clauses */protected ArrayList weights;public BooleanWeight(Searcher searcher)diff --git a/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java b/src/java/org/apache/lucene/search/DisjunctionMaxQuery.javaindex 3a0969e3652..93a733ead01 100644--- a/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java+++ b/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java@@ -85,11 +85,19 @@ public class DisjunctionMaxQuery extends Query {return disjuncts.iterator();}- /* The Weight for DisjunctionMaxQuery's, used to normalize, score and explain these queries */- private class DisjunctionMaxWeight extends QueryWeight {+ /**+ * Expert: the Weight for DisjunctionMaxQuery, used to+ * normalize, score and explain these queries.+ *+ * <p>NOTE: this API and implementation is subject to+ * change suddenly in the next release.</p>+ */+ protected class DisjunctionMaxWeight extends QueryWeight {+ /** The Similarity implementation. */+ protected Similarity similarity;- private Similarity similarity; // The similarity which we are associated.- private ArrayList weights = new ArrayList(); // The Weight's for our subqueries, in 1-1 correspondence with disjuncts+ /** The Weights for our subqueries, in 1-1 correspondence with disjuncts */+ protected ArrayList weights = new ArrayList();/* Construct the Weight for this Query searched by searcher. Recursively construct subquery weights. */public DisjunctionMaxWeight(Searcher searcher) throws IOException {