Commit ea07a44fe0f9e71c5ca17bfeec2f5863eaa019aa

Authored by Aurimas Šeputis
Committed by GitHub
1 parent b8603970

Split emoji token names into words (#1470)

Showing 2 changed files with 2 additions and 1 deletions   Show diff stats
lib/searchkick/query.rb
... ... @@ -25,7 +25,7 @@ module Searchkick
25 25 term = term.to_s
26 26  
27 27 if options[:emoji]
28   - term = EmojiParser.parse_unicode(term) { |e| " #{e.name} " }.strip
  28 + term = EmojiParser.parse_unicode(term) { |e| " #{e.name.tr('_', ' ')} " }.strip
29 29 end
30 30  
31 31 @klass = klass
... ...
test/match_test.rb
... ... @@ -254,6 +254,7 @@ class MatchTest < Minitest::Test
254 254 def test_emoji_multiple
255 255 store_names ["Ice Cream Cake"]
256 256 assert_search "🍨🍰", ["Ice Cream Cake"], emoji: true
  257 + assert_search "🍨🍰", ["Ice Cream Cake"], emoji: true, misspellings: false
257 258 end
258 259  
259 260 # operator
... ...