Prompt
How do I add typo-tolerant search to a marketplace or portal?
Latest observation
To add typo-tolerant search to a marketplace or portal, you usually combine search quality rules with a fuzzy matching backend. The goal is to let users find items even when they misspell names, brands, or categories.
1) Start with the right search engine
Use a search system that supports:
- Fuzzy matching / edit distance
- Tokenization and stemming
- Synonyms
- Prefix matching
- Ranking and boosting
Common options:
- Elasticsearch / OpenSearch
- Algolia
- Meilisearch
- Typesense
- Solr
If you already use a database-only search, consider moving search to a dedicated engine.
2) Index the fields users search
Index the important text fields separately, such as:
- Title / name
- Brand
- Category
- Tags
- Seller name
- Short description
For marketplaces, usually the most important are:
- product title
- brand
- category
- model number / SKU
3) Enable typo tolerance
Depending on the engine:
Elasticsearch / OpenSearch
Use fuzzy queries:
{
"query": {
"multi_match": {
"query": "iphnoe 15",
"fields": ["title^3", "brand^2", "category"],
"fuzziness": "AUTO"
}
}
}
Algolia
Typo tolerance is built in. You can tune:
typoToleranceminWordSizefor1TypominWordSizefor2Typos
Typesense / Meilisearch
These also support typo tolerance by default, with tuning for thresholds and ranking.
4) Improve relevance with boosting
Not every typo-corrected result should rank equally. Boost:
- Exact title matches
- Brand matches
- Popular items
- In-stock items
- Recent items
- Verified sellers
Example:
- “iPhone 15 Pro Max case” should prefer exact phrase matches over only fuzzy category matches.
5) Normalize your data
Before indexing, standardize:
- Lowercasing
- Accent folding: “café” → “cafe”
- Removing punctuation where appropriate
- Normalizing whitespace
- Mapping abbreviations: “tv” ↔ “television”
This reduces errors and improves fuzzy matching.
6) Add autocomplete and suggestions
Typos often happen during typing, so help users earlier:
- Search-as-you-type suggestions
- Popular queries
- “Did you mean” spell correction
- Query suggestions from click logs
7) Use synonyms and aliases
A typo-tolerant search system should also understand alternate wording:
- “cellphone” = “mobile phone”
- “laptop” = “notebook”
- “sofa” = “couch”
For marketplace portals, also add brand aliases and common abbreviations.
8) Handle SKU / ID searches differently
Users often search by exact IDs:
- SKU
- Model number
- Part number
- Order number
For these, typo tolerance should be weaker or disabled, because a fuzzy match can return wrong items. Use:
- exact match first
- prefix match second
- fuzzy match last
9) Log queries and clicks
Use search analytics to improve:
- Misspellings users frequently make
- Queries with no results
- Queries that lead to clicks/conversions
Then:
- Add synonyms
- Add custom corrections
- Tune fuzziness thresholds
- Improve ranking
10) Test carefully
Measure:
- Search success rate
- Zero-result rate
- Click-through rate
- Conversion rate
- Query latency
Test common typo types:
- Character omission: “iphne”
- Transposition: “iphoen”
- Extra character: “iphhone”
- Wrong key: “laptpo”
- Plural/singular: “shoe” / “shoes”
Practical recommendation
If you want the fastest path:
- Use Algolia if you want managed search and fast implementation.
- Use Elasticsearch/OpenSearch if you need maximum control.
- Use Typesense/Meilisearch if you want simpler setup with built-in typo tolerance.
Typical setup for a marketplace
- Create searchable indexes for products, sellers, and categories.
- Boost exact title, brand, and SKU matches.
- Enable fuzzy matching only for human-entered text.
- Add synonyms and query suggestions.
- Log queries and refine relevance continuously.
If you want, I can also give you:
- a specific implementation example for Elasticsearch, Algolia, or PostgreSQL,
- or a reference architecture for a marketplace search stack.