org.apache.lucene.search

Class PrefixQuery

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*.
Constructor Summary
PrefixQuery(Term prefix)
Constructs a query for terms starting with prefix.
Method Summary
booleanequals(Object o)
Returns true iff o is equal to this.
TermgetPrefix()
Returns the prefix of this query.
inthashCode()
Returns a hash code value for this object.
Queryrewrite(IndexReader reader)
StringtoString(String field)
Prints a user-readable version of this query.

Constructor Detail

PrefixQuery

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

Method Detail

equals

public boolean equals(Object o)
Returns true iff o is equal to this.

getPrefix

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

hashCode

public int hashCode()
Returns a hash code value for this object.

rewrite

public Query rewrite(IndexReader reader)

toString

public String toString(String field)
Prints a user-readable version of this query.
Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.