Class WildcardQuery
Implements the wildcard search query. Supported wildcards are , which
matches any character sequence (including the empty one), and
?
,
which matches any single character. '' is the escape 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 the wildcard
This query uses the CONSTANT_SCORE_AUTO_REWRITE_DEFAULT rewrite method.
Inherited Members
Namespace: Lucene.Net.Search
Assembly: Lucene.Net.dll
Syntax
public class WildcardQuery : AutomatonQuery
Constructors
| Improve this Doc View SourceWildcardQuery(Term)
Constructs a query for terms matching term
.
Declaration
public WildcardQuery(Term term)
Parameters
Type | Name | Description |
---|---|---|
Term | term |
Fields
| Improve this Doc View SourceWILDCARD_CHAR
Char equality with support for wildcards
Declaration
public const char WILDCARD_CHAR = '?'
Field Value
Type | Description |
---|---|
System.Char |
WILDCARD_ESCAPE
Escape character
Declaration
public const char WILDCARD_ESCAPE = '\\'
Field Value
Type | Description |
---|---|
System.Char |
WILDCARD_STRING
String equality with support for wildcards
Declaration
public const char WILDCARD_STRING = '*'
Field Value
Type | Description |
---|---|
System.Char |
Properties
| Improve this Doc View SourceTerm
Returns the pattern term.
Declaration
public virtual Term Term { get; }
Property Value
Type | Description |
---|---|
Term |
Methods
| Improve this Doc View SourceToAutomaton(Term)
Convert Lucene wildcard syntax into an automaton.
Note
This API is for internal purposes only and might change in incompatible ways in the next release.
Declaration
public static Automaton ToAutomaton(Term wildcardquery)
Parameters
Type | Name | Description |
---|---|---|
Term | wildcardquery |
Returns
Type | Description |
---|---|
Automaton |
ToString(String)
Prints a user-readable version of this query.
Declaration
public override string ToString(string field)
Parameters
Type | Name | Description |
---|---|---|
System.String | field |
Returns
Type | Description |
---|---|
System.String |