org.apache.lucene.search

Class PrefixQuery

public class PrefixQuery extends Query

A Query that matches documents containing terms with a specified prefix.
Constructor Summary
PrefixQuery(Term prefix)
Constructs a query for terms starting with prefix.
Method Summary
Querycombine(Query[] queries)
TermgetPrefix()
Returns the prefix of this query.
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

combine

public Query combine(Query[] queries)

getPrefix

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

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.