Product codes and order IDs retrieve the wrong records: how should keyword and vector search cooperate?
When exact identifiers retrieve poorly, first verify that parsing and indexing preserved their full values, then separate exact matching from semantic retrieval. Vector similarity represents meaning but does not guarantee correct distinction between codes differing by one character.
Start troubleshooting here
When exact identifiers retrieve poorly, first verify that parsing and indexing preserved their full values, then separate exact matching from semantic retrieval. Vector similarity represents meaning but does not guarantee correct distinction between codes differing by one character. Preserve keyword or structured-field queries for these tasks and use hybrid retrieval for natural-language needs.
Test complete identifiers separately from similar names
This applies when a full code returns a different product with a similar name or when processing hyphens and leading zeros makes records disappear. Prepare public synthetic identifiers differing by one character and their documents, with explicit expected objects. Avoid real customer orders. Correct object identity matters more than a page of apparently relevant results.
Separate identifier field processing from semantic similarity
Follow values from source to index, checking case, leading zeros and tokenization, and confirm that the queried field retains the complete identifier. Compare keyword and vector results independently to determine whether filters or ranking suppress the exact target. Semantic similarity to the wrong model number does not establish that two products are equivalent.
Preserve an exact-match route for identifier queries
Store stable identifiers in fields suitable for exact conditions and configure platform-supported filtering or matching. Keep searchable text and embeddings for descriptions. Inspect result fusion in hybrid queries and constrain the search with explicit identifiers where appropriate. Analyzer or field changes may need reprocessing in a test index; establish migration and recovery first.
Check exact records and natural-language retrieval together
Test full codes, formatting variations and natural-language questions without codes. Exact inputs must resolve to the intended record, while descriptive queries should retrieve relevant material. An absent code must not be replaced with a nearby model number. Preserve IDs and original values when comparing results; titles and total counts cannot establish reliable exact matching.
This article queried no real orders and claims no universal hybrid weighting. Keyword queries may still use analyzers, so full-text retrieval is not universally byte-exact matching. Business rules must decide whether case and punctuation can be ignored. Before normalizing identifiers, verify that the process cannot merge distinct objects.
Checked sources
These sources support the concepts and methods described here. Examples and test scope are labeled separately; check the version of the tools you use.