Short answer: for e-commerce product search, this retrieval architecture uses a feed-led, allowlisted crawl, one canonical record per sellable SKU, and source evidence on every semantic match before it affects ranking.
Near-duplicate detection sounds like an embedding problem. It is mostly a boundary problem. A game catalog can expose the same item through a publisher page, a regional offer, a console filter, and a tracking URL. If those copies enter retrieval as independent documents, the nearest-neighbor score rewards repetition instead of relevance.
How should retrieval architecture set crawl boundaries for game product search?
Start with an admission contract, not a crawler. The contract names allowed hosts, path prefixes, locale rules, canonical identity, and deletion signals. For an e-commerce product search index, the sellable unit is usually a SKU or offer ID. A page URL is only one observation of that unit.
The gaming case needs two identities. game_id groups editions that share the same work; offer_id identifies a platform, region, currency, and entitlement that a customer can actually buy. A deluxe edition should not collapse into the base game when the price, included content, or platform differs. Conversely, a color-like filter or tracking parameter should not create another semantic document.
I keep the crawl queue downstream of the catalog feed. The feed decides membership and deletion. A bounded fetch enriches accepted IDs with descriptions, system requirements, and policy text. This ordering gives grounding a hard edge: a passage can only be cited if its canonical ID is still eligible.
A useful boundary record looks like this:
| Field | Why it exists |
|---|---|
| canonical ID | joins pages, offers, and chunks |
| source URL | lets a reviewer open the evidence |
| locale and platform | prevents cross-region claims |
| observed revision | detects stale text |
| admission decision | explains why a URL was accepted or rejected |
The rule is simple. No identity, no embedding.
Build log: the smallest citable dedupe pass
The first pass does lexical normalization, then semantic retrieval. Lexical checks catch exact and near-exact titles cheaply; embeddings handle reordered wording such as “RPG bundle with soundtrack” versus “includes digital soundtrack and role-playing game.” The semantic score is a candidate generator, not a deletion command.
Here is a deliberately small TypeScript boundary and dedupe pipeline. It uses generic interfaces so the policy can sit in front of any vector store.
type Offer = {
offerId: string;
gameId: string;
title: string;
description: string;
locale: string;
platform: string;
sourceUrl: string;
revision: string;
deleted: boolean;
};
type Chunk = {
offerId: string;
text: string;
citation: { url: string; revision: string; locale: string };
};
const blockedQueryKeys = new Set(["utm_source", "utm_medium", "gclid"]);
function canonicalize(raw: string): string {
const u = new URL(raw);
const kept = [...u.searchParams.entries()]
.filter(([key]) => !blockedQueryKeys.has(key))
.sort(([a], [b]) => a.localeCompare(b));
u.search = new URLSearchParams(kept).toString();
u.hash = "";
u.pathname = u.pathname.replace(/\\/+$/, "") || "/";
return u.toString();
}
function admit(offer: Offer, allowedHosts: Set<string>): boolean {
const host = new URL(offer.sourceUrl).host;
return !offer.deleted && allowedHosts.has(host) && offer.offerId.length > 0;
}
function toChunk(offer: Offer): Chunk {
return {
offerId: offer.offerId,
text: `${offer.title}\\n${offer.description}`,
citation: { url: canonicalize(offer.sourceUrl), revision: offer.revision, locale: offer.locale },
};
}
The fetcher should still enforce content type, byte limits, robots policy, and a timeout. Those are safety controls, not evidence that a page belongs in the corpus. I log every rejection with a reason code. A run that accepts 112,000 IDs when the upstream feed contains 100,000 deserves a stop-and-review event; the exact threshold is a team policy, but the comparison must exist.
For each candidate pair, store both IDs, the score, the fields that matched, and the citations used to calculate the decision. A high vector score with different platform or locale metadata is a review candidate, not an automatic merge. A citation to a page that has since been deleted should make the result ineligible, even if the vector remains in storage during a rebuild.
Small logs save large arguments.
What fails when crawl scope and grounding drift apart?
The common failure is URL multiplication. Facets, sort orders, referral parameters, and locale redirects produce pages that look different to a crawler but repeat the same offer. The vector index then returns three copies of one game and hides a genuinely related result. Deduplication after retrieval is too late because the duplicate already consumed fetch, parse, and embedding capacity.
The opposite failure is over-aggressive collapsing. If game_id is used as the only key, a PC license can overwrite a console entitlement, or a Japanese store description can become evidence for a US price. Keep product identity, offer identity, and content revision separate.
A third failure is citation drift. The index contains a chunk from revision r17, while the page now serves r18; a generated answer quotes the old system requirements without showing the mismatch. Store revision metadata beside the chunk and verify it at response time when the claim is sensitive. The Retrieval-Augmented Generation paper describes retrieval as conditioning generation on external passages; that makes passage provenance part of correctness, not decorative UI.
I measure this with a replay set of 200 queries: duplicate rate in top-k, recall of the expected offer ID, citation coverage, and stale-citation count. Your mileage may vary on the thresholds. The important part is that a ranking gain cannot hide a grounding regression.
What would I change at scale, and when is this boundary wrong?
At scale, split the pipeline into immutable stages: admission, fetch, parse, chunk, embed, and index promotion. Give each stage an idempotency key such as offerId:revision:locale. Keep the previous index addressable while a new embedding model is evaluated, then switch a version pointer after the replay set passes. This keeps rollback to a pointer change instead of a second full crawl.
Use a table-driven policy for retention and permissions. Product descriptions may be public, while keys, activation instructions, or moderation notes are not. A single vector namespace with a metadata filter is fragile when a new document type arrives without the expected field; separate collections make an accidental cross-boundary result harder.
The catch is that feed-led crawling is not suitable when the source has no stable IDs or reliable deletion signal. Stick with a capped recursive audit for discovery, or build an export that supplies identity first. A bounded crawl is also the wrong choice for an open web research corpus where membership is intentionally unknown; there, depth and byte budgets matter more than SKU completeness.
The decision rule I ship is: feed-led membership when identity and deletion are authoritative; bounded enrichment when page text is the source of searchable detail; a hybrid when both are true. Record that rule in an architecture decision record and test it in CI with duplicate fixtures, locale collisions, deleted offers, and missing citations.
Top comments (0)