# Query expansion based on user behaviour

[Grab](https://yomu.fyi/company/grab) · Shuailong Liang · Nov 16, 2022

**Type:** Problem & solution

## Summary

Grab developed a query expansion framework to resolve search issues such as typos, multi-language terms, missing alternatives, and word spacing. The corpus is generated through manual annotation for the top thousand fat-head queries and session-based data mining of user rewrite patterns. Offline pipelines extract adjacent query rewrites occurring within 30 seconds where only the second query generated a click, limiting candidates to three per query for serving efficiency. In production, expanded keywords pass through a query understanding, multi-recall, and result fusion flow with automated pruning of underperforming pairs. Online A/B testing across six Southeast Asian countries showed improvements in click-through and conversion rates, with data-mined expansions outperforming manual annotations alone.

## Context

Grab users encountered suboptimal search results caused by typos, synonyms, spacing issues, multi-language queries, and queries returning non-operational or out-of-radius merchants without alternatives.

## Approach / What changed

Grab built a query expansion pipeline combining manual annotations for the top 1,000 queries with data mining on session rewrite logs, serving up to three expansion candidates through a multi-recall and result fusion architecture.

## Takeaways

- User rewrite mining heuristics extracted adjacent query pairs within 30-second windows where the initial query had no click and the second query received a click.
- Expansion candidates were capped at three per query to maintain serving efficiency across query understanding, multi-recall, and result fusion stages.
- A/B testing across six countries demonstrated that data-mined query expansions produced higher click-through and conversion rate uplifts than manual annotations alone.

**Tags:** [Architecture](https://yomu.fyi/topic/architecture), [Data Pipelines](https://yomu.fyi/topic/data-pipelines), [Search](https://yomu.fyi/topic/search)

[Read original post](https://engineering.grab.com/query-expansion-based-on-user-behaviour)
