Documentation of 'org.apache.lucene.search.PrefixQuery' Java class
PrefixQuery
org.apache.lucene.search

Class PrefixQuery

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable


    public class PrefixQuery
    extends Query
    A Query that matches documents containing terms with a specified prefix. A PrefixQuery is built by QueryParser for input like app*.
    See Also:
    Serialized Form
    • Constructor Detail

      • PrefixQuery

        public PrefixQuery(Term prefix)
        Constructs a query for terms starting with prefix.
    • Method Detail

      • getPrefix

        public Term getPrefix()
        Returns the prefix of this query.
      • rewrite

        public Query rewrite(IndexReader reader)
                      throws java.io.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:
        java.io.IOException
      • toString

        public java.lang.String toString(java.lang.String field)
        Prints a user-readable version of this query.
        Specified by:
        toString in class Query
      • equals

        public boolean equals(java.lang.Object o)
        Returns true iff o is equal to this.
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Returns a hash code value for this object.
        Overrides:
        hashCode in class java.lang.Object

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.