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

Detects phrase queries: "simple phrase" : use the plain fields "simple phrase"~ : use the stem fields "simple phrase"~2 : force the slop to be 2 "simple phrase"~2~ : force the slop to be 2 and use the stem fields. More...

Public Member Functions

 __construct (Escaper $escaper)
 
 parse ( $query, $start, $end)
 

Public Attributes

const PHRASE_START = '/\G(?<negate>-|!)?"/'
 Start of a phrase.
 

Detailed Description

Detects phrase queries: "simple phrase" : use the plain fields "simple phrase"~ : use the stem fields "simple phrase"~2 : force the slop to be 2 "simple phrase"~2~ : force the slop to be 2 and use the stem fields.

The phrase can be negated using a ! or - Quotes can be escaped using \

Supports phrase prefix as well: "simple phras*" iff slop and stem are not provided otherwise we send a simple phrase node

Member Function Documentation

◆ parse()

CirrusSearch\Parser\QueryStringRegex\PhraseQueryParser::parse ( $query,
$start,
$end )
Parameters
string$query
int$start
int$end
Returns
PhraseQueryNode|PhrasePrefixNode|null

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