CirrusSearch
Elasticsearch-powered search for MediaWiki
Loading...
Searching...
No Matches
CirrusSearch\Extra\Query\TokenCountRouter Class Reference

TokenCountRouter query used to trigger a particular query by counting the number of tokens in the user query. More...

+ Inheritance diagram for CirrusSearch\Extra\Query\TokenCountRouter:
+ Collaboration diagram for CirrusSearch\Extra\Query\TokenCountRouter:

Public Member Functions

 __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.
 

Public Attributes

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
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

CirrusSearch\Extra\Query\TokenCountRouter::__construct ( $text,
AbstractQuery $fallbackQuery,
$field = null,
$analyzer = null )
Parameters
string$textthe text to analyze
AbstractQuery$fallbackQuerythe query to run when no conditions match
string | null$fielduse the analyzer of this field
string | null$analyzeruse this analyzer

Member Function Documentation

◆ 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$typethe condition to apply
int$valuethe value to compare
AbstractQuery$querythe query to run if the condition is true ignoring all remaining conditions
Returns
self

◆ setAnalyzer()

CirrusSearch\Extra\Query\TokenCountRouter::setAnalyzer ( $analyzer)
Parameters
string$analyzerthe field to fetch analyzer info
Returns
self

◆ setFallback()

CirrusSearch\Extra\Query\TokenCountRouter::setFallback ( AbstractQuery $query)
Parameters
AbstractQuery$query
Returns
self

◆ setField()

CirrusSearch\Extra\Query\TokenCountRouter::setField ( $field)
Parameters
string$fieldthe field to fetch analyzer info
Returns
self

◆ setText()

CirrusSearch\Extra\Query\TokenCountRouter::setText ( $text)
Parameters
string$textcount tokens from this text
Returns
self

The documentation for this class was generated from the following file: