CirrusSearch
Elasticsearch-powered search for MediaWiki
Loading...
Searching...
No Matches
CirrusSearch\Fallbacks\FallbackMethod Interface Reference
+ Inheritance diagram for CirrusSearch\Fallbacks\FallbackMethod:

Public Member Functions

 successApproximation (FallbackRunnerContext $context)
 Approximation of the success of this fallback method this evaluation must be fast and not access remote resources.
 
 rewrite (FallbackRunnerContext $context)
 Rewrite the results.
 

Static Public Member Functions

static build (SearchQuery $query, array $params, InterwikiResolver $interwikiResolver)
 

Member Function Documentation

◆ build()

static CirrusSearch\Fallbacks\FallbackMethod::build ( SearchQuery $query,
array $params,
InterwikiResolver $interwikiResolver )
static
Parameters
SearchQuery$query
array$params
InterwikiResolver$interwikiResolver
Returns
FallbackMethod|null the method instance or null if unavailable

Implemented in CirrusSearch\Fallbacks\LangDetectFallbackMethod, CirrusSearch\Fallbacks\IndexLookupFallbackMethod, and CirrusSearch\Fallbacks\PhraseSuggestFallbackMethod.

◆ rewrite()

CirrusSearch\Fallbacks\FallbackMethod::rewrite ( FallbackRunnerContext $context)

Rewrite the results.

A costly call is allowed here. Result sets must not be changed directly, rather a FallbackStatus that applies the desired change must be returned.

Parameters
FallbackRunnerContext$context
Returns
FallbackStatus

Implemented in CirrusSearch\Fallbacks\IndexLookupFallbackMethod, CirrusSearch\Fallbacks\LangDetectFallbackMethod, and CirrusSearch\Fallbacks\PhraseSuggestFallbackMethod.

◆ successApproximation()

CirrusSearch\Fallbacks\FallbackMethod::successApproximation ( FallbackRunnerContext $context)

Approximation of the success of this fallback method this evaluation must be fast and not access remote resources.

The score is interpreted as :

  • 1.0: the engine can blindly execute this one and discard any others (saving respective calls to successApproximation of other methods)
  • 0.5: e.g. when no approximation is possible
  • 0.0: should not be tried (safe to skip costly work)

The order of application (call to the rewrite method) is the order of these scores. If the score of multiple methods is equals the initialization order is kept.

Parameters
FallbackRunnerContext$context
Returns
float

Implemented in CirrusSearch\Fallbacks\IndexLookupFallbackMethod, CirrusSearch\Fallbacks\LangDetectFallbackMethod, and CirrusSearch\Fallbacks\PhraseSuggestFallbackMethod.


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