public class

WildcardQuery

extends MultiTermQuery
java.lang.Object
   ↳ org.apache.lucene.search.Query
     ↳ org.apache.lucene.search.MultiTermQuery
       ↳ org.apache.lucene.search.WildcardQuery

Class Overview

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 many terms. In order to prevent extremely slow WildcardQueries, a Wildcard term should not start with one of the wildcards * or ?.

This query uses the CONSTANT_SCORE_AUTO_REWRITE_DEFAULT rewrite method.

See Also

Summary

Fields
protected Term term
[Expand]
Inherited Fields
From class org.apache.lucene.search.MultiTermQuery
Public Constructors
WildcardQuery(Term term)
Public Methods
boolean equals(Object obj)
Term getTerm()
Returns the pattern term.
int hashCode()
Query rewrite(IndexReader reader)
Expert: called to re-write queries into primitive queries.
String toString(String field)
Prints a user-readable version of this query.
Protected Methods
FilteredTermEnum getEnum(IndexReader reader)
Construct the enumeration to be used, expanding the pattern term.
[Expand]
Inherited Methods
From class org.apache.lucene.search.MultiTermQuery
From class org.apache.lucene.search.Query
From class java.lang.Object

Fields

protected Term term

Public Constructors

public WildcardQuery (Term term)

Public Methods

public boolean equals (Object obj)

public Term getTerm ()

Returns the pattern term.

public int hashCode ()

public Query rewrite (IndexReader reader)

Expert: called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into a BooleanQuery that consists of TermQuerys.

Throws
IOException

public String toString (String field)

Prints a user-readable version of this query.

Protected Methods

protected FilteredTermEnum getEnum (IndexReader reader)

Construct the enumeration to be used, expanding the pattern term.

Throws
IOException