Index: DisjunctionMaxQuery.java =================================================================== --- DisjunctionMaxQuery.java (revision 391800) +++ DisjunctionMaxQuery.java (working copy) @@ -22,6 +22,7 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.Collection; +import java.util.Set; /** * A query that generates the union of the documents produced by its subqueries, and that scores each document as the maximum @@ -242,5 +243,18 @@ + Float.floatToIntBits(tieBreakerMultiplier) + disjuncts.hashCode(); } + + /** + * Expert: adds all terms occuring in this query to the terms set. Only + * works if this query is in its {@link #rewrite rewritten} form. + * + * @throws UnsupportedOperationException if this query is not yet rewritten + */ + public void extractTerms(Set terms) { + for (int i = 0; i < disjuncts.size(); i++) { + ((Query)disjuncts.get(i)).extractTerms(terms); + } + } +} -} +