TokenCountRouter query used to trigger a particular query by counting the number of tokens in the user query.
More...
|
| __construct ( $text, AbstractQuery $fallbackQuery, $field=null, $analyzer=null) |
|
| setText ( $text) |
|
| setFallback (AbstractQuery $query) |
|
| setField ( $field) |
|
| setAnalyzer ( $analyzer) |
|
| addCondition ( $type, $value, AbstractQuery $query) |
| Adds a new condition The first condition that evaluates to true is applied.
|
|
|
const | GT = 'gt' |
| @const string greater than
|
|
const | GTE = 'gte' |
| @const string greater or equal
|
|
const | EQ = 'eq' |
| @const string equal
|
|
const | NEQ = 'neq' |
| @const string not equal
|
|
const | LTE = 'lte' |
| @const string less than or equal
|
|
const | LT = 'lt' |
| @const string less than
|
|
◆ __construct()
CirrusSearch\Extra\Query\TokenCountRouter::__construct |
( |
| $text, |
|
|
AbstractQuery | $fallbackQuery, |
|
|
| $field = null, |
|
|
| $analyzer = null ) |
- Parameters
-
string | $text | the text to analyze |
AbstractQuery | $fallbackQuery | the query to run when no conditions match |
string | null | $field | use the analyzer of this field |
string | null | $analyzer | use this analyzer |
◆ addCondition()
CirrusSearch\Extra\Query\TokenCountRouter::addCondition |
( |
| $type, |
|
|
| $value, |
|
|
AbstractQuery | $query ) |
Adds a new condition The first condition that evaluates to true is applied.
If none match the fallback query is applied.
- Parameters
-
string | $type | the condition to apply |
int | $value | the value to compare |
AbstractQuery | $query | the query to run if the condition is true ignoring all remaining conditions |
- Returns
- self
◆ setAnalyzer()
CirrusSearch\Extra\Query\TokenCountRouter::setAnalyzer |
( |
| $analyzer | ) |
|
- Parameters
-
string | $analyzer | the field to fetch analyzer info |
- Returns
- self
◆ setFallback()
CirrusSearch\Extra\Query\TokenCountRouter::setFallback |
( |
AbstractQuery | $query | ) |
|
◆ setField()
CirrusSearch\Extra\Query\TokenCountRouter::setField |
( |
| $field | ) |
|
- Parameters
-
string | $field | the field to fetch analyzer info |
- Returns
- self
◆ setText()
CirrusSearch\Extra\Query\TokenCountRouter::setText |
( |
| $text | ) |
|
- Parameters
-
string | $text | count tokens from this text |
- Returns
- self
The documentation for this class was generated from the following file:
- includes/Extra/Query/TokenCountRouter.php