Module org.elasticsearch.server
Class MultiPhrasePrefixQuery
java.lang.Object
org.apache.lucene.search.Query
org.elasticsearch.common.lucene.search.MultiPhrasePrefixQuery
public class MultiPhrasePrefixQuery
extends org.apache.lucene.search.Query
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(org.apache.lucene.index.Term term) Add a single term at the next position in the phrase.voidadd(org.apache.lucene.index.Term[] terms) Add multiple terms at the next position in the phrase.voidadd(org.apache.lucene.index.Term[] terms, int position) Allows to specify the relative position of terms within the phrase.booleanReturns true ifois equal to this.int[]Returns the relative positions of terms in this phrase.intgetSlop()Sets the phrase slop for this query.org.apache.lucene.index.Term[][]getTerms()Returns the terms for each position in this phraseinthashCode()Returns a hash code value for this object.org.apache.lucene.search.Queryrewrite(org.apache.lucene.search.IndexSearcher searcher) voidsetMaxExpansions(int maxExpansions) voidsetSlop(int s) Sets the phrase slop for this query.final Stringvoidvisit(org.apache.lucene.search.QueryVisitor visitor) Methods inherited from class org.apache.lucene.search.Query
classHash, createWeight, sameClassAs, toString
-
Constructor Details
-
MultiPhrasePrefixQuery
-
-
Method Details
-
setSlop
public void setSlop(int s) Sets the phrase slop for this query.- See Also:
-
setMaxExpansions
public void setMaxExpansions(int maxExpansions) -
getSlop
public int getSlop()Sets the phrase slop for this query.- See Also:
-
add
public void add(org.apache.lucene.index.Term term) Add a single term at the next position in the phrase.- See Also:
-
add
public void add(org.apache.lucene.index.Term[] terms) Add multiple terms at the next position in the phrase. Any of the terms may match.- See Also:
-
add
public void add(org.apache.lucene.index.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:
-
getTerms
public org.apache.lucene.index.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 org.apache.lucene.search.Query rewrite(org.apache.lucene.search.IndexSearcher searcher) throws IOException - Overrides:
rewritein classorg.apache.lucene.search.Query- Throws:
IOException
-
toString
- Specified by:
toStringin classorg.apache.lucene.search.Query
-
equals
Returns true ifois equal to this.- Specified by:
equalsin classorg.apache.lucene.search.Query
-
hashCode
public int hashCode()Returns a hash code value for this object.- Specified by:
hashCodein classorg.apache.lucene.search.Query
-
visit
public void visit(org.apache.lucene.search.QueryVisitor visitor) - Specified by:
visitin classorg.apache.lucene.search.Query
-