diff --git a/lib/blacklight/solr/response/spelling.rb b/lib/blacklight/solr/response/spelling.rb index 75f5958b12..840ab16617 100644 --- a/lib/blacklight/solr/response/spelling.rb +++ b/lib/blacklight/solr/response/spelling.rb @@ -73,10 +73,11 @@ def collation return unless spellcheck && spellcheck[:suggestions] suggestions = spellcheck[:suggestions] - if suggestions.index("collation") - suggestions[suggestions.index("collation") + 1] - elsif spellcheck.key?("collations") - spellcheck['collations'].last + case suggestions + when Array + suggestions[suggestions.index("collation") + 1] if suggestions.index("collation") + when Hash + spellcheck['collations'].last if spellcheck.key?("collations") end end end