Initialise / rebuild the Spell checker
not needed in current implementation with an index based spell checker
and autorebuilds upon commits

@package unfinished
@return array Solr result set.
962624
function initSpellChecker()
    {

        if ( $this->UseMultiLanguageCores == true )
        {
            foreach ( $SolrLanguageShards as $shard )
            {
                $shard->rawSearch( array( 'q' => 'solr', 'qt' => 'spellchecker', 'wt' => 'php', 'cmd' => 'rebuild' ) );
                //@TODO: process individual results, implement an ezfind error class or reuse ezp ones
                return true;
            }
        }
        else
        {
            $return = $this->Solr->rawSearch( array( 'q' => 'solr', 'qt' => 'spellchecker', 'wt' => 'php', 'cmd' => 'rebuild' ) );
        }


    }
791805
public function initCompilation()
    {
        $this->defaultData();

        $delivery = $this->getCurrentInstance();

        //init the value to be returned
        $deliveryData=array();

        $deliveryData["uri"] = $delivery->getUri();

        //check if a wsdl contract is set to upload the result:
        $resultServer = $this->getClassService()->getResultServer($delivery);
        $deliveryData['resultServer'] = $resultServer;

        $deliveryData['tests'] = array();
        if(!empty($resultServer)){

            //get the tests list from the delivery id: likely, by parsing the deliveryContent property value
            //array of resource, test set
            $tests = $this->getClassService()->getRelatedTests($delivery);

            foreach($tests as $test){
                $deliveryData['tests'][] = array(
                    "label" => $test->getLabel(),
                    "uri" => $test->getUri()
                );
            }
        }

        $this->returnJson($deliveryData);
    }
1255409
public function getFailures()
    {
        $results = [];
        foreach ($this->hash as $key) {
            if ($this->hash[$key] instanceof \Exception) {
                $results[] = $this->hash[$key];
            }
        }

        return $results;
    }
826287
protected function getInformationNeededForInitializeActionMethodValidators()
    {
        return [
            static::getActionValidationGroups($this->objectManager),
            static::getActionMethodParameters($this->objectManager),
            static::getActionValidateAnnotationData($this->objectManager),
            static::getActionIgnoredValidationArguments($this->objectManager)
        ];
    }
175440
public function getAdditionalInformation()
    {
        $site = $this->getSite();

        if (is_null($site)) {
            return 'Invalid site configuration for scheduler please re-create the task!';
        }

        $message = 'Site: ' . $site->getLabel();

        /** @var $indexService \ApacheSolrForTypo3\Solr\Domain\Index\IndexService */
        $indexService = $this->getInitializedIndexService($site);
        $failedItemsCount = $indexService->getFailCount();

        if ($failedItemsCount) {
            $message .= ' Failures: ' . $failedItemsCount;
        }

        $message .= ' / Using webroot: ' . htmlspecialchars($this->getWebRoot());

        return $message;
    }
40968
protected function initializeSearch()
    {
        /** @var \ApacheSolrForTypo3\Solr\ConnectionManager $solrConnection */
        $solrConnection = GeneralUtility::makeInstance(ConnectionManager::class)->getConnectionByPageId($this->typoScriptFrontendController->id, $this->typoScriptFrontendController->sys_language_uid, $this->typoScriptFrontendController->MP);
        $search = GeneralUtility::makeInstance(Search::class, $solrConnection);

        $this->searchService = GeneralUtility::makeInstance(
            SearchResultSetService::class,
            /** @scrutinizer ignore-type */ $this->typoScriptConfiguration,
            /** @scrutinizer ignore-type */ $search
        );
    }
287712
protected function cleanUpIndex()
    {
        $cleanUpResult = true;
        $solrConfiguration = $this->getSite()->getSolrConfiguration();
        $solrServers = GeneralUtility::makeInstance(ConnectionManager::class)->getConnectionsBySite($this->getSite());
        $typesToCleanUp = [];
        $enableCommitsSetting = $solrConfiguration->getEnableCommits();

        foreach ($this->indexingConfigurationsToReIndex as $indexingConfigurationName) {
            $type = $solrConfiguration->getIndexQueueTableNameOrFallbackToConfigurationName($indexingConfigurationName);
            $typesToCleanUp[] = $type;
        }

        foreach ($solrServers as $solrServer) {
            $deleteQuery = 'type:(' . implode(' OR ', $typesToCleanUp) . ')' . ' AND siteHash:' . $this->getSite()->getSiteHash();
            $solrServer->getWriteService()->deleteByQuery($deleteQuery);

            if (!$enableCommitsSetting) {
                # Do not commit
                continue;
            }

            $response = $solrServer->getWriteService()->commit(false, false, false);
            if ($response->getHttpStatus() != 200) {
                $cleanUpResult = false;
                break;
            }
        }

        return $cleanUpResult;
    }
1315870
public function getIndexName()
    {
        $name = $this->sanitiseClassName(get_class($this), '-');

        $indexParts = [$name];

        if ($indexPrefix = Environment::getEnv('SS_SOLR_INDEX_PREFIX')) {
            array_unshift($indexParts, $indexPrefix);
        }

        if ($indexSuffix = Environment::getEnv('SS_SOLR_INDEX_SUFFIX')) {
            $indexParts[] = $indexSuffix;
        }

        return implode($indexParts);
    }
829230
public function getStatus()
    {
        $reports = [];
        $severity = Status::OK;
        $value = 'On';
        $message = '';

        if (!ini_get('allow_url_fopen')) {
            $severity = Status::ERROR;
            $value = 'Off';
            $message = 'allow_url_fopen must be enabled in php.ini to allow
				communication between TYPO3 and the Apache Solr server.
				Indexing pages using the Index Queue will also not work with
				this setting disabled.';
        }

        $reports[] = GeneralUtility::makeInstance(
            Status::class,
            /** @scrutinizer ignore-type */ 'allow_url_fopen',
            /** @scrutinizer ignore-type */ $value,
            /** @scrutinizer ignore-type */ $message,
            /** @scrutinizer ignore-type */ $severity
        );

        return $reports;
    }
341868
public function restorePrefix()
    {
        foreach ($this->removals as $i => $removal) {
            if ($removal->getAffixType() == 'DP') {
                // return the word before precoding (the subject of first prefix removal)
                $this->setCurrentWord($removal->getSubject());
                break;
            }
        }

        foreach ($this->removals as $i => $removal) {
            if ($removal->getAffixType() == 'DP') {
                unset($this->removals[$i]);
            }
        }
    }
591249
public function getReplacements()
    {
        $replacements = array_merge(parent::getReplacements(), ['root_namespace' => $this->getAppNamespace()]);

        if ($this->scaffold) {
            return array_merge($replacements, $this->scaffolder->toArray());
        }

        return $replacements;
    }
702839
public function getReplacements()
    {

        return array_merge(parent::getReplacements(), [
            'repository' => $this->getRepository(),
            'eloquent' => $this->getEloquentRepository(),
            'placeholder' => $this->bindPlaceholder,
        ]);
    }
112125
public function doIndexingRunAction()
    {
        /** @var $indexService \ApacheSolrForTypo3\Solr\Domain\Index\IndexService */
        $indexService = GeneralUtility::makeInstance(IndexService::class, /** @scrutinizer ignore-type */ $this->selectedSite);
        $indexWithoutErrors = $indexService->indexItems(10);

        $label = 'solr.backend.index_queue_module.flashmessage.success.index_manual';
        $severity = FlashMessage::OK;
        if (!$indexWithoutErrors) {
            $label = 'solr.backend.index_queue_module.flashmessage.error.index_manual';
            $severity = FlashMessage::ERROR;
        }

        $this->addFlashMessage(
            LocalizationUtility::translate($label, 'Solr'),
            LocalizationUtility::translate('solr.backend.index_queue_module.flashmessage.index_manual', 'Solr'),
            $severity
        );

        $this->redirect('index');
    }
1261299
public function getRecommendations()
    {
        if (null !== $this->recommendations) {
            return $this->recommendations;
        }

        if (null === $this->data) {
            $this->initializeProfile();
        }

        if (!isset($this->data['recommendations']['tests'])) {
            return $this->recommendations = array();
        }

        $this->recommendations = array();
        foreach ($this->data['recommendations']['tests'] as $test) {
            $this->recommendations[] = new Test($test['name'], $test['state'], isset($test['failures']) ? $test['failures'] : array());
        }

        return $this->recommendations;
    }
376609
public function getPrefixes()
    {
        $prefixes = array();
        foreach (Mage::helper('ecomdev_varnish')->getAllowedPages() as $name => $label) {
            $prefixes[] = array(
                'field' => $name.'_',
                'label' => $label
            );
        }

        return $prefixes;
    }
475672
public function getStepKeywords()
    {
        if (!isset($this->keywordString[$this->language])) {
            $keywords = array_merge(
                explode('|', $this->getGivenKeywords()),
                explode('|', $this->getWhenKeywords()),
                explode('|', $this->getThenKeywords()),
                explode('|', $this->getAndKeywords()),
                explode('|', $this->getButKeywords())
            );

            usort($keywords, function ($keyword1, $keyword2) {
                return mb_strlen($keyword2, 'utf8') - mb_strlen($keyword1, 'utf8');
            });

            $this->keywordString[$this->language] = implode('|', $keywords);
        }

        return $this->keywordString[$this->language];
    }
706241
protected function getIndexQueueInitializationSelector()
    {
        $selector = GeneralUtility::makeInstance(IndexingConfigurationSelectorField::class, /** @scrutinizer ignore-type */ $this->selectedSite);
        $selector->setFormElementName('tx_solr-index-queue-initialization');

        return $selector->render();
    }