Home » lucene-3.0.1-src » org.apache » lucene » search » [javadoc | source]
public class: MultiPhraseQuery [javadoc | source]

All Implemented Interfaces:
    Cloneable, Serializable

MultiPhraseQuery is a generalized version of PhraseQuery, with an added method #add(Term[]) . To use this class, to search for the phrase "Microsoft app*" first use add(Term) on the term "Microsoft", then find all terms that have "app" as prefix using IndexReader.terms(Term), and use MultiPhraseQuery.add(Term[] terms) to add them to the query.
Method from org.apache.lucene.search.MultiPhraseQuery Summary:
add,   add,   add,   createWeight,   equals,   extractTerms,   getPositions,   getSlop,   getTermArrays,   hashCode,   rewrite,   setSlop,   toString
Methods from org.apache.lucene.search.Query:
clone,   combine,   createWeight,   equals,   extractTerms,   getBoost,   getSimilarity,   hashCode,   mergeBooleanQueries,   rewrite,   setBoost,   toString,   toString,   weight
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.lucene.search.MultiPhraseQuery Detail:
 public  void add(Term term) 
    Add a single term at the next position in the phrase.
 public  void add(Term[] terms) 
    Add multiple terms at the next position in the phrase. Any of the terms may match.
 public  void add(Term[] terms,
    int position) 
    Allows to specify the relative position of terms within the phrase.
 public Weight createWeight(Searcher searcher) throws IOException 
 public boolean equals(Object o) 
    Returns true if o is equal to this.
 public  void extractTerms(Set<Term> terms) 
 public int[] getPositions() 
    Returns the relative positions of terms in this phrase.
 public int getSlop() 
    Sets the phrase slop for this query.
 public List<Term> getTermArrays() 
    Returns a List of the terms in the multiphrase. Do not modify the List or its contents.
 public int hashCode() 
    Returns a hash code value for this object.
 public Query rewrite(IndexReader reader) 
 public  void setSlop(int s) 
    Sets the phrase slop for this query.
 public final String toString(String f) 
    Prints a user-readable version of this query.