123456789101112131415161718192021222324252627282930313233 |
- <?php
- class SearchApiSpellcheckSolr extends SearchApiSpellcheck {
-
- function __construct($response) {
- if (isset($response->spellcheck->suggestions)) {
- $suggestions = $response->spellcheck->suggestions;
- foreach ($suggestions as $word => $data) {
- foreach ($data->suggestion as $suggestion) {
- $this->addSuggestion(new SearchApiSpellcheckSuggestion($word, $suggestion));
- }
- }
- }
- }
- }
|