Source regex filter for trigram accelerated regex matching.
More...
◆ __construct()
CirrusSearch\Extra\Query\SourceRegex::__construct |
( |
| $regex = null, |
|
|
| $field = null, |
|
|
| $ngramField = null ) |
- Parameters
-
null | string | $regex | optional regex to match against field |
null | string | $field | optional field who's source to check with the regex |
null | string | $ngramField | optional field that is indexed with ngrams to accelerate regex matching |
◆ setCaseSensitive()
CirrusSearch\Extra\Query\SourceRegex::setCaseSensitive |
( |
| $caseSensitive | ) |
|
- Parameters
-
bool | $caseSensitive | is the regex case insensitive? Defaults to case insensitive if not set. |
- Returns
- self
◆ setField()
CirrusSearch\Extra\Query\SourceRegex::setField |
( |
| $field | ) |
|
- Parameters
-
string | $field | field who's source to check with the regex |
- Returns
- self
◆ setGramSize()
CirrusSearch\Extra\Query\SourceRegex::setGramSize |
( |
| $gramSize | ) |
|
- Parameters
-
int | $gramSize | size of the ngrams extracted for accelerating the regex. Defaults to 3 if not set. That gram size must have been produced by analyzing the ngramField. |
- Returns
- self
◆ setLocale()
CirrusSearch\Extra\Query\SourceRegex::setLocale |
( |
| $locale | ) |
|
- Parameters
-
string | $locale | locale used for case conversions. Its important that this matches the locale used for lowercasing in the ngram index. |
- Returns
- self
◆ setMaxDeterminizedStates()
CirrusSearch\Extra\Query\SourceRegex::setMaxDeterminizedStates |
( |
| $maxDeterminizedStates | ) |
|
- Parameters
-
int | $maxDeterminizedStates | maximum number of automaton states that Lucene's regex compilation can expand to (even temporarily) |
- Returns
- self
◆ setMaxExpand()
CirrusSearch\Extra\Query\SourceRegex::setMaxExpand |
( |
| $maxExpand | ) |
|
- Parameters
-
int | $maxExpand | maximum range before outgoing automaton arcs are ignored. Roughly corresponds to the maximum number of characters in a character class ([abcd]) before it is treated as . for purposes of acceleration. Defaults to 4. |
- Returns
- self
◆ setMaxInspect()
CirrusSearch\Extra\Query\SourceRegex::setMaxInspect |
( |
| $maxInspect | ) |
|
- Parameters
-
int | $maxInspect | maximum number of source field to run the regex against before giving up and just declaring all remaining fields not matching by fiat. Defaults to MAX_INT. Set this to 10000 or something nice and low to prevent regular expressions that cannot be sped up from taking up too many resources. |
- Returns
- self
◆ setMaxNgramClauses()
CirrusSearch\Extra\Query\SourceRegex::setMaxNgramClauses |
( |
| $maxNgramClauses | ) |
|
- Parameters
-
int | $maxNgramClauses | The maximum number of boolean clauses generated from extracted ngrams. |
- Returns
- self
◆ setMaxNgramsExtracted()
CirrusSearch\Extra\Query\SourceRegex::setMaxNgramsExtracted |
( |
| $maxNgrams | ) |
|
- Parameters
-
int | $maxNgrams | The maximum number of ngrams to extracted from the regex. If more could be extracted from the regex tey are ignored. |
- Returns
- self
◆ setMaxStatesTraced()
CirrusSearch\Extra\Query\SourceRegex::setMaxStatesTraced |
( |
| $maxStatesTraced | ) |
|
- Parameters
-
int | $maxStatesTraced | maximum number of automaton states that can be traced before the algorithm gives up and assumes the regex is too complex and throws an error back to the user. Defaults to 10000 which handily covers all regexes I cared to test. |
- Returns
- self
◆ setNGramField()
CirrusSearch\Extra\Query\SourceRegex::setNGramField |
( |
| $ngramField | ) |
|
- Parameters
-
string | $ngramField | field that is indexed with ngrams to accelerate regex matching |
- Returns
- self
◆ setRegex()
CirrusSearch\Extra\Query\SourceRegex::setRegex |
( |
| $regex | ) |
|
- Parameters
-
string | $regex | regex to match against field |
- Returns
- self
The documentation for this class was generated from the following file:
- includes/Extra/Query/SourceRegex.php