/** * Enables or disables spellchecking for the query. * * @param boolean $spellchecking Enables spellchecking when set to TRUE, deactivates spellchecking when set to FALSE, defaults to TRUE. */ public function setSpellchecking($spellchecking = true) { if ($spellchecking) { $this->queryParameters['spellcheck'] = 'true'; $this->queryParameters['spellcheck.collate'] = 'true'; $maxCollationTries = $this->solrConfiguration->getSearchSpellcheckingNumberOfSuggestionsToTry(); $this->addQueryParameter('spellcheck.maxCollationTries', $maxCollationTries); } else { unset($this->queryParameters['spellcheck']); unset($this->queryParameters['spellcheck.collate']); unset($this->queryParameters['spellcheck.maxCollationTries']); } }