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

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. More...

Public Member Functions

 __construct (SearchConfig $searchConfig, Connection $source, Connection $target, Index $index, Index $oldIndex, ?Printer $out=null, $fieldsToDelete=[])
 
 reindex ( $slices=null, $chunkSize=100, $acceptableCountDeviation=0.05)
 Dump everything from the live index into the one being worked on.
 
 waitForGreen ()
 

Static Public Member Functions

static makeRemoteReindexInfo (Connection $source, Connection $dest)
 Creates an array suitable for use as the _reindex api source.remote parameter to read from $oldConnection.
 

Protected Member Functions

 output ( $message, $channel=null)
 

Detailed Description

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\Maintenance\Reindexer::__construct ( SearchConfig $searchConfig,
Connection $source,
Connection $target,
Index $index,
Index $oldIndex,
?Printer $out = null,
$fieldsToDelete = [] )
Parameters
SearchConfig$searchConfig
Connection$source
Connection$target
Index$index
Index$oldIndex
Printer | null$out
string[]$fieldsToDelete

Member Function Documentation

◆ makeRemoteReindexInfo()

static CirrusSearch\Maintenance\Reindexer::makeRemoteReindexInfo ( Connection $source,
Connection $dest )
static

Creates an array suitable for use as the _reindex api source.remote parameter to read from $oldConnection.

This is very fragile, but the transports don't expose enough to do more really

Parameters
Connection$sourceConnection to read data from
Connection$destConnection to reindex data into
Returns
array|null

◆ output()

CirrusSearch\Maintenance\Reindexer::output ( $message,
$channel = null )
protected
Parameters
string$message
mixed | null$channel

◆ reindex()

CirrusSearch\Maintenance\Reindexer::reindex ( $slices = null,
$chunkSize = 100,
$acceptableCountDeviation = 0.05 )

Dump everything from the live index into the one being worked on.

Parameters
int | null$slicesThe number of slices to use, or null to use the number of shards
int$chunkSize
float$acceptableCountDeviation

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