org.apache.lucene.search

Class MultiTermQuery

public abstract class MultiTermQuery extends Query

A {@link Query} that matches documents containing a subset of terms provided by a {@link FilteredTermEnum} enumeration.

MultiTermQuery is not designed to be used by itself.
The reason being that it is not intialized with a {@link FilteredTermEnum} enumeration. A {@link FilteredTermEnum} enumeration needs to be provided.

For example, {@link WildcardQuery} and {@link FuzzyQuery} extend MultiTermQuery to provide {@link WildcardTermEnum} and {@link FuzzyTermEnum}, respectively.

Constructor Summary
MultiTermQuery(Term term)
Constructs a query for terms matching term.
Method Summary
Querycombine(Query[] queries)
protected abstract FilteredTermEnumgetEnum(IndexReader reader)
Construct the enumeration to be used, expanding the pattern term.
TermgetTerm()
Returns the pattern term.
Queryrewrite(IndexReader reader)
StringtoString(String field)
Prints a user-readable version of this query.

Constructor Detail

MultiTermQuery

public MultiTermQuery(Term term)
Constructs a query for terms matching term.

Method Detail

combine

public Query combine(Query[] queries)

getEnum

protected abstract FilteredTermEnum getEnum(IndexReader reader)
Construct the enumeration to be used, expanding the pattern term.

getTerm

public Term getTerm()
Returns the pattern term.

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.