Class MultiPhrasePrefixQuery
- java.lang.Object
-
- org.apache.lucene.search.Query
-
- org.elasticsearch.common.lucene.search.MultiPhrasePrefixQuery
-
public class MultiPhrasePrefixQuery extends Query
-
-
Constructor Summary
Constructors Constructor Description MultiPhrasePrefixQuery(String field)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Term term)Add a single term at the next position in the phrase.voidadd(Term[] terms)Add multiple terms at the next position in the phrase.voidadd(Term[] terms, int position)Allows to specify the relative position of terms within the phrase.booleanequals(Object o)Returns true ifois equal to this.StringgetField()int[]getPositions()Returns the relative positions of terms in this phrase.intgetSlop()Sets the phrase slop for this query.Term[][]getTerms()Returns the terms for each position in this phraseinthashCode()Returns a hash code value for this object.Queryrewrite(IndexReader reader)Expert: called to re-write queries into primitive queries.voidsetMaxExpansions(int maxExpansions)voidsetSlop(int s)Sets the phrase slop for this query.StringtoString(String f)Prints a query to a string, withfieldassumed to be the default field and omitted.-
Methods inherited from class org.apache.lucene.search.Query
classHash, createWeight, sameClassAs, toString, visit
-
-
-
-
Constructor Detail
-
MultiPhrasePrefixQuery
public MultiPhrasePrefixQuery(String field)
-
-
Method Detail
-
setSlop
public void setSlop(int s)
Sets the phrase slop for this query.- See Also:
PhraseQuery.Builder.setSlop(int)
-
setMaxExpansions
public void setMaxExpansions(int maxExpansions)
-
getSlop
public int getSlop()
Sets the phrase slop for this query.- See Also:
PhraseQuery.getSlop()
-
add
public void add(Term term)
Add a single term at the next position in the phrase.- See Also:
PhraseQuery.Builder.add(Term)
-
add
public void add(Term[] terms)
Add multiple terms at the next position in the phrase. Any of the terms may match.- See Also:
PhraseQuery.Builder.add(Term)
-
add
public void add(Term[] terms, int position)
Allows to specify the relative position of terms within the phrase.- Parameters:
terms- the termsposition- the position of the terms provided as argument- See Also:
PhraseQuery.Builder.add(Term, int)
-
getTerms
public Term[][] getTerms()
Returns the terms for each position in this phrase
-
getPositions
public int[] getPositions()
Returns the relative positions of terms in this phrase.
-
rewrite
public Query rewrite(IndexReader reader) throws IOException
Description copied from class:QueryExpert: called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into a BooleanQuery that consists of TermQuerys.- Overrides:
rewritein classQuery- Throws:
IOException
-
toString
public final String toString(String f)
Description copied from class:QueryPrints a query to a string, withfieldassumed to be the default field and omitted.
-
equals
public boolean equals(Object o)
Returns true ifois equal to this.- Specified by:
equalsin classQuery- See Also:
Query.sameClassAs(Object),Query.classHash()
-
hashCode
public int hashCode()
Returns a hash code value for this object.- Specified by:
hashCodein classQuery- See Also:
Query.equals(Object)
-
getField
public String getField()
-
-