first commit

This commit is contained in:
Sven Wappler
2021-04-17 21:20:54 +02:00
parent c93ec9492a
commit cadcc8edb4
406 changed files with 4917 additions and 5157 deletions

View File

@@ -32,7 +32,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Scheduler task to empty the indexes of a site and re-initialize the
* Solr Index Queue thus making the indexer re-index the site.
* Meilisearch Index Queue thus making the indexer re-index the site.
*
* @author Christoph Moeller <support@network-publishing.de>
*/
@@ -47,7 +47,7 @@ class ReIndexTask extends AbstractMeilisearchTask
protected $indexingConfigurationsToReIndex = [];
/**
* Purges/commits all Solr indexes, initializes the Index Queue
* Purges/commits all Meilisearch indexes, initializes the Index Queue
* and returns TRUE if the execution was successful
*
* @return bool Returns TRUE on success, FALSE on failure.
@@ -74,26 +74,26 @@ class ReIndexTask extends AbstractMeilisearchTask
protected function cleanUpIndex()
{
$cleanUpResult = true;
$solrConfiguration = $this->getSite()->getSolrConfiguration();
$solrServers = GeneralUtility::makeInstance(ConnectionManager::class)->getConnectionsBySite($this->getSite());
$meilisearchConfiguration = $this->getSite()->getMeilisearchConfiguration();
$meilisearchServers = GeneralUtility::makeInstance(ConnectionManager::class)->getConnectionsBySite($this->getSite());
$typesToCleanUp = [];
$enableCommitsSetting = $solrConfiguration->getEnableCommits();
$enableCommitsSetting = $meilisearchConfiguration->getEnableCommits();
foreach ($this->indexingConfigurationsToReIndex as $indexingConfigurationName) {
$type = $solrConfiguration->getIndexQueueTableNameOrFallbackToConfigurationName($indexingConfigurationName);
$type = $meilisearchConfiguration->getIndexQueueTableNameOrFallbackToConfigurationName($indexingConfigurationName);
$typesToCleanUp[] = $type;
}
foreach ($solrServers as $solrServer) {
foreach ($meilisearchServers as $meilisearchServer) {
$deleteQuery = 'type:(' . implode(' OR ', $typesToCleanUp) . ')' . ' AND siteHash:' . $this->getSite()->getSiteHash();
$solrServer->getWriteService()->deleteByQuery($deleteQuery);
$meilisearchServer->getWriteService()->deleteByQuery($deleteQuery);
if (!$enableCommitsSetting) {
# Do not commit
continue;
}
$response = $solrServer->getWriteService()->commit(false, false, false);
$response = $meilisearchServer->getWriteService()->commit(false, false, false);
if ($response->getHttpStatus() != 200) {
$cleanUpResult = false;
break;