You are here

class SearchApiElasticsearchElasticaSpellcheck in Search API Elasticsearch 7

Hierarchy

Expanded class hierarchy of SearchApiElasticsearchElasticaSpellcheck

File

modules/elastica/includes/SearchApiElasticsearchElasticaSpellcheck.inc, line 3

View source
class SearchApiElasticsearchElasticaSpellcheck extends SearchApiSpellcheck {
  function __construct($response) {
    $suggestions = $response
      ->getSuggests();
    foreach ($suggestions as $suggestion_group) {
      foreach ($suggestion_group as $suggestion_set) {
        $original = $suggestion_set['text'];
        foreach ($suggestion_set['options'] as $suggestion) {
          $this
            ->addSuggestion(new SearchApiSpellcheckSuggestion($original, $suggestion['text']));
        }
      }
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SearchApiElasticsearchElasticaSpellcheck::__construct function
SearchApiSpellcheck::$spellchecks protected property
SearchApiSpellcheck::$suggestions protected property
SearchApiSpellcheck::addSpellcheck public function This call also maintains a list of sub interances using the same interface. These services are then also check when getSuggestion() is called.
SearchApiSpellcheck::addSuggestion public function Add a suggestion object to the class which is stored and then checked when getSuggestion() is called.
SearchApiSpellcheck::getSuggestion public function Pass a string and if it can be improved by any of the suggestions or sub-services added then return a suggesiton. If no change can be suggested return FALSE.
SearchApiSpellcheck::getSuggestionLinkForArg public function Accepts a Drupal arg number which is used to get the value submitted and returns a link to the current page with whatever value is in the URL argument replaced with a suggestion.
SearchApiSpellcheck::getSuggestionLinkForGet public function Accepts a a query string key which is used to get the value submitted and
SearchApiSpellcheck::suggestString public function Check if any of the added spellcheck suggestions match either all or part of the string. Overrides SearchApiSpellcheckInterface::suggestString