C# Class Lucene.Net.Search.RegexpQuery

A fast regular expression query based on the Lucene.Net.Util.Automaton package.
  • Comparisons are fast
  • The term dictionary is enumerated in an intelligent way, to avoid comparisons. See AutomatonQuery for more details.

The supported syntax is documented in the RegExp class. Note this might be different than other regular expression implementations. For some alternatives with different syntax, look under the sandbox.

Note this query can be slow, as it needs to iterate over many terms. In order to prevent extremely slow RegexpQueries, a Regexp term should not start with the expression .*

Inheritance: AutomatonQuery
Datei anzeigen Open project: paulirwin/lucene.net Class Usage Examples

Public Methods

Method Description
RegexpQuery ( Term term ) : System.Text

Constructs a query for terms matching term.

By default, all regular expression features are enabled.

RegexpQuery ( Term term, int flags ) : System.Text

Constructs a query for terms matching term.

RegexpQuery ( Term term, int flags, AutomatonProvider provider ) : System.Text

Constructs a query for terms matching term.

ToString ( string field ) : string

Prints a user-readable version of this query.

Method Details

RegexpQuery() public method

Constructs a query for terms matching term.

By default, all regular expression features are enabled.

public RegexpQuery ( Term term ) : System.Text
term Term regular expression.
return System.Text

RegexpQuery() public method

Constructs a query for terms matching term.
public RegexpQuery ( Term term, int flags ) : System.Text
term Term regular expression.
flags int optional RegExp features from
return System.Text

RegexpQuery() public method

Constructs a query for terms matching term.
public RegexpQuery ( Term term, int flags, AutomatonProvider provider ) : System.Text
term Term regular expression.
flags int optional RegExp features from
provider AutomatonProvider custom AutomatonProvider for named automata
return System.Text

ToString() public method

Prints a user-readable version of this query.
public ToString ( string field ) : string
field string
return string