class SolrReindexImmediateHandler extends SolrReindexBase (View source)

Invokes an immediate reindex

Internally batches of records will be invoked via shell tasks in the background

Traits

Provides extensions to this object to integrate it with standard config API methods.

Config options

php_bin null|string

Path to the php binary

Properties

Methods

public
runReindex(LoggerInterface $logger, int $batchSize, string $taskName, string|array|null $classes = null)

Begin an immediate re-index

protected
processIndex(LoggerInterface $logger, SolrIndex $indexInstance, int $batchSize, string $taskName, string $classes = null)

Process index for a single SolrIndex instance

protected
array
getClassesForIndex(SolrIndex $index, string|array $filterClasses = null)

Get valid classes and options for an index with an optional filter

protected
processVariant(LoggerInterface $logger, SolrIndex $indexInstance, array $state, string $class, bool $includeSubclasses, int $batchSize, string $taskName)

Process re-index for a given variant state and class

protected
processGroup(LoggerInterface $logger, SolrIndex $indexInstance, array $state, string $class, int $groups, int $group, string $taskName)

Process a single group.

public
runGroup(LoggerInterface $logger, SolrIndex $indexInstance, array $state, string $class, int $groups, int $group)

Explicitly invoke the process that performs the group processing. Can be run either by a background task or a queuedjob.

protected
getRecordsInGroup(SolrIndex $indexInstance, string $class, int $groups, int $group)

Gets the datalist of records in the given group in the current state

protected
clearRecords(SolrIndex $indexInstance, string $class, int $groups = null, int $group = null)

Clear all records of the given class in the current state ONLY.

public static 
config()

Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).

public
mixed
stat(string $name) deprecated

Get inherited config value

public
mixed
uninherited(string $name)

Gets the uninherited value for the given config option

public
$this
set_stat(string $name, mixed $value) deprecated

Update the config value for a given property

public
triggerReindex(LoggerInterface $logger, int $batchSize, string $taskName, string|array|null $classes = null)

Trigger a solr-reindex

Details

runReindex(LoggerInterface $logger, int $batchSize, string $taskName, string|array|null $classes = null)

Begin an immediate re-index

Parameters

LoggerInterface $logger
int $batchSize

Records to run each process

string $taskName

Name of devtask to run

string|array|null $classes

Optional class or classes to limit index to

protected processIndex(LoggerInterface $logger, SolrIndex $indexInstance, int $batchSize, string $taskName, string $classes = null)

Process index for a single SolrIndex instance

Parameters

LoggerInterface $logger
SolrIndex $indexInstance
int $batchSize
string $taskName
string $classes

protected array getClassesForIndex(SolrIndex $index, string|array $filterClasses = null)

Get valid classes and options for an index with an optional filter

Parameters

SolrIndex $index
string|array $filterClasses

Optional class or classes to limit to

Return Value

array

List of classes, where the key is the classname and value is list of options

protected processVariant(LoggerInterface $logger, SolrIndex $indexInstance, array $state, string $class, bool $includeSubclasses, int $batchSize, string $taskName)

Process re-index for a given variant state and class

Parameters

LoggerInterface $logger
SolrIndex $indexInstance
array $state

Variant state

string $class
bool $includeSubclasses
int $batchSize
string $taskName

protected processGroup(LoggerInterface $logger, SolrIndex $indexInstance, array $state, string $class, int $groups, int $group, string $taskName)

Process a single group.

Without queuedjobs, it's necessary to shell this out to a background task as this is very memory intensive.

The sub-process will then invoke $processor->runGroup() in {\SilverStripe\FullTextSearch\Solr\Reindex\Handlers\Solr_Reindex::doReindex}

Parameters

LoggerInterface $logger
SolrIndex $indexInstance

Index instance

array $state

Variant state

string $class

Class to index

int $groups

Total groups

int $group

Index of group to process

string $taskName

Name of task script to run

runGroup(LoggerInterface $logger, SolrIndex $indexInstance, array $state, string $class, int $groups, int $group)

Explicitly invoke the process that performs the group processing. Can be run either by a background task or a queuedjob.

Does not commit changes to the index, so this must be controlled externally.

Parameters

LoggerInterface $logger
SolrIndex $indexInstance
array $state
string $class
int $groups
int $group

protected DataList getRecordsInGroup(SolrIndex $indexInstance, string $class, int $groups, int $group)

Gets the datalist of records in the given group in the current state

Assumes that the desired variant state is in effect.

Parameters

SolrIndex $indexInstance
string $class
int $groups
int $group

Return Value

DataList

protected clearRecords(SolrIndex $indexInstance, string $class, int $groups = null, int $group = null)

Clear all records of the given class in the current state ONLY.

Optionally delete from a given group (where the group is defined as the ID % total groups)

Parameters

SolrIndex $indexInstance

Index instance

string $class

Class name

int $groups

Number of groups, if clearing from a striped group

int $group

Group number, if clearing from a striped group

static Config_ForClass config()

Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).

Return Value

Config_ForClass

mixed stat(string $name) deprecated

deprecated 5.0 Use ->config()->get() instead

Get inherited config value

Parameters

string $name

Return Value

mixed

mixed uninherited(string $name)

Gets the uninherited value for the given config option

Parameters

string $name

Return Value

mixed

$this set_stat(string $name, mixed $value) deprecated

deprecated 5.0 Use ->config()->set() instead

Update the config value for a given property

Parameters

string $name
mixed $value

Return Value

$this

triggerReindex(LoggerInterface $logger, int $batchSize, string $taskName, string|array|null $classes = null)

Trigger a solr-reindex

Parameters

LoggerInterface $logger
int $batchSize

Records to run each process

string $taskName

Name of devtask to run

string|array|null $classes

Optional class or classes to limit index to