public function addSynonymsAction(string $baseWord, string $synonyms, $overrideExisting)
    {
        if (empty($baseWord) || empty($synonyms)) {
            $this->addFlashMessage(
                'Please provide a base word and synonyms.',
                'Missing parameter',
                FlashMessage::ERROR
            );
        } else {
            $baseWord = mb_strtolower($baseWord);
            $synonyms = mb_strtolower($synonyms);

            $coreAdmin = $this->selectedSolrCoreConnection->getAdminService();
            if ($overrideExisting && $coreAdmin->getSynonyms($baseWord)) {
                $coreAdmin->deleteSynonym($baseWord);
            }
            $coreAdmin->addSynonym($baseWord, GeneralUtility::trimExplode(',', $synonyms, true));
            $coreAdmin->reloadCore();

            $this->addFlashMessage(
                '"' . $synonyms . '" added as synonyms for base word "' . $baseWord . '"'
            );
        }

        $this->redirect('index');
    }
public function addSynonymsAction(string $baseWord, string $synonyms, $overrideExisting)
    {
        if (empty($baseWord) || empty($synonyms)) {
            $this->addFlashMessage(
                'Please provide a base word and synonyms.',
                'Missing parameter',
                FlashMessage::ERROR
            );
        } else {
            $baseWord = mb_strtolower($baseWord);
            $synonyms = mb_strtolower($synonyms);

            $coreAdmin = $this->selectedSolrCoreConnection->getAdminService();
            if ($overrideExisting && $coreAdmin->getSynonyms($baseWord)) {
                $coreAdmin->deleteSynonym($baseWord);
            }
            $coreAdmin->addSynonym($baseWord, GeneralUtility::trimExplode(',', $synonyms, true));
            $coreAdmin->reloadCore();

            $this->addFlashMessage(
                '"' . $synonyms . '" added as synonyms for base word "' . $baseWord . '"'
            );
        }

        $this->redirect('index');
    }
public function addSynonymsAction ( string $ baseWord , string $ synonyms , $ overrideExisting ) { if ( empty ( $ baseWord ) || empty ( $ synonyms ) ) { $ this -> addFlashMessage ( 'Please provide a base word and synonyms.' , 'Missing parameter' , FlashMessage :: ERROR ) ; } else { $ baseWord = mb_strtolower ( $ baseWord ) ; $ synonyms = mb_strtolower ( $ synonyms ) ; $ coreAdmin = $ this -> selectedSolrCoreConnection -> getAdminService ( ) ; if ( $ overrideExisting && $ coreAdmin -> getSynonyms ( $ baseWord ) ) { $ coreAdmin -> deleteSynonym ( $ baseWord ) ; } $ coreAdmin -> addSynonym ( $ baseWord , GeneralUtility :: trimExplode ( ',' , $ synonyms , true ) ) ; $ coreAdmin -> reloadCore ( ) ; $ this -> addFlashMessage ( '"' . $ synonyms . '" added as synonyms for base word "' . $ baseWord . '"' ) ; } $ this -> redirect ( 'index' ) ; }
Add synonyms to selected core

@param string $baseWord
@param string $synonyms
@param bool $overrideExisting
@return void
Add synonyms to selected core