Draft v1 · Prepared for supervisor discussion

Enhancing Arabic E‑Commerce Product Search through LLM‑Based Query Expansion over a Hybrid MySQL–Elasticsearch Retrieval Architecture

تحسين البحث عن المنتجات في المتاجر الإلكترونية العربية باستخدام توسيع الاستعلامات بنماذج اللغة الكبيرة ضمن بنية بحث هجينة تجمع بين MySQL وElasticsearch
Candidate: Mohammed Alozaibi University of Aden · Faculty of Computer & IT Date: Aug 2026 Status: idea validated against literature · awaiting guidance
5 research questions 28 papers collected & annotated 4 dataset candidates assessed 12-month plan drafted Full proposal + design docs in repo
If you only read one section: jump to §9 Decision Points — eight specific questions where your guidance will shape the thesis.
01

The Idea in One Paragraph

Arabic shoppers type short queries that rarely match how products are described online. Searching ثلاجة fails when the catalog says براد (dialect synonym) or ثلاجه (orthographic variant).

This thesis designs, builds, and rigorously evaluates an e-commerce search pipeline combining:

  • (a) Hybrid retrieval architecture — MySQL as transactional source of truth; Elasticsearch as a searchable projection supporting lexical BM25 and dense vector search, with Arabic-aware normalization.
  • (b) LLM-based query expansion — large language models generate synonyms, dialectal variants, and full rewrites of the query before retrieval.

We measure how much each layer improves retrieval quality (NDCG / MRR / Recall) and what latency and cost it adds — comparing several open Arabic-centric LLMs against commercial ones.

Alternative titles (for you to steer)

A
Enhancing Arabic E-Commerce Product Search through LLM-Based Query Expansion over a Hybrid MySQL–Elasticsearch Retrieval Architecture
— most descriptive; names the architecture and the technique.
B
Bridging the Lexical and Semantic Gap in Arabic Product Search: A Hybrid Retrieval Framework Combining BM25, Dense Vectors, and LLM Query Expansion
— more “IR-research” flavored.
C
A Comparative Study of LLM Strategies for Arabic E-Commerce Query Understanding in Hybrid Search Systems
— most “scientific study” flavored.
02

Why Arabic Product Search Is Hard

ChallengeExampleWho handles it today
Orthographic variabilityثلاجة / ثلاجه · أرنب / ارنبElastic normalization ✓
Diacritics & tatweelمُدرَّسة vs مدرسة · ووووصلاتElastic normalization ✓
Morphological richnessوالثلاجاتِ = و+ال+ثلاجة+اتLight stemming ~partial
Dialect ↔ MSA vocabulary gapبراد vs ثلاجة · جوال / موبايل / هاتفNobody ✗
Brand transliterationsسامسونج / سامسونغ · Samsung · ايفون / آيفون · iPhoneNobody ✗
Mixed-script queriesايفون 15 pro max (AR+EN+digits)Nobody ✗

The crux: keyword engines fix rows 1–3 but cannot handle semantics (rows 4–6). Dense embeddings handle paraphrase but fail exact SKUs, codes, rare brands. Industrial evidence (Amazon, Taobao, Walmart) shows LLM query rewriting closes exactly this gap in English — no rigorous study exists for Arabic product search.

03

The Gap This Thesis Fills

  • No public benchmark for Arabic e-commerce product-search relevance. Amazon’s ESCI covers EN/JA/ES only. Arabic IR benchmarks (Mr. TyDi-ar, MIRACL-ar) exist but target Wikipedia-style QA search — not catalogs.
  • No systematic evaluation of LLM query-expansion strategies (synonyms vs. rewrite vs. HyDE-style hypothetical documents) in Arabic. English equivalents: Google QE-prompting 2023, Taobao BEQUE 2024, Walmart 2024.
  • No reference architecture integrating relational data (MySQL) + hybrid lexical/dense retrieval (Elasticsearch) + LLM expansion under realistic latency constraints for Arabic.

Positioning sentence used in the thesis  “Arabic retrieval benchmarks exist for open-domain search (Mr. TyDi, MIRACL), but none targets e-commerce product search with catalog semantics — we fill that gap.”

Planned contributions
  1. An Arabic e-commerce search benchmark (annotated artifact, publishable on its own)
  2. Open-source end-to-end reference implementation (MySQL→ES sync, Arabic analyzers, hybrid retriever, pluggable LLM-expansion service)
  3. First systematic comparison of LLMs for Arabic query expansion across strategies × models × query types
  4. Deployment guidelines given latency/cost budgets
04

Research Questions & Hypotheses

RQ1 · EFFECTIVENESS

How much does LLM query expansion improve NDCG@10 / MRR@10 / Recall@100 over (a) plain BM25 and (b) BM25 + rule-based Arabic normalization/synonyms?

RQ2 · STRATEGY COMPARISON

Which expansion strategy works best for Arabic: synonym generation, full rewrite, or HyDE-style hypothetical documents? And which LLMs — open Arabic-centric (ALLaM, Jais, AceGPT, Qwen) vs commercial (GPT/Claude/Gemini)?

RQ3 · HYBRID ARCHITECTURE

Does BM25 + dense-vector retrieval fused via RRF beat each individual retriever for Arabic product search, consistent with English findings?

RQ4 · COST & LATENCY

What latency/cost does the expansion step add, and can caching + small local models make it production-viable?

RQ5 · DIALECT ROBUSTNESS (optional)

Do gains differ between MSA and dialectal queries?

Hypotheses:  H1: +5–15% NDCG@10 from LLM expansion over normalized-BM25 (based on English results).  H2: hybrid > either single retriever.  H3: Arabic-centric LLMs produce better dialect expansions than general multilingual models.  H4: cached median added latency < 150 ms.
Statistical testing planned: paired t-test / Friedman on per-query metrics.
05

Data Strategy — Assessed This Month

Track A — Existing Arabic benchmark usable with caveats

prestoai/arabic-ecom-search-bench (Hugging Face, Apr 2026) — audited by me on 2026‑08‑22:

FormatProper TREC-style benchmark (queries.jsonl + corpus.jsonl + qrels.tsv) — plugs into standard IR evaluation directly
Scale29,014 queries · 107,041 products · 262,599 judgments (graded 0–3 + hard negatives)
Published baselineMeilisearch run included: nDCG@10 = 0.624, Recall@10 = 0.483 — an immediate number to beat
Dialect coverageMSA + Libyan dialect explicitly tagged

⚠ Red flags: judgment provenance undisclosed (human? click logs? LLM?) · no license file · corpus has product titles only · Libyan-dialect skew · brand new, zero community validation.
Action taken: will email the authors asking about provenance + redistribution permission; their answer feeds the dataset chapter either way.

Track B — Our own annotated slice primary artifact

  • 300–500 realistic queries written by us: MSA head terms, long-tail, Egyptian/Gulf/Levantine dialect variants (deliberately beyond the Libyan-only bench), brand transliterations, mixed AR/EN.
  • 2–3 annotators using translated WANDS annotation guidelines; inter-annotator agreement Cohen’s κ ≥ 0.7.
  • Judgments pooled from multiple retrieval runs so no single system biases candidates.

Supporting layers

ResourceRole in thesis
Mr. TyDi-ar · MIRACL-ar · mMARCO-arOpen-domain Arabic retrieval benchmarks — sanity-check embedding models & analyzer settings before product experiments (papers already collected)
Amazon ESCI (130K queries, 2.6M judgments)Methodological template for labels & protocol (no Arabic split)
Wayfair WANDS (233K judgments, MIT)Annotation-guideline template — includes public guidelines PDF we adapt
milistu/AMAZON-Products-2023-Arabic (~117K products)Bulk real catalog for scaling index/load tests
06

Proposed Architecture

User query
براد ايجي شايل ١٦ قدم
LLM Query Expansion Service research core
synonym generation · dialect variants · full rewrite · HyDE — pluggable models, response cache
↓ expanded query variants
BM25 lexical
Arabic normalization + stemming analyzers
RRF fusion
reciprocal rank fusion
Dense kNN
multilingual / Arabic embeddings
Ranked results
evaluated offline: NDCG · MRR · Recall · significance tests

Data layer: MySQL = source of truth (products, categories) → one-command sync projects into Elasticsearch for search. Everything runs locally via Docker Compose; fully reproducible.

07

Models & Tools (shortlist)

Embedding models (dense side)

ModelWhy
GATE Arabic-Triplet-Matryoshka-V2 (135M)SOTA Arabic semantic similarity on MTEB
MARBERT (163M)dialect coverage baseline
multilingual-e5-large (560M)strong multilingual fallback
Commercial APIsupper-bound reference points

LLMs for expansion (the experiment grid)

ModelAccessNote
ALLaM-7Bopen, Apache-2.0Saudi national model, strong Arabic scores
Jais 13B/70Bopen, Apache-2.0UAE, good dialect handling
AceGPT, Qwen2.5openculturally aligned / strong multilingual
GPT-4o-mini · Claude Haiku · Gemini FlashAPIcommercial upper bounds + cost/latency reference

Tooling: Elasticsearch free tier (BM25 + kNN + RRF) · CAMeL Tools & Farasa (Arabic processing) · ranx/pytrec_eval (metrics) · Label Studio (annotation UI) · Ollama/vLLM (local LLM serving) · Locust/k6 (load tests). All free/open except commercial API calls.

08

12-Month Plan

MonthsMilestone
1–2Literature deep-read · finalize RQs · proposal defense ← we are here
2–3Dataset acquisition + annotation guidelines (adapt WANDS/ESCI methodology)
3–4Baselines: MySQL-LIKE → BM25 → BM25 + tuned Arabic analyzers
4–6Hybrid retrieval: embeddings selection, kNN, RRF fusion
6–8LLM expansion service · model × strategy experiment grid
8–9Full evaluation matrix · significance testing · ablations
9–10Latency/cost experiments · caching design
10–12Writing · error analysis · polish · defense
09

Reading Done So Far

28 papers collected as PDFs, organized and annotated in the repository (research/papers/ + docs/02-literature-review.md):

10
Arabic NLP foundations
(AraBERT, MARBERT, GATE, stemming, dialect normalization, Arabic LLMs)
7
E-commerce search
(ESCI, WANDS, Amazon/Taobao/Walmart query rewriting)
5
LLM query expansion
(Google QE-prompting, CSQE, LLM-QE, best practices)
3
Hybrid retrieval
(RRF, SPLADE, score fusion)
3
Arabic IR benchmarks
(Mr. TyDi, MIRACL, mMARCO)

Every paper has an annotation entry (findings + relevance to our work); sources tracked with download status in research/SOURCES.md. Closest prior art identified: SHEINfer (Arabic product category inference, 2026) and an Arabic e-commerce search challenges survey (2022) — neither does query expansion nor relevance benchmarking.

10

Decision Points — Where I Need Your Guidance ⭐

These are the choices I can defend either way, but would rather align with you early. Space is left under each for your notes.

D1 Which title do you prefer (or suggest a better one)?
A: architecture-flavored · B: IR-research flavored · C: comparative-study flavored — see §1.
D2 Data strategy: approve two-track approach?
Track A (existing bench, quick start) + Track B (our own annotated slice as the citable artifact). Alternative: rely solely on Track B, or add machine-translated ESCI as a third arm.
D3 Keep RQ5 (dialect robustness) as core or optional?
It elevates the work from engineering to science, but adds annotation effort. My recommendation: keep it if timeline holds.
D4 Scope of dialects for Track B annotation
Minimum viable: MSA + Yemeni/Gulf (locally relevant)? Broader: + Egyptian + Levantine? More dialects = more annotators needed.
D5 Size of the LLM comparison grid
Full grid (4 open + 3 commercial × 3 strategies ≈ 21 configs) is thorough but expensive in time/API cost. Could prune to 2 strategies × 4 models first, expand later.
D6 Annotators & budget
Track B needs 2–3 human annotators for κ ≥ 0.7 agreement. Are fellow students available? Any university resources/support for annotation tooling?
D7 University requirements check
Is an Arabic title mandatory? Specific thesis-format template? Proposal-defense deadline I should target?
D8 Anything to cut or add before I start building?
E.g., drop the load-testing part, or add a small user study if the committee values it.