public class MultiPhraseQuery extends Query
PhraseQuery, with the possibility of
 adding more than one term at the same position that are treated as a disjunction (OR).
 To use this class to search for the phrase "Microsoft app*" first create a Builder and use
 MultiPhraseQuery.Builder.add(Term) on the term "microsoft" (assuming lowercase analysis), then
 find all terms that have "app" as prefix using LeafReader.terms(String),
 seeking to "app" then iterating and collecting terms until there is no longer
 that prefix, and finally use MultiPhraseQuery.Builder.add(Term[]) to add them.
 MultiPhraseQuery.Builder.build() returns the fully constructed (and immutable) MultiPhraseQuery.| Modifier and Type | Class and Description | 
|---|---|
| static class  | MultiPhraseQuery.BuilderA builder for multi-phrase queries | 
| Modifier and Type | Method and Description | 
|---|---|
| Weight | createWeight(IndexSearcher searcher,
            boolean needsScores)Expert: Constructs an appropriate Weight implementation for this query. | 
| boolean | equals(Object other)Returns true if  ois equal to this. | 
| int[] | getPositions()Returns the relative positions of terms in this phrase. | 
| int | getSlop()Sets the phrase slop for this query. | 
| Term[][] | getTermArrays()Returns the arrays of arrays of terms in the multi-phrase. | 
| int | hashCode()Returns a hash code value for this object. | 
| Query | rewrite(IndexReader reader)Expert: called to re-write queries into primitive queries. | 
| String | toString(String f)Prints a user-readable version of this query. | 
classHash, sameClassAs, toStringpublic int getSlop()
PhraseQuery.getSlop()public Term[][] getTermArrays()
public int[] getPositions()
public Query rewrite(IndexReader reader) throws IOException
Queryrewrite in class QueryIOExceptionpublic Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException
QueryOnly implemented by primitive queries, which re-write to themselves.
createWeight in class QueryneedsScores - True if document scores (Scorer.score()) or match
                      frequencies (Scorer.freq()) are needed.IOExceptionpublic boolean equals(Object other)
o is equal to this.equals in class QueryQuery.sameClassAs(Object), 
Query.classHash()public int hashCode()
hashCode in class QueryQuery.equals(Object)Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.