Wikibase
MediaWiki Wikibase extension
Wikibase\Repo\Maintenance\SearchEntities Class Reference

The script is intended to run searches in the same way as wbsearchentities does. More...

+ Inheritance diagram for Wikibase\Repo\Maintenance\SearchEntities:
+ Collaboration diagram for Wikibase\Repo\Maintenance\SearchEntities:

Public Member Functions

 __construct ()
 
 setRepo (WikibaseRepo $repo)
 Set wikibase repo to be used, e.g. More...
 
 execute ()
 Do the actual work. More...
 
 doSearch ( $query)
 Run search for one query. More...
 

Protected Member Functions

 applyGlobals ()
 Applies global variables provided as the options CLI argument to override current settings. More...
 

Private Member Functions

 getSearchHelper ( $engine)
 Get appropriate searcher. More...
 

Private Attributes

 $repo
 
 $searchHelper
 

Detailed Description

The script is intended to run searches in the same way as wbsearchentities does.

This is mainly intended to test configurations and search options using relforge or analogous tools. It is modeled after runSearch.php script in CirrusSearch extension.

The script accepts search requests from stdin, line by line, and outputs results, preserving order.

Author
Stas Malyshev

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Maintenance\SearchEntities::__construct ( )

Member Function Documentation

◆ applyGlobals()

Wikibase\Repo\Maintenance\SearchEntities::applyGlobals ( )
protected

Applies global variables provided as the options CLI argument to override current settings.

NOTE: this is a hack to test various search profiles, not to be used to mess with other global variables.

◆ doSearch()

Wikibase\Repo\Maintenance\SearchEntities::doSearch (   $query)

Run search for one query.

Parameters
string$query
Returns
string

◆ execute()

Wikibase\Repo\Maintenance\SearchEntities::execute ( )

Do the actual work.

All child classes will need to implement this

◆ getSearchHelper()

Wikibase\Repo\Maintenance\SearchEntities::getSearchHelper (   $engine)
private

Get appropriate searcher.

Parameters
string$engine
Returns
EntitySearchHelper
Exceptions
MWException

◆ setRepo()

Wikibase\Repo\Maintenance\SearchEntities::setRepo ( WikibaseRepo  $repo)

Set wikibase repo to be used, e.g.

for testing.

Parameters
WikibaseRepo$repo

Member Data Documentation

◆ $repo

Wikibase\Repo\Maintenance\SearchEntities::$repo
private

◆ $searchHelper

Wikibase\Repo\Maintenance\SearchEntities::$searchHelper
private

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