Apache Lucene open-source search software
added missing extractTerms() to DisjunctionMaxQuery: LUCENE-541
Yonik Seeley901d7ca63525
diff --git a/CHANGES.txt b/CHANGES.txtindex d278c734abd..32de72fe294 100644--- a/CHANGES.txt+++ b/CHANGES.txt@@ -38,6 +38,9 @@ Bug fixessubsequent String sorts with different locales to sort identically.(Paul Cowan via Yonik Seeley)+ 8. LUCENE-541: Add missing extractTerms() to DisjunctionMaxQuery+ (Stefan Will via Yonik Seeley)+1.9.1Bug fixesdiff --git a/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java b/src/java/org/apache/lucene/search/DisjunctionMaxQuery.javaindex 8ec30540b75..9a32728d2a0 100644--- a/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java+++ b/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java@@ -22,6 +22,7 @@ import java.io.IOException;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@@ -193,6 +194,15 @@ public class DisjunctionMaxQuery extends Query {return clone;}++ // inherit javadoc+ public void extractTerms(Set terms) {+ for (int i = 0; i < disjuncts.size(); i++) {+ ((Query)disjuncts.get(i)).extractTerms(terms);+ }+ }++/** Prettyprint us.* @param field the field to which we are applied* @return a string that shows what we do, of the form "(disjunct1 | disjunct2 | ... | disjunctn)^boost"