Dev.to WebDev 🛠 Dev 👁 1 📖 2 min read

Finding "More Like This" for Emoji: Ranking 310k Combos by Vector Distance

The engineering behind a "similar emoji" search: exact cosine distance over 310,000 real emoji combinations, why we abandoned ANN for brute force, and how decorative-Unicode spam almost ruined the results. Emoji keyboa

The engineering behind a "similar emoji" search: exact cosine distance over 310,000 real emoji combinations, why we abandoned ANN for brute force, and how decorative-Unicode spam almost ruined the results.

Emoji keyboards have a blind spot: they can suggest emoji you've used before, but they can't answer "give me more like this one." You find one combo that's exactly right — 👍🤝 ("deal done") — and there's no "more like this" button anywhere.

We built one: EmojiMagic.io/similar-emoji. Paste any emoji or combination, get 100+ similar combos ranked by meaning. This post is about the retrieval side — what worked, what didn't, and the data-quality surprises.

The corpus is the product

The database isn't an emoji list — it's 310,000+ emoji combinations collected from real usage: bios, captions, names. That's why results read like finished material. Searching near 👍🤝 returns approval sets people actually posted, not a thesaurus expansion of "thumbs up".

But a crawl-shaped corpus has a crawl-shaped problem: a large fraction of rows aren't emoji at all.

Surprise #1: half the corpus is decorative nicknames

A huge chunk of the collected combos are fancy-text nicknames — Unicode decoration characters stacked into stylized names. Zero actual emoji. In embedding space these rows often sit closer to an emoji query than genuine combos do, so they dominate the top of naive nearest-neighbor results. To a user, that's garbled boxes where results should be.

The fix was two filter layers before display:

  1. Emoji filter — if the query contains an emoji, require results to contain one too.
  2. Renderability filter — drop rows with unassigned code points, private-use characters, orphan combining marks, or scripts that no mainstream platform font covers (we generated that blocklist by intersecting every code point in the corpus with the cmap tables of all 473 Windows system fonts).

The filters are prefix-stable per row, so we oversample (4×) and slice — pagination stays consistent without OFFSET pagination over a shrinking set.

Surprise #2: exact scan beat the ANN index

The obvious architecture is approximate nearest neighbor — we tried DiskANN. Then we measured:

  • VECTOR_SEARCH (DiskANN): ~35–40 ms, but duplicate-heavy vector clusters return only cluster representatives — the top-101 overlap with exact results was just 7–9 items.
  • VECTOR_DISTANCE (exact scan): ~130 ms over the full table.

An exact scan at 130 ms, behind an ISR cache with a 1-hour revalidate and an in-memory layer in front, wins against an ANN that misses 90%+ of the true neighbors. We shipped brute force. The lesson is boring and universal: measure recall before paying ANN complexity at this scale.

The product loop

The page works like a "more like this" radio:

  1. Your input is embedded and compared against every combo vector — your own input comes back as match #1 (distance 0), neighbors follow.
  2. Click a card to copy; Ctrl+Click / long-press for multi-select.
  3. Every result has a "find similar" button — chain searches to drill into a style.

Starting points if you want to poke at it: 😂, 🎄, 🎮, or the combo that started it, 👍🤝. The hub page has category entry points (emotions / holidays / gaming / sports / food / nature / work / aesthetic).

Complementary tools in the same loop: Emoji Finder (words → emoji, when you don't have a starting example), Text to Emoji (phrase → combo), and Emoji Mixer (fuse two emoji into art). All free, no signup.

A longer, less technical write-up of the feature lives on the EmojiMagic blog.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.