CirrusSearch
Elasticsearch-powered search for MediaWiki
Loading...
Searching...
No Matches
CirrusSearch\Parser\QueryStringRegex\Token Class Reference

A token used in parsing the cirrus fulltext syntax. More...

Public Member Functions

 __construct ( $query)
 
 reset ()
 Reset the token state so that it can be reused.
 
 getImage ()
 Get the image of the token in the query.
 
 getType ()
 the token type
 
 setType ( $type, $start, $end)
 
 setOffsets ( $start, $end)
 
 eof ()
 
 node (ParsedNode $node)
 Initialize the token from a parsed node.
 
 getStart ()
 
 getEnd ()
 
 ignorable ()
 
 getNode ()
 Get the node if the token was initialized from a pre-parsed node.
 
 copyTo (Token $lookBehind)
 Copy state from this token to the token argument.
 

Static Public Member Functions

static getTypeLabels ( $types)
 
static getTypeLabel ( $type)
 

Public Attributes

const BOOL_AND = 1
 explicit boolean AND
 
const BOOL_OR = 2
 explicit boolean OR
 
const NOT = 3
 explicit negation
 
const PARSED_NODE = 4
 Parsed node, due to its "mixed" nature the parser is able is able to spawn complex nodes directly from the query string without using tokens.
 
const WHITESPACE = 5
 

Detailed Description

A token used in parsing the cirrus fulltext syntax.

Constructor & Destructor Documentation

◆ __construct()

CirrusSearch\Parser\QueryStringRegex\Token::__construct ( $query)
Parameters
string$query

Member Function Documentation

◆ copyTo()

CirrusSearch\Parser\QueryStringRegex\Token::copyTo ( Token $lookBehind)

Copy state from this token to the token argument.

Parameters
Token$lookBehind

◆ getEnd()

CirrusSearch\Parser\QueryStringRegex\Token::getEnd ( )
Returns
int end offset (excl)

◆ getImage()

CirrusSearch\Parser\QueryStringRegex\Token::getImage ( )

Get the image of the token in the query.

Returns
bool|null|string

◆ getNode()

CirrusSearch\Parser\QueryStringRegex\Token::getNode ( )

Get the node if the token was initialized from a pre-parsed node.

Returns
ParsedNode|null

◆ getStart()

CirrusSearch\Parser\QueryStringRegex\Token::getStart ( )
Returns
int start offset

◆ getType()

CirrusSearch\Parser\QueryStringRegex\Token::getType ( )

the token type

Returns
int

◆ getTypeLabel()

static CirrusSearch\Parser\QueryStringRegex\Token::getTypeLabel ( $type)
static
Parameters
int$type
Returns
string type labels

◆ getTypeLabels()

static CirrusSearch\Parser\QueryStringRegex\Token::getTypeLabels ( $types)
static
Parameters
int[] | int$types
Returns
string[] type labels

◆ ignorable()

CirrusSearch\Parser\QueryStringRegex\Token::ignorable ( )
Returns
bool true if this token can be ignored

◆ node()

CirrusSearch\Parser\QueryStringRegex\Token::node ( ParsedNode $node)

Initialize the token from a parsed node.

Parameters
ParsedNode$node

◆ setOffsets()

CirrusSearch\Parser\QueryStringRegex\Token::setOffsets ( $start,
$end )
Parameters
int$startoffset
int$endoffset (exc)

◆ setType()

CirrusSearch\Parser\QueryStringRegex\Token::setType ( $type,
$start,
$end )
Parameters
int$typetoken type
int$startoffset
int$endoffset (exc)

Member Data Documentation

◆ PARSED_NODE

const CirrusSearch\Parser\QueryStringRegex\Token::PARSED_NODE = 4

Parsed node, due to its "mixed" nature the parser is able is able to spawn complex nodes directly from the query string without using tokens.

The PARSED_NODE token type represent this type of "complex" token


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