← all work N.BANZON_JR
case 03·search infrastructure·vivacity app

Migrating search off Algolia, onto Elasticsearch and Tencent ES

Search moved off Algolia onto Elasticsearch and Tencent ES, split by region so global and China Mini Program users each hit a cluster near them. Relevance moved with it — into search templates the team can tune without shipping a release, with ES highlight queries backing the Mini App's autocomplete.

role
Backend Engineer
from → to
Algolia → ES
regions
Global + China
surfaces
Web + Mini Programs
01 — context

A hosted index the team couldn't reach into

Search ran on Algolia. It worked, but two constraints mattered. Relevance changes went through the vendor's model rather than something the team could shape and version, and users inside China hit a hosted index far from them, on surfaces where latency is very visible: Mini Programs, with autocomplete firing on every keystroke.

02 — analysis

Two problems, one shared answer

Both the relevance problem and the geography problem come from not owning the index. Elasticsearch solves the first: query logic lives in search templates, stored server-side and tunable without a deploy. Tencent ES solves the second: the same index shape, hosted inside China, serving China traffic. One migration, two wins — provided the ingest pipeline can write to both.

before
Hosted search, one region
Relevance changes require vendor-side settings; China users served from outside China.
after
Owned index, two regions
Search templates versioned and tuned live; China traffic served by Tencent ES.
03 — architecture

One ingest pipeline, two clusters, templated queries

property sources → ingest → dual-region index → surfaces
Yardi feed Entrata feed Sturent feed ingestnormalizebull queue Elasticsearch Tencent ES global region china region web + app search Mini Programs search templates + highlight queries
01
Search templates, not hard-coded queries
Relevance lives in stored templates, so boosting, filtering and scoring can be optimized dynamically without deploying changes.
02
Highlight queries for autocomplete
ES highlight templates back the Mini App's typeahead, matching what users see to what actually matched in the index.
03
Same shape in both clusters
The ingest pipeline writes an identical index shape to Elasticsearch and Tencent ES, so query code doesn't branch by region.
04 — outcome

Faster where it was slowest, tunable where it was locked

China Mini Program users query a cluster in their own region instead of crossing the border on every keystroke. Global search keeps its own cluster. Relevance work no longer waits on a release, and the index became the foundation the AI search agent was built on top of.

2
clusters, one index shape
0
deploys to tune relevance
in-region latency for CN users
Elasticsearch Tencent ES Search templates NestJS Redis Bull Behavioral Analytics
case 01
Retrieve, rerank, reason →
case 02
A custom KrakenD gateway →