Open stanbellcom opened 6 years ago
Had the same issues, but solved it a little more complex, mainly because "spellcheck on" did not work at all
function MODULE_search_api_solr_converted_query_alter(\Solarium\QueryType\Select\Query\Query $solarium_query, \Drupal\search_api\Query\QueryInterface $query) {
if( $query->getOption('search_api_spellcheck', FALSE) ) {
$original_keys = $query->getOriginalQuery()->getKeys();
if( empty($original_keys) ) {
return;
}
array_pop($original_keys);
$solarium_query->getSpellcheck()->setQuery(implode(' ', $original_keys));
$solarium_query->getSpellcheck()->setCount(10);
$solarium_query->getSpellcheck()->setOnlyMorePopular(true);
}
}
First of all, thank you for your contribution.
Secondly i have had some problems with this module and it only started working after i have added new hook in my custom module.
Is there something i missed while configuring it, or it does not work by itself?
Thirdly, are you planning to add it to contrib modules? The spelling suggestions is something many people might need.