Semantic search looks like it works until someone pastes a part number into the box.
Ask a vector index for HS-2841-B and it returns "related" chunks about heating systems, because embeddings treat the string as vague semantics rather than an exact identifier. Ask BM25 for the same thing and it usually gets the row β unless the tokeniser mangled the code first, which is the part nobody checks.
Hybrid retrieval is the usual answer: run both, fuse the rankings. The interesting engineering is in the two edges of that sentence: how each side tokenises your actual corpus, and how you fuse without inventing a scale.
The lexical side is a dictionary choice
Most Postgres full-text setups call to_tsquery with a language configuration. The default English config stems words, drops stop words and splits on punctuation β all reasonable, all wrong for identifiers.β¦