Emoji search results oddities

Hello there, I am back with some :hamburger: :soccer: :joy: emojis use case questions.

I have a classic index compose of a bunch of entries with the following attributes:

title: "Roll up" Jambon & Mozza"
video_url: "https://www.facebook.com/ChefClub.tv/videos/1145822525442359/"
tags:  ["mozzarella",  "🍸", "fromage", "pizza", "πŸ§€", "jambon", ..., "πŸ•"]

I did no change any default settings from the index. Interpretation & Typography parameters are pristine.

When I do search for :pizza:

I get several results matching Exact words count 1. All good :sparkles:

However the same search with :cheese: fails to return any matches.

You can test the search here.

https://www.algolia.com/realtime-search-demo/test-search-2a480c5a-783d-4697-a337-7f3a60c35207

Appart from the fact that Algolia team favors pizza over cheese what could be the reason for these disparities?

My guess is that internally :pizza: is mapped to pizza and :cheese: to cheese, however we would like fromage to match. Anyhow how should I approach this emoji based search?

3 Likes

The fast answer is that the cheese :cheese: emoji is actually pretty new (2015, not long after this logic was coded) and wasn’t part of unicode yet when our logic to make these emoji work was coded. There is an internal mapping between unicode characters that are emoji and their description and cheese isn’t in there.

A workaround would be to manually on every input, loop over the value, and replace the emoji with a word description.

I will let you know when cheese wedge is an emoji we catch :fishing_pole_and_fish:

Currently this is the unicode -> emoji description mapping:

static const unsigned staticEmojiChars[768] = {0,8,14,30,47,70,78,96,118,126,142,153,161,171,197,218,245,266,282,310,336,363,380,407,432,460,474,493,522,550,570,584,597,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,611,620,629,644,659,669,4294967295U,676,682,697,702,711,721,729,742,754,759,776,787,799,823,832,839,849,856,862,873,883,889,896,906,916,928,933,939,948,959,969,984,997,1009,1022,1032,1044,1059,1073,1083,1089,1102,1123,1129,1134,1140,1153,1181,1196,1207,1217,1226,1233,1247,1253,1262,1270,1280,1290,1300,1312,1320,1335,1357,1377,1388,1403,1418,1427,1446,4294967295U,4294967295U,4294967295U,1458,1465,1481,1495,1510,1525,1542,1552,1570,1578,1591,1605,1619,1633,1649,1664,1678,1689,1711,1726,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,1741,1756,1769,1784,1806,1817,1830,1837,1847,1862,1870,1882,1889,1903,1919,1930,1941,1954,1964,1973,1981,2002,2015,2038,2048,2055,2072,2080,2087,2101,2125,2149,2166,2186,2201,2213,2220,4294967295U,2227,2234,2247,2265,2280,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,2288,2303,2321,2337,2358,2379,2388,2393,2418,2424,2435,2453,2460,2477,2485,2501,2517,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,2533,2537,2543,2546,2560,2564,2570,2578,2585,2589,2596,2606,2612,2618,2624,2630,2634,2639,2645,2652,2660,2668,2672,2676,2681,2690,2698,2711,2715,2719,2728,2740,2745,2759,2768,2775,2790,2801,2825,2830,2838,2844,2851,2867,2882,2890,2901,2910,2921,2933,2942,2954,2969,2980,2992,3001,3010,3020,3033,3043,3053,3064,3073,4294967295U,3084,4294967295U,3089,3093,3098,3104,3111,3144,3179,3214,3250,3267,3284,3297,3312,3329,3349,3365,3371,3382,3393,3401,3409,3415,3421,3428,3435,3450,3456,3464,3470,3480,3494,3511,3525,3538,3549,3568,3588,3592,3597,3601,3607,3614,3642,3664,3688,3703,3725,3741,3764,3784,3800,3810,3822,3827,3847,3856,3870,3886,3892,3903,3926,3940,3944,3950,3974,3984,3991,4000,4012,4025,4033,4045,4053,4058,4068,4080,4085,4095,4100,4108,4126,4134,4148,4161,4172,4188,4202,4219,4230,4242,4255,4268,4286,4303,4320,4352,4372,4385,4390,4406,4423,4446,4454,4466,4478,4492,4505,4520,4536,4549,4571,4581,4599,4617,4629,4652,4678,4702,4727,4744,4782,4787,4805,4815,4824,4836,4849,4853,4865,4882,4897,4912,4921,4939,4950,4975,5002,5012,5022,5030,5044,5054,5069,5086,5100,5107,5116,5147,5159,5169,5180,5190,5202,5208,5219,5226,5231,5250,5256,5268,5286,5313,5332,5344,5355,5363,5377,5395,5431,5464,5496,5526,5557,5565,5577,5587,5600,5643,5658,5675,5692,5710,4294967295U,5717,5730,5741,5747,4294967295U,4294967295U,4294967295U,5761,5787,5841,5920,5971,6026,6048,6071,6104,6112,6140,6171,6179,6193,6224,6256,6274,6295,6299,6304,6314,6319,6349,6358,6370,6383,6415,6446,6499,6532,6561,6590,6601,6640,6677,6702,6727,6758,6763,6778,6785,6792,6805,6811,6818,6829,6839,6852,6885,6914,6929,6949,6969,6986,7004,7025,7044,7065,7084,7109,7136,7167,4294967295U,4294967295U,7200,7221,7257,7270,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,7310,7332,7354,7378,7401,7424,7446,7470,7494,7517,7539,7564,7589,7611,7633,7657,7680,7703,7725,7749,7773,7796,7818,7843,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,4294967295U,7868,7879,7891,7909,7929};
static const char *staticEmojiBuffer = "CYCLONE,FOGGY,CLOSED UMBRELLA,NIGHT WITH STARS,SUNRISE OVER MOUNTAINS,SUNRISE,CITYSCAPE AT DUSK,SUNSET OVER BUILDINGS,RAINBOW,BRIDGE AT NIGHT,WATER WAVE,VOLCANO,MILKY WAY,EARTH GLOBE EUROPE-AFRICA,EARTH GLOBE AMERICAS,EARTH GLOBE ASIA-AUSTRALIA,GLOBE WITH MERIDIANS,NEW MOON SYMBOL,WAXING CRESCENT MOON SYMBOL,FIRST QUARTER MOON SYMBOL,WAXING GIBBOUS MOON SYMBOL,FULL MOON SYMBOL,WANING GIBBOUS MOON SYMBOL,LAST QUARTER MOON SYMBOL,WANING CRESCENT MOON SYMBOL,CRESCENT MOON,NEW MOON WITH FACE,FIRST QUARTER MOON WITH FACE,LAST QUARTER MOON WITH FACE,FULL MOON WITH FACE,SUN WITH FACE,GLOWING STAR,SHOOTING STAR,CHESTNUT,SEEDLING,EVERGREEN TREE,DECIDUOUS TREE,PALM TREE,CACTUS,TULIP,CHERRY BLOSSOM,ROSE,HIBISCUS,SUNFLOWER,BLOSSOM,EAR    MAIZE,EAR    RICE,HERB,FOUR LEAF CLOVER,MAPLE LEAF,FALLEN LEAF,LEAF FLUTTERING IN WIND,MUSHROOM,TOMATO,AUBERGINE,GRAPES,MELON,WATERMELON,TANGERINE,LEMON,BANANA,PINEAPPLE,RED APPLE,GREEN APPLE,PEAR,PEACH,CHERRIES,STRAWBERRY,HAMBURGER,SLICE    PIZZA,MEAT ON BONE,POULTRY LEG,RICE CRACKER,RICE BALL,COOKED RICE,CURRY AND RICE,STEAMING BOWL,SPAGHETTI,BREAD,FRENCH FRIES,ROASTED SWEET POTATO,DANGO,ODEN,SUSHI,FRIED SHRIMP,FISH CAKE WITH SWIRL DESIGN,SOFT ICE CREAM,SHAVED ICE,ICE CREAM,DOUGHNUT,COOKIE,CHOCOLATE BAR,CANDY,LOLLIPOP,CUSTARD,HONEY POT,SHORTCAKE,BENTO BOX,POT    FOOD,COOKING,FORK AND KNIFE,TEACUP WITHOUT HANDLE,SAKE BOTTLE AND CUP,WINE GLASS,COCKTAIL GLASS,TROPICAL DRINK,BEER MUG,CLINKING BEER MUGS,BABY BOTTLE,RIBBON,WRAPPED PRESENT,BIRTHDAY CAKE,JACK-O-LANTERN,CHRISTMAS TREE,FATHER CHRISTMAS,FIREWORKS,FIREWORK SPARKLER,BALLOON,PARTY POPPER,CONFETTI BALL,TANABATA TREE,CROSSED FLAGS,PINE DECORATION,JAPANESE DOLLS,CARP STREAMER,WIND CHIME,MOON VIEWING CEREMONY,SCHOOL SATCHEL,GRADUATION CAP,CAROUSEL HORSE,FERRIS WHEEL,ROLLER COASTER,FISHING POLE AND FISH,MICROPHONE,MOVIE CAMERA,CINEMA,HEADPHONE,ARTIST PALETTE,TOP HAT,CIRCUS TENT,TICKET,CLAPPER BOARD,PERFORMING ARTS,VIDEO GAME,DIRECT HIT,SLOT MACHINE,BILLIARDS,GAME DIE,BOWLING,FLOWER PLAYING CARDS,MUSICAL NOTE,MULTIPLE MUSICAL NOTES,SAXOPHONE,GUITAR,MUSICAL KEYBOARD,TRUMPET,VIOLIN,MUSICAL SCORE,RUNNING SHIRT WITH SASH,TENNIS RACQUET AND BALL,SKI AND SKI BOOT,BASKETBALL AND HOOP,CHEQUERED FLAG,SNOWBOARDER,RUNNER,SURFER,TROPHY,HORSE RACING,AMERICAN FOOTBALL,RUGBY FOOTBALL,SWIMMER,HOUSE BUILDING,HOUSE WITH GARDEN,OFFICE BUILDING,JAPANESE POST OFFICE,EUROPEAN POST OFFICE,HOSPITAL,BANK,AUTOMATED TELLER MACHINE,HOTEL,LOVE HOTEL,CONVENIENCE STORE,SCHOOL,DEPARTMENT STORE,FACTORY,IZAKAYA LANTERN,JAPANESE CASTLE,EUROPEAN CASTLE,RAT,MOUSE,OX,WATER BUFFALO,COW,TIGER,LEOPARD,RABBIT,CAT,DRAGON,CROCODILE,WHALE,SNAIL,SNAKE,HORSE,RAM,GOAT,SHEEP,MONKEY,ROOSTER,CHICKEN,DOG,PIG,BOAR,ELEPHANT,OCTOPUS,SPIRAL SHELL,BUG,ANT,HONEYBEE,LADY BEETLE,FISH,TROPICAL FISH,BLOWFISH,TURTLE,HATCHING CHICK,BABY CHICK,FRONT-FACING BABY CHICK,BIRD,PENGUIN,KOALA,POODLE,DROMEDARY CAMEL,BACTRIAN CAMEL,DOLPHIN,MOUSE FACE,COW FACE,TIGER FACE,RABBIT FACE,CAT FACE,DRAGON FACE,SPOUTING WHALE,HORSE FACE,MONKEY FACE,DOG FACE,PIG FACE,FROG FACE,HAMSTER FACE,WOLF FACE,BEAR FACE,PANDA FACE,PIG NOSE,PAW PRINTS,EYES,EAR,NOSE,MOUTH,TONGUE,WHITE UP POINTING BACKHAND INDEX,WHITE DOWN POINTING BACKHAND INDEX,WHITE LEFT POINTING BACKHAND INDEX,WHITE RIGHT POINTING BACKHAND INDEX,FISTED HAND SIGN,WAVING HAND SIGN,OK HAND SIGN,THUMBS UP SIGN,THUMBS DOWN SIGN,CLAPPING HANDS SIGN,OPEN HANDS SIGN,CROWN,WOMANS HAT,EYEGLASSES,NECKTIE,T-SHIRT,JEANS,DRESS,KIMONO,BIKINI,WOMANS CLOTHES,PURSE,HANDBAG,POUCH,MANS SHOE,ATHLETIC SHOE,HIGH-HEELED SHOE,WOMANS SANDAL,WOMANS BOOTS,FOOTPRINTS,BUST IN SILHOUETTE,BUSTS IN SILHOUETTE,BOY,GIRL,MAN,WOMAN,FAMILY,MAN AND WOMAN HOLDING HANDS,TWO MEN HOLDING HANDS,TWO WOMEN HOLDING HANDS,POLICE OFFICER,WOMAN WITH BUNNY EARS,BRIDE WITH VEIL,PERSON WITH BLOND HAIR,MAN WITH GUA PI MAO,MAN WITH TURBAN,OLDER MAN,OLDER WOMAN,BABY,CONSTRUCTION WORKER,PRINCESS,JAPANESE OGRE,JAPANESE GOBLIN,GHOST,BABY ANGEL,EXTRATERRESTRIAL ALIEN,ALIEN MONSTER,IMP,SKULL,INFORMATION DESK PERSON,GUARDSMAN,DANCER,LIPSTICK,NAIL POLISH,FACE MASSAGE,HAIRCUT,BARBER POLE,SYRINGE,PILL,KISS MARK,LOVE LETTER,RING,GEM STONE,KISS,BOUQUET,COUPLE WITH HEART,WEDDING,BEATING HEART,BROKEN HEART,TWO HEARTS,SPARKLING HEART,GROWING HEART,HEART WITH ARROW,BLUE HEART,GREEN HEART,YELLOW HEART,PURPLE HEART,HEART WITH RIBBON,REVOLVING HEARTS,HEART DECORATION,DIAMOND SHAPE WITH A DOT INSIDE,ELECTRIC LIGHT BULB,ANGER SYMBOL,BOMB,SLEEPING SYMBOL,COLLISION SYMBOL,SPLASHING SWEAT SYMBOL,DROPLET,DASH SYMBOL,PILE    POO,FLEXED BICEPS,DIZZY SYMBOL,SPEECH BALLOON,THOUGHT BALLOON,WHITE FLOWER,HUNDRED POINTS SYMBOL,MONEY BAG,CURRENCY EXCHANGE,HEAVY DOLLAR SIGN,CREDIT CARD,BANKNOTE WITH YEN SIGN,BANKNOTE WITH DOLLAR SIGN,BANKNOTE WITH EURO SIGN,BANKNOTE WITH POUND SIGN,MONEY WITH WINGS,CHART WITH UPWARDS TREND AND YEN SIGN,SEAT,PERSONAL COMPUTER,BRIEFCASE,MINIDISC,FLOPPY DISK,OPTICAL DISC,DVD,FILE FOLDER,OPEN FILE FOLDER,PAGE WITH CURL,PAGE FACING UP,CALENDAR,TEAR-OFF CALENDAR,CARD INDEX,CHART WITH UPWARDS TREND,CHART WITH DOWNWARDS TREND,BAR CHART,CLIPBOARD,PUSHPIN,ROUND PUSHPIN,PAPERCLIP,STRAIGHT RULER,TRIANGULAR RULER,BOOKMARK TABS,LEDGER,NOTEBOOK,NOTEBOOK WITH DECORATIVE COVER,CLOSED BOOK,OPEN BOOK,GREEN BOOK,BLUE BOOK,ORANGE BOOK,BOOKS,NAME BADGE,SCROLL,MEMO,TELEPHONE RECEIVER,PAGER,FAX MACHINE,SATELLITE ANTENNA,PUBLIC ADDRESS LOUDSPEAKER,CHEERING MEGAPHONE,OUTBOX TRAY,INBOX TRAY,PACKAGE,E-MAIL SYMBOL,INCOMING ENVELOPE,ENVELOPE WITH DOWNWARDS ARROW ABOVE,CLOSED MAILBOX WITH LOWERED FLAG,CLOSED MAILBOX WITH RAISED FLAG,OPEN MAILBOX WITH RAISED FLAG,OPEN MAILBOX WITH LOWERED FLAG,POSTBOX,POSTAL HORN,NEWSPAPER,MOBILE PHONE,MOBILE PHONE WITH RIGHTWARDS ARROW AT LEFT,VIBRATION MODE,MOBILE PHONE OFF,NO MOBILE PHONES,ANTENNA WITH BARS,CAMERA,VIDEO CAMERA,TELEVISION,RADIO,VIDEOCASSETTE,TWISTED RIGHTWARDS ARROWS,CLOCKWISE RIGHTWARDS AND LEFTWARDS OPEN CIRCLE ARROWS,CLOCKWISE RIGHTWARDS AND LEFTWARDS OPEN CIRCLE ARROWS WITH CIRCLED ONE OVERLAY,CLOCKWISE DOWNWARDS AND UPWARDS OPEN CIRCLE ARROWS,ANTICLOCKWISE DOWNWARDS AND UPWARDS OPEN CIRCLE ARROWS,LOW BRIGHTNESS SYMBOL,HIGH BRIGHTNESS SYMBOL,SPEAKER WITH CANCELLATION STROKE,SPEAKER,SPEAKER WITH ONE SOUND WAVE,SPEAKER WITH THREE SOUND WAVES,BATTERY,ELECTRIC PLUG,LEFT-POINTING MAGNIFYING GLASS,RIGHT-POINTING MAGNIFYING GLASS,LOCK WITH INK PEN,CLOSED LOCK WITH KEY,KEY,LOCK,OPEN LOCK,BELL,BELL WITH CANCELLATION STROKE,BOOKMARK,LINK SYMBOL,RADIO BUTTON,BACK WITH LEFTWARDS ARROW ABOVE,END WITH LEFTWARDS ARROW ABOVE,ON WITH EXCLAMATION MARK WITH LEFT RIGHT ARROW ABOVE,SOON WITH RIGHTWARDS ARROW ABOVE,TOP WITH UPWARDS ARROW ABOVE,NO ONE UNDER EIGHTEEN SYMBOL,KEYCAP TEN,INPUT SYMBOL FOR LATIN CAPITAL LETTERS,INPUT SYMBOL FOR LATIN SMALL LETTERS,INPUT SYMBOL FOR NUMBERS,INPUT SYMBOL FOR SYMBOLS,INPUT SYMBOL FOR LATIN LETTERS,FIRE,ELECTRIC TORCH,WRENCH,HAMMER,NUT AND BOLT,HOCHO,PISTOL,MICROSCOPE,TELESCOPE,CRYSTAL BALL,SIX POINTED STAR WITH MIDDLE DOT,JAPANESE SYMBOL FOR BEGINNER,TRIDENT EMBLEM,BLACK SQUARE BUTTON,WHITE SQUARE BUTTON,LARGE RED CIRCLE,LARGE BLUE CIRCLE,LARGE ORANGE DIAMOND,LARGE BLUE DIAMOND,SMALL ORANGE DIAMOND,SMALL BLUE DIAMOND,UP-POINTING RED TRIANGLE,DOWN-POINTING RED TRIANGLE,UP-POINTING SMALL RED TRIANGLE,DOWN-POINTING SMALL RED TRIANGLE,CIRCLED CROSS POMMEE,CROSS POMMEE WITH HALF-CIRCLE BELOW,CROSS POMMEE,NOTCHED LEFT SEMICIRCLE WITH THREE DOTS,CLOCK FACE ONE OCLOCK,CLOCK FACE TWO OCLOCK,CLOCK FACE THREE OCLOCK,CLOCK FACE FOUR OCLOCK,CLOCK FACE FIVE OCLOCK,CLOCK FACE SIX OCLOCK,CLOCK FACE SEVEN OCLOCK,CLOCK FACE EIGHT OCLOCK,CLOCK FACE NINE OCLOCK,CLOCK FACE TEN OCLOCK,CLOCK FACE ELEVEN OCLOCK,CLOCK FACE TWELVE OCLOCK,CLOCK FACE ONE-THIRTY,CLOCK FACE TWO-THIRTY,CLOCK FACE THREE-THIRTY,CLOCK FACE FOUR-THIRTY,CLOCK FACE FIVE-THIRTY,CLOCK FACE SIX-THIRTY,CLOCK FACE SEVEN-THIRTY,CLOCK FACE EIGHT-THIRTY,CLOCK FACE NINE-THIRTY,CLOCK FACE TEN-THIRTY,CLOCK FACE ELEVEN-THIRTY,CLOCK FACE TWELVE-THIRTY,MOUNT FUJI,TOKYO TOWER,STATUE    LIBERTY,SILHOUETTE    JAPAN,MOYAI,";
4 Likes

:thumbsup: I am going to do the translation server side, since we cover a subset of food related emojis it wont be too long. Thanks!

1 Like

I just started the move from Emoji 8 to 9, so depending on how much work the transition is outside of emoji, it should be available relatively soon! :boom:

2 Likes