org.apache.lucene.search

Class WildcardQuery

Implemented Interfaces:
Cloneable, java.io.Serializable

public class WildcardQuery
extends MultiTermQuery

Implements the wildcard search query. Supported wildcards are *, which matches any character sequence (including the empty one), and ?, which matches any single character. Note this query can be slow, as it needs to iterate over all terms. In order to prevent extremely slow WildcardQueries, a Wildcard term must not start with one of the wildcards * or ?.
See Also:
WildcardTermEnum, Serialized Form

Constructor Summary

WildcardQuery(Term term)
Constructs a query for terms matching term.

Method Summary

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

Methods inherited from class org.apache.lucene.search.MultiTermQuery

combine, getEnum, getTerm, rewrite, toString

Methods inherited from class org.apache.lucene.search.Query

clone, combine, createWeight, getBoost, getSimilarity, mergeBooleanQueries, rewrite, setBoost, toString, toString, weight

Constructor Details

WildcardQuery

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

Method Details

getEnum

protected FilteredTermEnum getEnum(IndexReader reader)
            throws IOException
Construct the enumeration to be used, expanding the pattern term.
Overrides:
getEnum in interface MultiTermQuery

Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.