Index: src/java/org/apache/lucene/search/MultiPhraseQuery.java =================================================================== --- src/java/org/apache/lucene/search/MultiPhraseQuery.java (revision 384173) +++ src/java/org/apache/lucene/search/MultiPhraseQuery.java (working copy) @@ -18,7 +18,9 @@ import java.io.IOException; import java.util.ArrayList; +import java.util.Collections; import java.util.Iterator; +import java.util.List; import java.util.Vector; import org.apache.lucene.index.IndexReader; @@ -41,7 +43,7 @@ */ public class MultiPhraseQuery extends Query { private String field; - private ArrayList termArrays = new ArrayList(); + private List termArrays = new ArrayList(); private Vector positions = new Vector(); private int slop = 0; @@ -96,7 +98,11 @@ termArrays.add(terms); positions.addElement(new Integer(position)); } - + + public List getTerms() { + return Collections.unmodifiableList(termArrays); + } + /** * Returns the relative positions of terms in this phrase. */