diff --git a/app/models/search/results.rb b/app/models/search/results.rb index 64613fc3..c3cc1f27 100644 --- a/app/models/search/results.rb +++ b/app/models/search/results.rb @@ -70,12 +70,13 @@ def aggregation_records ayah_result[:ayah][:words].find{|word| word['word_id'] == id.to_i}[:highlight] = word_id_array.first end end + nil + else + hash end - - hash end - ayah_result.merge!(match: match) + ayah_result.merge!(match: match.compact) ayah_result end