CirrusSearch
Elasticsearch-powered search for MediaWiki
Loading...
Searching...
No Matches
CirrusSearch\Search\SearchQueryBuilder Class Reference

Builder for SearchQuery. More...

Public Member Functions

 build ()
 
 addContextualFilter ( $name, ContextualFilter $filter)
 
 setInitialNamespaces (array $initialNamespaces)
 
 setCrossProjectSearch ( $crossProjectSearch)
 
 setCrossLanguageSearch ( $crossLanguageSearch)
 
 setSearchEngineEntryPoint ( $searchEngineEntryPoint)
 
 setSort ( $sort)
 
 setOffset ( $offset)
 
 setLimit ( $limit)
 
 setRandomSeed (?int $randomSeed)
 
 setDebugOptions (CirrusDebugOptions $debugOptions)
 
 setWithDYMSuggestion ( $withDYMSuggestion)
 
 setExtraIndicesSearch ( $extraIndicesSearch)
 
 addForcedProfile ( $type, $forcedProfile)
 
 setAllowRewrite ( $allowRewrite)
 
 addProfileContextParameter ( $key, $value)
 
 setExtraFieldsToExtract (array $fields)
 
 setProvideAllSnippets (bool $shouldProvide)
 

Static Public Member Functions

static newFTSearchQueryBuilder (SearchConfig $config, $queryString, NamespacePrefixParser $namespacePrefixParser, CirrusSearchHookRunner $cirrusSearchHookRunner)
 Construct a new FT (FullText) SearchQueryBuilder using the config and query string provided.
 
static forCrossProjectSearch (SearchConfig $config, SearchQuery $query)
 Recreate a SearchQueryBuilder using an existing query and the target wiki SearchConfig.
 
static forCrossLanguageSearch (SearchConfig $config, SearchQuery $original)
 
static forRewrittenQuery (SearchQuery $original, $term, NamespacePrefixParser $namespacePrefixParser, CirrusSearchHookRunner $cirrusSearchHookRunner)
 

Detailed Description

Builder for SearchQuery.

Member Function Documentation

◆ addContextualFilter()

CirrusSearch\Search\SearchQueryBuilder::addContextualFilter ( $name,
ContextualFilter $filter )
Parameters
string$name
ContextualFilter$filter
Returns
SearchQueryBuilder

◆ addForcedProfile()

CirrusSearch\Search\SearchQueryBuilder::addForcedProfile ( $type,
$forcedProfile )
Parameters
string$type
string$forcedProfile
Returns
SearchQueryBuilder

◆ addProfileContextParameter()

CirrusSearch\Search\SearchQueryBuilder::addProfileContextParameter ( $key,
$value )
Parameters
string$key
string$value
Returns
SearchQueryBuilder
See also
\CirrusSearch\Profile\ContextualProfileOverride

◆ build()

CirrusSearch\Search\SearchQueryBuilder::build ( )
Returns
SearchQuery

◆ forCrossLanguageSearch()

static CirrusSearch\Search\SearchQueryBuilder::forCrossLanguageSearch ( SearchConfig $config,
SearchQuery $original )
static
Parameters
SearchConfig$config
SearchQuery$original
Returns
SearchQueryBuilder

◆ forCrossProjectSearch()

static CirrusSearch\Search\SearchQueryBuilder::forCrossProjectSearch ( SearchConfig $config,
SearchQuery $query )
static

Recreate a SearchQueryBuilder using an existing query and the target wiki SearchConfig.

Parameters
SearchConfig$config
SearchQuery$query
Returns
SearchQueryBuilder

◆ forRewrittenQuery()

static CirrusSearch\Search\SearchQueryBuilder::forRewrittenQuery ( SearchQuery $original,
$term,
NamespacePrefixParser $namespacePrefixParser,
CirrusSearchHookRunner $cirrusSearchHookRunner )
static
Parameters
SearchQuery$original
string$term
NamespacePrefixParser$namespacePrefixParser
CirrusSearchHookRunner$cirrusSearchHookRunner
Returns
SearchQueryBuilder
Exceptions

CirrusSearch\Parser\QueryStringRegex\SearchQueryParseException

◆ newFTSearchQueryBuilder()

static CirrusSearch\Search\SearchQueryBuilder::newFTSearchQueryBuilder ( SearchConfig $config,
$queryString,
NamespacePrefixParser $namespacePrefixParser,
CirrusSearchHookRunner $cirrusSearchHookRunner )
static

Construct a new FT (FullText) SearchQueryBuilder using the config and query string provided.

NOTE: this method will parse the query string and set all builder attributes to Fulltext search defaults.

Parameters
SearchConfig$config
string$queryString
NamespacePrefixParser$namespacePrefixParser
CirrusSearchHookRunner$cirrusSearchHookRunner
Returns
SearchQueryBuilder
Exceptions

CirrusSearch\Parser\ParsedQueryClassifierException

Exceptions

CirrusSearch\Parser\QueryStringRegex\SearchQueryParseException

◆ setAllowRewrite()

CirrusSearch\Search\SearchQueryBuilder::setAllowRewrite ( $allowRewrite)
Parameters
bool$allowRewrite
Returns
SearchQueryBuilder

◆ setCrossLanguageSearch()

CirrusSearch\Search\SearchQueryBuilder::setCrossLanguageSearch ( $crossLanguageSearch)
Parameters
bool$crossLanguageSearch
Returns
SearchQueryBuilder

◆ setCrossProjectSearch()

CirrusSearch\Search\SearchQueryBuilder::setCrossProjectSearch ( $crossProjectSearch)
Parameters
bool$crossProjectSearch
Returns
SearchQueryBuilder

◆ setDebugOptions()

CirrusSearch\Search\SearchQueryBuilder::setDebugOptions ( CirrusDebugOptions $debugOptions)
Parameters
CirrusDebugOptions$debugOptions
Returns
SearchQueryBuilder

◆ setExtraFieldsToExtract()

CirrusSearch\Search\SearchQueryBuilder::setExtraFieldsToExtract ( array $fields)
Parameters
string[]$fields
Returns
SearchQueryBuilder

◆ setExtraIndicesSearch()

CirrusSearch\Search\SearchQueryBuilder::setExtraIndicesSearch ( $extraIndicesSearch)
Parameters
bool$extraIndicesSearch
Returns
SearchQueryBuilder

◆ setInitialNamespaces()

CirrusSearch\Search\SearchQueryBuilder::setInitialNamespaces ( array $initialNamespaces)
Parameters
int[]$initialNamespaces
Returns
SearchQueryBuilder

◆ setLimit()

CirrusSearch\Search\SearchQueryBuilder::setLimit ( $limit)
Parameters
int$limit
Returns
SearchQueryBuilder

◆ setOffset()

CirrusSearch\Search\SearchQueryBuilder::setOffset ( $offset)
Parameters
int$offset
Returns
SearchQueryBuilder

◆ setRandomSeed()

CirrusSearch\Search\SearchQueryBuilder::setRandomSeed ( ?int $randomSeed)
Parameters
int | null$randomSeed
Returns
$this

◆ setSearchEngineEntryPoint()

CirrusSearch\Search\SearchQueryBuilder::setSearchEngineEntryPoint ( $searchEngineEntryPoint)
Parameters
string$searchEngineEntryPoint
Returns
SearchQueryBuilder

◆ setSort()

CirrusSearch\Search\SearchQueryBuilder::setSort ( $sort)
Parameters
string$sort
Returns
SearchQueryBuilder

◆ setWithDYMSuggestion()

CirrusSearch\Search\SearchQueryBuilder::setWithDYMSuggestion ( $withDYMSuggestion)
Parameters
bool$withDYMSuggestion
Returns
SearchQueryBuilder

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