Skip to content

Catalog search: typo tolerance and aliases - #1051

Merged
helpcodeai merged 2 commits into
mainfrom
helpcode/catalog-search-fuzzy
Oct 12, 2026
Merged

helpcodeai merged 2 commits into
mainfrom
helpcode/catalog-search-fuzzy

Conversation

@helpcodeai

Copy link
Copy Markdown
Contributor

From the 12 Oct demand review: 11 workspaces got nothing for typos such as "telgram" (Telegram is the most-searched term), and "mercado livre", "amocrm" and "facebook" found nothing.

What changes

One search module, adapters/catalog-search.ts, now drives three places: the chat find tools (setup_find_connectors / anythingmcp_find_connectors), the store and /welcome. The frontend keeps a copy, and a test fails if the two drift apart.

How a query is matched:

  • Normalising: case and accents are ignored, and filler words in six languages are dropped ("bot de telegram" searches for telegram).
  • Direct matches come first: an exact name or alias, then a slug or name word, an alias word, a prefix, and finally description and category.
  • Typo matches: used only when there are fewer than 3 direct matches. They allow 1 or 2 edits (a swapped pair of letters counts as one), compare only against slug, name and aliases, and words under 4 letters never match this way. At most 5 are returned, ranked below the direct ones.
  • Partial matches for multi-word queries: at most 10.

Aliases. There is a new optional aliases field on adapters, and 24 adapters get it, e.g. Mercado Livre, amoCRM, Twitter, Sendinblue, OTRS, D365 and GA4.

Logging. catalog_search events now carry missing and match (direct/fuzzy/partial), so searches rescued by typo matching are still counted.

Unlisted adapters never appear, on Cloud or self-hosted.

Optional "aliases" on adapter JSONs (AdapterMeta, listAdapters, validator,
docs) for former names, translations, short forms and umbrella brands.
Added to 24 adapters: Mercado Livre, amoCRM, Facebook/Meta on the Meta
connectors, Twitter, D365, Navision, SAP B1, lexoffice, base.com,
Sendinblue, AdWords and others. Aliases do not change adapter versions.
One search module (backend adapters/catalog-search.ts, byte-identical copy
in frontend lib/, checked by a spec) replaces the scorer in
setup_find_connectors and the store's matchesSearch:
- stopwords in en/de/es/it/pt/fr dropped ("bot de telegram" -> telegram);
- direct matches ranked: whole name or alias, word, word start, other text;
- fewer than 3 direct results: Damerau-Levenshtein fallback on slug, name
  and aliases (1 edit for 4-6 letters, 2 for longer, same first letter for
  short words), capped and ranked below direct matches;
- a multi-word query with no full match falls back to partial matches;
- a one-letter query matches only an exact slug, name or alias.

catalog_search events now carry missing words from every surface and
match=direct|fuzzy|partial, so typo-rescued searches stay visible.
@helpcodeai
helpcodeai merged commit 51123e7 into main Oct 12, 2026
18 of 19 checks passed
@helpcodeai
helpcodeai deleted the helpcode/catalog-search-fuzzy branch October 12, 2026 15:37
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant