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

@@ -4,7 +4,7 @@ namespace WapplerSystems\Meilisearch\Controller\Backend\Search;
/***************************************************************
* Copyright notice
*
* (c) 2010-2017 dkd Internet Service GmbH <solr-support@dkd.de>
* (c) 2010-2017 dkd Internet Service GmbH <meilisearch-support@dkd.de>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
@@ -27,8 +27,8 @@ namespace WapplerSystems\Meilisearch\Controller\Backend\Search;
use WapplerSystems\Meilisearch\Api;
use WapplerSystems\Meilisearch\ConnectionManager;
use WapplerSystems\Meilisearch\Domain\Search\Statistics\StatisticsRepository;
use WapplerSystems\Meilisearch\Domain\Search\ApacheSolrDocument\Repository;
use WapplerSystems\Meilisearch\System\Solr\ResponseAdapter;
use WapplerSystems\Meilisearch\Domain\Search\ApacheMeilisearchDocument\Repository;
use WapplerSystems\Meilisearch\System\Meilisearch\ResponseAdapter;
use WapplerSystems\Meilisearch\System\Validator\Path;
use TYPO3\CMS\Backend\Template\ModuleTemplate;
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
@@ -46,12 +46,12 @@ class InfoModuleController extends AbstractModuleController
/**
* @var ConnectionManager
*/
protected $solrConnectionManager;
protected $meilisearchConnectionManager;
/**
* @var Repository
*/
protected $apacheSolrDocumentRepository;
protected $apacheMeilisearchDocumentRepository;
/**
* Initializes the controller before invoking an action method.
@@ -59,8 +59,8 @@ class InfoModuleController extends AbstractModuleController
protected function initializeAction()
{
parent::initializeAction();
$this->solrConnectionManager = GeneralUtility::makeInstance(ConnectionManager::class);
$this->apacheSolrDocumentRepository = GeneralUtility::makeInstance(Repository::class);
$this->meilisearchConnectionManager = GeneralUtility::makeInstance(ConnectionManager::class);
//$this->apacheMeilisearchDocumentRepository = GeneralUtility::makeInstance(Repository::class);
}
/**
@@ -80,7 +80,7 @@ class InfoModuleController extends AbstractModuleController
}
/**
* Index action, shows an overview of the state of the Solr index
* Index action, shows an overview of the state of the Meilisearch index
*
* @return void
*/
@@ -106,12 +106,12 @@ class InfoModuleController extends AbstractModuleController
*/
public function documentsDetailsAction(string $type, int $uid, int $pageId, int $languageUid)
{
$documents = $this->apacheSolrDocumentRepository->findByTypeAndPidAndUidAndLanguageId($type, $uid, $pageId, $languageUid);
$documents = $this->apacheMeilisearchDocumentRepository->findByTypeAndPidAndUidAndLanguageId($type, $uid, $pageId, $languageUid);
$this->view->assign('documents', $documents);
}
/**
* Checks whether the configured Solr server can be reached and provides a
* Checks whether the configured Meilisearch server can be reached and provides a
* flash message according to the result of the check.
*
* @return void
@@ -124,7 +124,7 @@ class InfoModuleController extends AbstractModuleController
/* @var Path $path */
$path = GeneralUtility::makeInstance(Path::class);
$connections = $this->solrConnectionManager->getConnectionsBySite($this->selectedSite);
$connections = $this->meilisearchConnectionManager->getConnectionsBySite($this->selectedSite);
if (empty($connections)) {
$this->view->assign('can_not_proceed', true);
@@ -141,7 +141,7 @@ class InfoModuleController extends AbstractModuleController
$missingHosts[] = $coreUrl;
}
if (!$path->isValidSolrPath($coreAdmin->getCorePath())) {
if (!$path->isValidMeilisearchPath($coreAdmin->getCorePath())) {
$invalidPaths[] = $coreAdmin->getCorePath();
}
}
@@ -156,7 +156,7 @@ class InfoModuleController extends AbstractModuleController
}
/**
* Index action, shows an overview of the state of the Solr index
* Index action, shows an overview of the state of the Meilisearch index
*
* @return void
*/
@@ -204,9 +204,9 @@ class InfoModuleController extends AbstractModuleController
{
$indexFieldsInfoByCorePaths = [];
$solrCoreConnections = $this->solrConnectionManager->getConnectionsBySite($this->selectedSite);
foreach ($solrCoreConnections as $solrCoreConnection) {
$coreAdmin = $solrCoreConnection->getAdminService();
$meilisearchCoreConnections = $this->meilisearchConnectionManager->getConnectionsBySite($this->selectedSite);
foreach ($meilisearchCoreConnections as $meilisearchCoreConnection) {
$coreAdmin = $meilisearchCoreConnection->getAdminService();
$indexFieldsInfo = [
'corePath' => $coreAdmin->getCorePath()
@@ -239,7 +239,7 @@ class InfoModuleController extends AbstractModuleController
$this->addFlashMessage(
'',
'Unable to contact Apache Solr server: ' . $this->selectedSite->getLabel() . ' ' . $coreAdmin->getCorePath(),
'Unable to contact Meilisearch server: ' . $this->selectedSite->getLabel() . ' ' . $coreAdmin->getCorePath(),
FlashMessage::ERROR
);
}
@@ -255,11 +255,11 @@ class InfoModuleController extends AbstractModuleController
*/
protected function collectIndexInspectorInfo()
{
$solrCoreConnections = $this->solrConnectionManager->getConnectionsBySite($this->selectedSite);
$meilisearchCoreConnections = $this->meilisearchConnectionManager->getConnectionsBySite($this->selectedSite);
$documentsByCoreAndType = [];
foreach ($solrCoreConnections as $languageId => $solrCoreConnection) {
$coreAdmin = $solrCoreConnection->getAdminService();
$documents = $this->apacheSolrDocumentRepository->findByPageIdAndByLanguageId($this->selectedPageUID, $languageId);
foreach ($meilisearchCoreConnections as $languageId => $meilisearchCoreConnection) {
$coreAdmin = $meilisearchCoreConnection->getAdminService();
$documents = $this->apacheMeilisearchDocumentRepository->findByPageIdAndByLanguageId($this->selectedPageUID, $languageId);
$documentsByType = [];
foreach ($documents as $document) {