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

Performs searches using Elasticsearch – on interwikis! More...

+ Inheritance diagram for CirrusSearch\InterwikiSearcher:
+ Collaboration diagram for CirrusSearch\InterwikiSearcher:

Public Member Functions

 __construct (Connection $connection, SearchConfig $config, ?array $namespaces=null, ?User $user=null, ?CirrusDebugOptions $debugOptions=null, ?NamespacePrefixParser $namespacePrefixParser=null, ?InterwikiResolver $interwikiResolver=null, ?TitleHelper $titleHelper=null, ?CirrusSearchHookRunner $cirrusSearchHookRunner=null)
 
 getInterwikiResults (SearchQuery $query)
 Fetch search results, from caches, if there's any.
 
- Public Member Functions inherited from CirrusSearch\Searcher
 __construct (Connection $conn, $offset, $limit, SearchConfig $config, ?array $namespaces=null, ?User $user=null, $index=false, ?CirrusDebugOptions $options=null, ?NamespacePrefixParser $namespacePrefixParser=null, ?InterwikiResolver $interwikiResolver=null, ?TitleHelper $titleHelper=null, ?CirrusSearchHookRunner $cirrusSearchHookRunner=null)
 
 search (SearchQuery $query)
 Unified search public entry-point.
 
 setResultsType ( $resultsType)
 
 isReturnRaw ()
 Is this searcher used to return debugging info?
 
 setSort ( $sort)
 Set the type of sort to perform.
 
 limitSearchToLocalWiki ( $limitSearchToLocalWiki)
 Should this search limit results to the local wiki? If not called the default is false.
 
 nearMatchTitleSearch ( $term)
 Perform a "near match" title search which is pretty much a prefix match without the prefixes.
 
 countContentWords ()
 Perform a sum over the number of words in the content index.
 
 prefixSearch ( $term, $variants=[])
 Perform a prefix search.
 
 get (array $docIds, $sourceFiltering, $usePoolCounter=true)
 Get the page with $docId.
 
 updateNamespacesFromQuery (&$query)
 Attempt to suck a leading namespace followed by a colon from the query string.
 
 getSearchContext ()
 
 processRawReturn ( $result, WebRequest $request)
 If we're supposed to create raw result, create and return it, or output it and finish.
 
 searchArchive ( $term)
 Search titles in archive.
 
 applyDebugOptionsToQuery (Query $query)
 Apply debug options to the elastica query.
 
 makeSearcher (SearchQuery $query)
 
 getOffsetLimit ()
 Visible for testing.
 
- Public Member Functions inherited from CirrusSearch\ElasticsearchIntermediary
 start (RequestLog $log)
 Mark the start of a request to Elasticsearch.
 
 success ( $result=null, ?Connection $connection=null)
 Log a successful request and return the provided result in a good Status.
 
 successViaCache (RequestLog $log)
 Log a successful request when the response comes from a cache outside elasticsearch.
 
 failure (?ExceptionInterface $exception=null, ?Connection $connection=null)
 Log a failure and return an appropriate status.
 
 getSearchMetrics ()
 Get the search metrics we have.
 

Protected Member Functions

 recordQueryCacheMetrics (StatsFactory $requestStats, string $cacheStatus, ?string $type=null)
 
- Protected Member Functions inherited from CirrusSearch\Searcher
 buildFullTextSearch ( $term)
 Build full text search for articles with provided term.
 
 buildSearch ()
 
 searchOne ()
 Perform a single-query search.
 
 newLog ( $description, $queryType, array $extra=[])
 
- Protected Member Functions inherited from CirrusSearch\ElasticsearchIntermediary
 __construct (Connection $connection, ?UserIdentity $user=null, $slowSeconds=null, $extraBackendLatency=0)
 
 startNewLog ( $description, $queryType, array $extra=[])
 
 getTimeout ( $searchType='default')
 
 getClientTimeout ( $searchType='default')
 
 appendMetrics (SearchMetricsProvider $provider)
 
 runMSearch (Search $search, RequestLog $log, ?Connection $connection=null, ?callable $resultsTransformer=null)
 

Additional Inherited Members

- Static Public Member Functions inherited from CirrusSearch\ElasticsearchIntermediary
static setResultPages (array $matches)
 This is set externally because we don't have complete control, from the SearchEngine interface, of what is actually sent to the user.
 
static getQueryTypesUsed ()
 Report the types of queries that were issued within the current request.
 
static hasQueryLogs ()
 
static appendLastLogPayload ( $key, $value)
 
static isMSearchResultSetOK (MultiResultSet $multiResultSet)
 check validity of the multisearch response
 
- Public Attributes inherited from CirrusSearch\Searcher
const SUGGESTION_HIGHLIGHT_PRE = '<em>'
 
const SUGGESTION_HIGHLIGHT_POST = '</em>'
 
const HIGHLIGHT_PRE_MARKER = ''
 
const HIGHLIGHT_PRE = '<span class="searchmatch">'
 
const HIGHLIGHT_POST_MARKER = ''
 
const HIGHLIGHT_POST = '</span>'
 
const MAINSEARCH_MSEARCH_KEY = '__main__'
 Identifies the main search in MSearchRequests/MSearchResponses.
 
- Protected Attributes inherited from CirrusSearch\Searcher
 $offset
 
 $limit
 
 $indexBaseName
 
 $config
 
 $searchContext
 
 $interwikiResolver
 
 $titleHelper
 
 $cirrusSearchHookRunner
 
- Protected Attributes inherited from CirrusSearch\ElasticsearchIntermediary
 $connection
 
 $user
 
 $currentRequestLog = null
 
- Static Protected Attributes inherited from CirrusSearch\ElasticsearchIntermediary
static $requestLogger
 

Detailed Description

Performs searches using Elasticsearch – on interwikis!

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. http://www.gnu.org/copyleft/gpl.html

Constructor & Destructor Documentation

◆ __construct()

CirrusSearch\InterwikiSearcher::__construct ( Connection $connection,
SearchConfig $config,
?array $namespaces = null,
?User $user = null,
?CirrusDebugOptions $debugOptions = null,
?NamespacePrefixParser $namespacePrefixParser = null,
?InterwikiResolver $interwikiResolver = null,
?TitleHelper $titleHelper = null,
?CirrusSearchHookRunner $cirrusSearchHookRunner = null )
Parameters
Connection$connection
SearchConfig$config
int[] | null$namespacesNamespace numbers to search, or null for all of them
User | null$user
CirrusDebugOptions | null$debugOptions
NamespacePrefixParser | null$namespacePrefixParser
InterwikiResolver | null$interwikiResolver
TitleHelper | null$titleHelper
CirrusSearchHookRunner | null$cirrusSearchHookRunner

Member Function Documentation

◆ getInterwikiResults()

CirrusSearch\InterwikiSearcher::getInterwikiResults ( SearchQuery $query)

Fetch search results, from caches, if there's any.

Parameters
SearchQuery$queryoriginal search query
Returns
Status

◆ recordQueryCacheMetrics()

CirrusSearch\InterwikiSearcher::recordQueryCacheMetrics ( StatsFactory $requestStats,
string $cacheStatus,
?string $type = null )
protected

Reimplemented from CirrusSearch\Searcher.


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