Class MultiPhrasePrefixQuery


  • public class MultiPhrasePrefixQuery
    extends Query
    • Constructor Detail

      • MultiPhrasePrefixQuery

        public MultiPhrasePrefixQuery​(String field)
    • Method Detail

      • setMaxExpansions

        public void setMaxExpansions​(int maxExpansions)
      • add

        public void add​(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 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: Query
        Expert: called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into a BooleanQuery that consists of TermQuerys.
        Overrides:
        rewrite in class Query
        Throws:
        IOException
      • toString

        public final String toString​(String f)
        Description copied from class: Query
        Prints a query to a string, with field assumed to be the default field and omitted.
        Specified by:
        toString in class Query
      • getField

        public String getField()