Short answer: ship hybrid retrieval for recruiting candidate search, with independently refreshable profile chunks, lexical and semantic candidate generation, and explicit release checks for freshness, identity, and access control. Choose vector-only retrieval only when exact filters, newly changed records, and traceable match reasons genuinely do not matter.
That is a narrow recommendation, not a claim that hybrid search wins everywhere. Recruiting queries mix concepts such as "operated a support team" with hard strings such as a certification, location, employer, or programming language. Semantic similarity helps with the first kind. Exact matching and structured filters protect the second. The release constraint is less glamorous: a changed candidate profile must become searchable without rebuilding an opaque document blob.
For a one-person SaaS, the revenue-per-hour test is brutal. Search quality has to be explainable enough to debug between weekly releases, while the undifferentiated indexing work should stay boring. I would spend engineering time on chunk boundaries, update propagation, and evaluation cases before tuning a clever reranker.
The constraint that changes the choice
A candidate is not one document in practice. A profile may contain current role details, earlier jobs, skills, education, location, availability, and recruiter notes. Flattening all of that into one embedding makes updates easy to describe but hard to reason about: a small edit forces the whole representation to change, and the strongest part of a long profile can drown out a short but decisive fact.
Vector-only retrieval also asks one score to do too many jobs. "Customer support lead" and "managed an escalation queue" can be semantically close, while an exact credential or a required city is better handled as a token match or a filter. Hybrid retrieval separates those responsibilities. It gathers candidates from semantic and lexical indexes, applies hard eligibility rules, then fuses the ranked lists before any optional reranking.
Freshness is the deciding constraint. Store chunks under a stable candidate ID and a stable section key, then replace only the sections whose source version changed. A delete must remove every derived chunk. An access change must take effect before a stale search result can expose the old record. Those are application invariants, not search-engine features.
Keep the source profile authoritative. The retrieval index is derived state.
How should you build retrieval for recruiting candidate search?
Start with section-aware chunks, not arbitrary character windows. One chunk can represent a current role; another can represent a prior role; skills and recruiter notes can remain separate. Preserve candidate ID, section type, source version, and visibility metadata beside every chunk. The text sent to semantic retrieval should include enough local context to make sense alone, but it should not duplicate the full profile into every section.
Then run two retrieval paths. The lexical path rewards literal terms. The semantic path finds paraphrases. Apply permission and eligibility filters as early as the underlying index permits, merge by candidate ID rather than chunk ID, and retain the evidence that produced each hit. Reciprocal rank fusion is a useful implementation shape because it combines positions without pretending that lexical and vector scores share a scale. The constant and result counts below are starting configuration, not universal quality claims; evaluation should choose them for the actual corpus.
The distinction between chunks and candidates matters. If five chunks from one long profile occupy five of the first ten positions, the recruiter sees less diversity and the ranking quietly favors verbose candidates. Aggregate the strongest evidence per candidate and return a compact set of matching sections. Don't let document length become an accidental qualification.
The smallest working Node.js implementation
The core can stay behind generic interfaces. This TypeScript sketch assumes both indexes return ordered matches with stable candidate and chunk identifiers. It fuses ranks, keeps the best evidence, rejects candidates outside the request's allowed set, and returns candidates rather than raw chunks.
type Match = {
candidateId: string;
chunkId: string;
excerpt: string;
};
type SearchIndex = {
search(query: string, limit: number): Promise<Match[]>;
};
type CandidateHit = {
candidateId: string;
score: number;
evidence: Match[];
};
export async function searchCandidates(
query: string,
allowedCandidateIds: ReadonlySet<string>,
lexical: SearchIndex,
semantic: SearchIndex,
): Promise<CandidateHit[]> {
const [lexicalMatches, semanticMatches] = await Promise.all([
lexical.search(query, 40),
semantic.search(query, 40),
]);
const byCandidate = new Map<string, CandidateHit>();
const addRankedMatches = (matches: Match[]) => {
matches.forEach((match, index) => {
if (!allowedCandidateIds.has(match.candidateId)) return;
const hit = byCandidate.get(match.candidateId) ?? {
candidateId: match.candidateId,
score: 0,
evidence: [],
};
hit.score += 1 / (60 + index + 1);
if (!hit.evidence.some((item) => item.chunkId === match.chunkId)) {
hit.evidence.push(match);
}
byCandidate.set(match.candidateId, hit);
});
};
addRankedMatches(lexicalMatches);
addRankedMatches(semanticMatches);
return [...byCandidate.values()]
.sort((left, right) => right.score - left.score)
.slice(0, 10)
.map((hit) => ({ ...hit, evidence: hit.evidence.slice(0, 3) }));
}
This is intentionally incomplete at the product layer. The caller still owns structured filters, result hydration from the authoritative profile store, and the final authorization check. That last check is mandatory even when the retrieval index supports filters, because derived state can lag its source during an update.
The indexing side needs the same restraint. Compute a source version for each profile, create deterministic chunk IDs such as candidateId:sectionType:sectionId, and upsert changed chunks in one job. Record the indexed source version separately. Search responses can then be compared with the current profile version; a mismatch is an observable freshness condition rather than a mysterious relevance complaint.
No magic here.
A release checklist that tests retrieval, not demos
A demo query proves that a path works. A release set should prove that the system fails in acceptable ways. Build a small judged set from representative, privacy-safe query and profile fixtures. Each case should state eligible candidates, excluded candidates, expected evidence, and which requirement is exact versus semantic. I'm not sure what acceptance threshold fits a particular recruiting workflow without labeled relevance judgments and recruiter feedback; those two inputs should resolve it.
Before release, check these behaviors:
- Chunking: current and previous roles remain distinguishable; short profiles are not penalized; one verbose profile cannot fill the result page with its chunks.
- Freshness: an edited role replaces its earlier chunk; deleting a profile removes all derived chunks; an access change is enforced at read time while indexes converge.
- Recall and precision: paraphrase cases exercise semantic retrieval, while exact skills, credentials, names, and locations exercise lexical matching and filters.
- Identity: fusion happens by candidate ID, duplicates collapse, and hydrated results still refer to the indexed source version.
- Security: tenant and recruiter permissions are tested with allowed and forbidden fixtures, including a permission change between indexing and retrieval.
- Operations: indexing lag, rejected indexing jobs, empty-result rate, and the contribution of each retrieval path are visible without logging private profile text.
- Rollback: the previous index generation remains selectable until the new generation passes the same judged set and freshness checks.
Run the checklist against the exact release artifact. A configuration change to the embedding representation, tokenizer, chunk builder, fusion constant, or filters creates a new retrieval system even when no application code changed. Version those inputs together, rebuild into a separate index generation, compare results, and switch traffic only after the checks pass.
The practical error budget is not limited to latency. It includes stale results, forbidden results, missing exact matches, unexplained semantic matches, and index jobs that never advance the recorded source version. A fast answer with the wrong access boundary is not a degraded answer. It is a failed release.
What I would change at scale, and when vector-only wins
At larger corpus or query volume, I would move fusion closer to the storage engine when that reduces data transfer, batch index updates, and add a reranker only after the judged set shows a repeatable ordering problem. I would also split freshness objectives by field: an access or deletion change needs stricter handling than a rewritten summary. More machinery earns its place only when an observed bottleneck or evaluation failure pays for it.
The catch is that hybrid retrieval carries two indexes, two sets of tuning choices, and more evidence to inspect. It is not suitable when the corpus is tiny enough for direct inspection, when every query is purely conceptual, or when the application can tolerate delayed updates and has no exact eligibility constraints. In that narrow case, stick with vector-only retrieval because the operational surface is smaller. If queries are almost entirely exact and structured, neither option is the right center of gravity; use lexical search and database filters first, adding semantic retrieval only for demonstrated paraphrase gaps.
For the recruiting case, ship the hybrid design only after deletion, access, freshness, and candidate-level deduplication pass alongside relevance. That choice costs more operational attention than vector-only retrieval, but it keeps exact requirements exact and makes semantic evidence inspectable. It also leaves the weekly shipping loop intact: relevance changes can be evaluated and rolled back without rewriting the profile system.
References
- Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks: https://arxiv.org/abs/2005.11401
Top comments (0)