Services

How to Build Site Search: From MySQL LIKE and FULLTEXT to Meilisearch, Typesense, Algolia and Semantic Search

2026.08.17 · 31 views
How to Build Site Search: From MySQL LIKE and FULLTEXT to Meilisearch, Typesense, Algolia and Semantic Search

The real cost of Traditional Chinese tokenization, the fees nobody budgets, and a 90-day rollout roadmap

Share:

A machine-tool parts catalogue site in Taichung logged 8,412 internal searches last month. Of those, 2,610 (31%) returned nothing. The query log explained why: shoppers typed "bearing 6205" while the database stored "deep groove ball bearing 6205ZZ"; they typed "oil seal" while the catalogue called it a "rotary shaft seal". Search wasn't broken. It was doing string matching, which is a different job. Those zero-result sessions bounced at 74% against a 38% site average. Baymard's 2026 benchmark found that 56% of ecommerce sites have "mediocre or worse" search UX.

When It Pays Off vs. When It Doesn't

Worth building

  • More than 800 searchable items, where the category menu has stopped being navigable.
  • The same product goes by a technical name, a nickname, a part number and an English acronym.
  • Search events appear in over 8% of GA4 sessions and those sessions convert noticeably better.
  • B2B catalogues, spare parts, regulatory knowledge bases: users already know what they want.

Not applicable

  • Brand sites under 300 items. Fixing the category pages returns more than any engine will.
  • Under 3,000 sessions a month. The log sample is too thin to tune synonyms on anything but guesswork.
  • Dirty data: specs buried in description fields, part numbers never normalised. Clean first.
  • Nobody owns the report. Search needs feeding, it is not a one-off delivery.
  • Single-SKU subscriptions or booking-flow-led sites.

Alternatives Compared

OptionTraditional Chinese handlingTypo toleranceMonthly cost (NT$)Fits
MySQL LIKENo tokenizer; leading wildcard kills the indexNone0Under 500 rows, back office
MySQL FULLTEXT + ngramOfficial CJK ngram parser, default token size 2; you supply the stopword listNone0Under 2,000 rows
Meilisearch / Typesense self-hostedMeilisearch segments Chinese with a jieba dictionary and normalises via kvariant conversionBuilt inVPS 800–1,20010K–1M records
Algolia SaaSMature CJK support, strong dashboardBuilt in, tunable~2,950 at 200K searchesTeams who won't run servers
Elasticsearch / OpenSearch self-hostedNeeds analysis-icu or smartcn installed on every nodeManual fuzziness tuning2,400+ for an 8GB boxMillions of docs, heavy aggregations
Vector / hybrid semanticSkips tokenization; understands "something nice as a gift"Inherent300–900 embeddingsKnowledge bases, support FAQs

The Build, Stage by Stage

StageDurationWorkDeliverable
Query log audit3 daysInstrument GA4 events and a search_logs table, collect two weeks of real queriesTop 100 zero-result list
Data modelling4 daysPick searchable fields and weights, lift specs out of description blobs into facetsIndex schema and weighting table
Indexing pipeline5 daysWire Meilisearch through Laravel Scout, queue writes, use observers for incremental updatesRepeatable reindex command
Chinese tuning5 daysCustom dictionary, synonym map, stopwords; handle bopomofo mistypes and mixed alphanumericssynonyms.json and dictionary file
Front end6 daysAutocomplete, facet filters, a zero-result page that actually offers a next stepInstantSearch.js components
Measurement and handover4 daysMetabase dashboard for zero-result rate and CTR@3; block search URLs in robots.txt per Google's guidance on infinite spacesWeekly report template, runbook

What It Actually Costs

Modelled on 60,000 products and 200,000 searches a month. Build: the base package runs about 45 hours at NT$68,000; the full version with facets, hybrid retrieval and a dashboard is roughly 88 hours at NT$132,000. Platform: Meilisearch Cloud starts at US$20 per month, with the usage-based plan at US$30 covering 100K documents and 50K searches. On Algolia's Grow plan the first 10,000 searches are free and every additional 1,000 costs US$0.50, so 200,000 searches lands at US$95 (about NT$2,950). The line items nobody budgets: a full reindex ties up the box for 1.5 to 3 hours and you will run about six a year; synonym upkeep is NT$4,500 a month; dictionary refreshes are 4 hours per quarter at NT$6,000; alerting and dashboards are a one-off NT$9,000. First-year total cost of ownership lands between NT$140,000 and NT$190,000.

Expectation vs. Reality

What clients expectWhat actually happens
Install Meilisearch and it's accurateThe engine only handles recall. Version one usually still shows 12–18% zero results; two or three tuning rounds against the log get it under 5%.
Traditional Chinese just worksMeilisearch segments with a jieba dictionary and normalises traditional characters into simplified variants. You get cross-script matching for free, but distinct characters get merged and proper nouns still need your own dictionary.
A search box is a two-day jobThe API genuinely is two days. Extracting specs from description fields into structured facets takes four to six, and that is the expensive part.

Traps and How to Dodge Them

  • Riding LIKE to 100,000 rows. A leading wildcard voids the index and queries go from 30ms to 4 seconds. Fix: move to FULLTEXT past 2,000 rows, to Meilisearch past 10,000.
  • Leaving ngram token size at 2. Single-character queries return nothing, and stopword behaviour differs from the default parser. Fix: set it against real query lengths and build your own stopword list.
  • Part numbers shredded by the tokenizer. "6205ZZ" splits into "6205" and "ZZ" and ranking falls apart. Fix: give part numbers their own untokenized keyword field with a high weight.
  • Typo tolerance turned up too far. One character of drift turns a short SKU into a different product. Fix: require a minimum term length of five characters and disable tolerance on part-number fields.
  • A dead-end zero-result page. Baymard's research is blunt about needing a viable next step. Fix: relax filters automatically, surface adjacent categories and bestsellers, and put a support channel on the page.
  • Writing to the index synchronously. One API timeout and the whole admin save fails. Fix: queue it, and keep a nightly reconciliation job.

Metrics and a 90-Day Roadmap

  • Days 1–30. Instrument logging and GA4 events, produce the top 100 zero-result queries, and establish baselines for zero-result rate, post-search conversion and CTR@3.
  • Days 31–60. Ship Meilisearch, autocomplete and the rebuilt zero-result page. Target: zero-result rate from 31% down below 12%, CTR@3 from 41% to 55%.
  • Days 61–90. Retune weights from click data and add hybrid semantic retrieval for long-tail phrasing. Target: under 5% zero results, post-search sessions converting 1.8x better than non-search sessions, and a standing monthly log review.

Decision Checklist

  • ☐ More than 800 searchable items?
  • ☐ Are you logging every query?
  • ☐ Do you know your zero-result rate?
  • ☐ Three or more names per product?
  • ☐ Part numbers in a consistent format?
  • ☐ Specs already split out of descriptions?
  • ☐ Do you need facet filtering?
  • ☐ Do users mistype or use phonetic input?
  • ☐ More than 50,000 searches a month?
  • ☐ Will someone read the report monthly?
  • ☐ Are search URLs blocked in robots.txt?
  • ☐ Is reindexing scheduled and reversible?
  • ☐ Does the budget cover year-one upkeep?

FAQ

Is MySQL FULLTEXT with ngram enough?

Under 2,000 rows, with no need for typo tolerance or facets, yes, and it costs nothing extra. The moment you want tolerance, instant autocomplete and relevance ranking, hand-rolling it takes more hours than adopting Meilisearch. The real signal is whether anyone is complaining they can't find things.

Meilisearch, Typesense or Algolia?

Algolia if you refuse to run servers and can live with usage billing. Self-hosted Meilisearch if cost control matters and the data should stay on your machine. Typesense Cloud if you want a predictable bill, since it charges by cluster hour rather than by record or query. All three have Laravel Scout drivers.

Do we really have to maintain our own Chinese dictionary?

Yes. Generic dictionaries don't know your house brands, internal model abbreviations or trade slang. The first pass is roughly 150 to 400 entries; after that, four hours a quarter pulling new terms from the zero-result log keeps it current.

Next Step

ScriptWalker's Site Search Build and Tuning package starts at NT$68,000, covering Laravel Scout integration, a first-pass Chinese dictionary, autocomplete and a rebuilt zero-result page; the full build adds facets, hybrid semantics and a query-log dashboard at NT$132,000. Send us two weeks of search logs and we'll run the zero-result analysis for free.

Share: