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 
    Constructor Description
    MultiPhrasePrefixQuery​(java.lang.String field)  
  • Method Summary

    Modifier and Type Method Description
    void add​(org.apache.lucene.index.Term term)
    Add a single term at the next position in the phrase.
    void add​(org.apache.lucene.index.Term[] terms)
    Add multiple terms at the next position in the phrase.
    void add​(org.apache.lucene.index.Term[] terms, int position)
    Allows to specify the relative position of terms within the phrase.
    boolean equals​(java.lang.Object o)
    Returns true if o is equal to this.
    java.lang.String getField()  
    int[] getPositions()
    Returns the relative positions of terms in this phrase.
    int getSlop()
    Sets the phrase slop for this query.
    org.apache.lucene.index.Term[][] getTerms()
    Returns the terms for each position in this phrase
    int hashCode()
    Returns a hash code value for this object.
    org.apache.lucene.search.Query rewrite​(org.apache.lucene.index.IndexReader reader)  
    void setMaxExpansions​(int maxExpansions)  
    void setSlop​(int s)
    Sets the phrase slop for this query.
    java.lang.String toString​(java.lang.String f)  

    Methods inherited from class org.apache.lucene.search.Query

    classHash, createWeight, sameClassAs, toString, visit

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

  • Method Details

    • 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​(org.apache.lucene.index.Term term)
      Add a single term at the next position in the phrase.
      See Also:
      PhraseQuery.Builder.add(Term)
    • 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:
      PhraseQuery.Builder.add(Term)
    • 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 terms
      position - the position of the terms provided as argument
      See Also:
      PhraseQuery.Builder.add(Term, int)
    • 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.index.IndexReader reader) throws java.io.IOException
      Overrides:
      rewrite in class org.apache.lucene.search.Query
      Throws:
      java.io.IOException
    • toString

      public final java.lang.String toString​(java.lang.String f)
      Specified by:
      toString in class org.apache.lucene.search.Query
    • equals

      public boolean equals​(java.lang.Object o)
      Returns true if o is equal to this.
      Specified by:
      equals in class org.apache.lucene.search.Query
    • hashCode

      public int hashCode()
      Returns a hash code value for this object.
      Specified by:
      hashCode in class org.apache.lucene.search.Query
    • getField

      public java.lang.String getField()