Called when the solr server is unavailable.

@return void
320844
protected function handleSolrUnavailable()
    {
        if ($this->typoScriptConfiguration->getLoggingExceptions()) {
            /** @var SolrLogManager $logger */
            $logger = GeneralUtility::makeInstance(SolrLogManager::class, /** @scrutinizer ignore-type */ __CLASS__);
            $logger->log(SolrLogManager::ERROR, 'Solr server is not available');
        }
    }
1149042
public function notfoundAction()
    {
        $request = $this->request->getAll();
        $task = $this->pickTaskName($request);

        $this->send('task "%s" is not found.', $task);
    }
1198402
public function getStatus()
    {
        $reports = [];
        $this->connectionManager = GeneralUtility::makeInstance(ConnectionManager::class);

        $solrConnections = $this->connectionManager->getAllConfigurations();

        foreach ($solrConnections as $solrConnection) {
            $reports[] = $this->getConnectionStatus($solrConnection);
        }

        return $reports;
    }
884990
def run_solr_on(solrInstance, category, id, fields):
    
    query = solrInstance.value + "select?q=*:*&fq=document_category:\"" + category.value + "\"&fq=id:\"" + id + "\"&fl=" + fields + "&wt=json&indent=on"
    response = requests.get(query)
    return response.json()['response']['docs'][0]
546493
private function _close()
    {
        if ($this->_closed) {
            // index is already closed and resources are cleaned up
            return;
        }

        $this->commit();

        // Release "under processing" flag
        Zend_Search_Lucene_LockManager::releaseReadLock($this->_directory);

        if ($this->_closeDirOnExit) {
            $this->_directory->close();
        }

        $this->_directory    = null;
        $this->_writer       = null;
        $this->_segmentInfos = null;

        $this->_closed = true;
    }
1297641
public function check()
    {
        $brokenCores = [];

        if (!class_exists(Solr::class)) {
            return [
                EnvironmentCheck::ERROR,
                'Class `' . Solr::class . '` not found. Is the fulltextsearch module installed?'
            ];
        }

        $service = Solr::service();
        foreach (Solr::get_indexes() as $index) {
            /** @var SolrIndex $core */
            $core = $index->getIndexName();
            if (!$service->coreIsActive($core)) {
                $brokenCores[] = $core;
            }
        }

        if (!empty($brokenCores)) {
            return [
                EnvironmentCheck::ERROR,
                'The following indexes are unavailable: ' . implode($brokenCores, ', ')
            ];
        }

        return [EnvironmentCheck::OK, 'Expected indexes are available.'];
    }
1349253
public function refresh(): void
    {
        $this->size = null;
        $this->lastModified = null;
        $this->isReadable = null;
        $this->isWritable = null;
        $this->exists = null;
        $this->created = null;
        $this->isSymLink = null;
        $this->isDir = null;
        $this->isFile = null;
        $this->isExecutable = null;
        $this->ownerId = null;
        $this->owner = null;
        $this->group = null;
        $this->groupId = null;
        $this->lastRead = null;
    }
280460
public function performSearch()
    {
        try {
            $index = Zend_Search_Lucene::open(self::get_index_location());

            Zend_Search_Lucene::setResultSetLimit(100);
            
            $query = new Zend_Search_Lucene_Search_Query_Boolean();
            $term = Zend_Search_Lucene_Search_QueryParser::parse($this->getQuery());
            $query->addSubquery($term, true);
            
            if ($this->modules) {
                $moduleQuery = new Zend_Search_Lucene_Search_Query_MultiTerm();
                
                foreach ($this->modules as $module) {
                    $moduleQuery->addTerm(new Zend_Search_Lucene_Index_Term($module, 'Entity'));
                }
                
                $query->addSubquery($moduleQuery, true);
            }

            if ($this->versions) {
                $versionQuery = new Zend_Search_Lucene_Search_Query_MultiTerm();
                
                foreach ($this->versions as $version) {
                    $versionQuery->addTerm(new Zend_Search_Lucene_Index_Term($version, 'Version'));
                }
                
                $query->addSubquery($versionQuery, true);
            }
            
            $er = error_reporting();
            error_reporting('E_ALL ^ E_NOTICE');
            $this->results = $index->find($query);
            error_reporting($er);
            $this->totalResults = $index->numDocs();
        } catch (Zend_Search_Lucene_Exception $e) {
            user_error($e .'. Ensure you have run the rebuld task (/dev/tasks/RebuildLuceneDocsIndex)', E_USER_ERROR);
        }
    }
415601
public function initializeSearchComponent()
    {
        $solrConfiguration = $this->seachRequest->getContextTypoScriptConfiguration();

        if ($solrConfiguration->getStatistics()) {
            $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['afterSearch']['statistics'] = StatisticsWriterProcessor::class;
            // Only if addDebugData is enabled add Query modifier
            if ($solrConfiguration->getStatisticsAddDebugData()) {
                $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['modifySearchQuery']['statistics'] = Statistics::class;
            }
        }
    }
241301
public function indexAction()
    {

        header("HTTP/1.0 404 Not Found");

        $data['title'] = '404';
        $data['error'] = $this->_error;

        $this->view->render('error/404', $data);
    }
461784
public function index() {
		$this->loadModel('Queue.QueueProcesses');
		$status = $this->QueueProcesses->status();

		$current = $this->QueuedJobs->getLength();
		$pendingDetails = $this->QueuedJobs->getPendingStats();
		$new = 0;
		foreach ($pendingDetails as $pendingDetail) {
			if ($pendingDetail['fetched'] || $pendingDetail['failed']) {
				continue;
			}
			$new++;
		}

		$data = $this->QueuedJobs->getStats();

		$taskFinder = new TaskFinder();
		$tasks = $taskFinder->allAppAndPluginTasks();

		$servers = $this->QueueProcesses->find()->distinct(['server'])->find('list', ['keyField' => 'server', 'valueField' => 'server'])->toArray();
		$this->set(compact('new', 'current', 'data', 'pendingDetails', 'status', 'tasks', 'servers'));
		$this->helpers[] = 'Tools.Format';
		$this->helpers[] = 'Tools.Time';
		$this->helpers[] = 'Tools.Text';
	}
1275233
public function resetLogErrorsAction()
    {
        $resetResult = $this->indexQueue->resetAllErrors();

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

        $this->addIndexQueueFlashMessage($label, $severity);

        $this->redirect('index');
    }
1132262
public function onAfterWrite() {
        if (\Config::inst()->get('ElasticSearch', 'disabled') || !$this->owner->autoIndex()) {
            return;
        }
        $stage = \Versioned::current_stage();
        
		$this->service->index($this->owner, $stage);
	}
50750
public function setHost($host)
	{
		//Use the provided host or use the default
		if (empty($host))
		{
			throw new Apache_Solr_InvalidArgumentException('Host parameter is empty');
		}
		else
		{
			$this->_host = $host;
		}

		if ($this->_urlsInited)
		{
			$this->_initUrls();
		}
	}
1158608
public function ping($useCache = true)
    {
        $solrAvailable = false;

        try {
            if (!$this->solr->getReadService()->ping($useCache)) {
                throw new \Exception('Solr Server not responding.', 1237475791);
            }

            $solrAvailable = true;
        } catch (\Exception $e) {
            if ($this->configuration->getLoggingExceptions()) {
                $this->logger->log(
                    SolrLogManager::ERROR,
                    'Exception while trying to ping the solr server',
                    [
                        $e->__toString()
                    ]
                );
            }
        }

        return $solrAvailable;
    }
434039
protected function handleErrorResponses(HttpException $exception)
    {
        $status = $exception->getCode();
        $message = $exception->getStatusMessage();
        $solrRespone = new ResponseAdapter($exception->getBody());

        if ($status === 0 || $status === 502) {
            $e = new SolrUnavailableException('Solr Server not available: ' . $message, 1505989391);
            $e->setSolrResponse($solrRespone);
            throw $e;
        }

        if ($status === 500) {
            $e = new SolrInternalServerErrorException('Internal Server error during search: ' . $message, 1505989897);
            $e->setSolrResponse($solrRespone);
            throw $e;
        }

        $e = new SolrCommunicationException('Invalid query. Solr returned an error: ' . $status . ' ' . $message, 1293109870);
        $e->setSolrResponse($solrRespone);

        throw $e;
    }
963016
public function pageUnavailableAndExit($reason = '', $header = '')
    {
        if (!defined('EXT_SOLR_INDEXING_CONTEXT')) {
            parent::pageUnavailableAndExit($reason, $header);
        }
        throw new DocumentPreparationException('Solr Document can not be prepared. The Reason: ' . $reason, 1517584040);
    }