Book a free call

Semantic Search Best Practices: 7 Rules That Work

Semantic search finds answers by meaning, not exact words. Seven practices - chunking, model choice, hybrid retrieval and measurement - keep results accurate.

Hertiv engineering teamReviewed by a senior engineer
7 min read
Semantic Search Best Practices: 7 Rules That Work
On this page

Short answer

Semantic search works well when you chunk documents by idea, pick an embedding model by testing it on your own questions, combine keyword and semantic ranking, and measure results against a fixed test set. Those four habits matter more than the model you choose, because most failures come from bad chunks, stale documents or untested changes.

Semantic search is a way of finding information by meaning instead of by matching exact words. It turns each document and each query into a set of numbers, called an embedding, that places similar meanings close together, then returns the documents whose embeddings sit closest to the query.

A keyword search misses a document that says "refund policy" when the user types "get my money back", because the words do not match. Semantic search catches it, because the two phrases mean nearly the same thing and their embeddings land near each other.

That strength is also the risk. Meaning is fuzzy, so a semantic system can return a confident-looking answer from the wrong document. The practices in this article - chunking, model choice, hybrid retrieval, query handling and measurement - are what keep that risk under control. If you are new to the idea, what semantic search is explains the basics first.

Chunking is the decision that shapes everything else in semantic search, because the retriever returns whole chunks, not whole documents. A chunk that is too long mixes several topics and dilutes the match; a chunk that is too short loses the context the answer needs.

Chunk sizeWorks well forWatch out for
100-200 wordsFAQ entries and short help articlesLoses surrounding context
300-500 wordsBlog posts and product pagesMay mix two topics
500-800 wordsReports and long guidesWeak matches on one section
With 10-20% overlapAny long documentExtra storage and slower indexing

Start with 300 to 500 words and an overlap of about a tenth of the chunk, so a sentence that straddles a boundary still appears in full somewhere. Then test with real questions instead of guessing: if the right chunk appears but the answer is missing, the chunk is too short; if the wrong chunk wins, it is too long or too mixed.

Keep one idea per chunk where you can. Split a long guide at its headings, keep tables with the paragraph that explains them, and never split a list across two chunks if the list is the answer.

Which embedding model should you choose?

An embedding model turns text into numbers, and the model you pick decides what "similar" means in your system. A general-purpose model works for most English content; a model trained on your domain - legal, medical or technical text - usually ranks better on that content, at the cost of setup time.

Pick by testing, not by reputation. Take 50 real questions and the document each should find, run them through two or three candidate models, and count how often the right document lands in the top five. The model that wins on your questions is the right one, even if another model wins on a public benchmark.

Record the model name and version with every index you build. If you change models later, you must re-index everything, because embeddings from different models cannot be compared. That rebuild is the hidden cost of switching, so choose once and change rarely.

Size matters less than fit. A smaller model that ranks your questions well and runs cheaply beats a larger model that is slow and no more accurate on your content. Measure both accuracy and cost before you commit.

Should you combine semantic search with keywords?

Hybrid search runs a keyword search and a semantic search together and merges the two ranked lists. It is the default answer for most teams, because each method covers the other's weak spots.

Keywords win on exact tokens: product codes, names, error messages and reference numbers. Meaning wins on paraphrase: a user describing a problem in their own words. A system that only does one of the two will fail quietly on the other kind of question.

A simple merge works well: take the top results from each method, score them by rank rather than by raw score, and keep the combined top ten. Give the keyword side more weight when your content is full of codes and names, and the semantic side more weight when users write in plain language.

Test the merge on your own questions. If keyword-only already answers most of them, hybrid adds little; if it does not, hybrid is usually the single biggest improvement you can make. See how to implement semantic search for the build order.

How do you handle the query before searching?

Most failed searches start with a bad query, not a bad index. A short or vague question - "invoice problem" - has too little meaning for the embedding to work with, so the first job is to make the query clearer before it is searched.

Three fixes cover most cases. First, expand the query with synonyms from your own content, so "invoice problem" also searches for "billing error" and "payment failed". Second, apply filters the user already gave you, such as product, region or date, before ranking. Third, rewrite the query with a language model only when the original is a full sentence, and keep the original terms in the search as well.

Log the queries that return no good result. A weekly review of the worst 20 queries tells you which synonyms to add and which content is missing, and it is cheaper than tuning the model.

Do not rewrite every query. Short keyword-style queries work best as they are, and rewriting them can add words the user never meant.

How do you measure whether semantic search works?

Semantic search cannot be judged by feel. You need a fixed set of test questions with known right answers, run the same way every time, so a change to chunking or models shows up as a number going up or down.

Build the set from real logs: 50 to 100 questions your users actually asked, each paired with the document that answers it. Then measure two things: how often the right document appears in the top five results, and how often it is first. Track both after every change, and keep the set fixed so results stay comparable.

Add human review on top. Each week, read 20 real searches and mark each result as right, partly right or wrong. The counts tell you whether the system is improving; the wrong answers tell you why, which is usually a chunking problem, a missing document or a bad synonym.

Re-run the set after every index rebuild. A model update or a re-chunk can silently move results, and the test set is the only thing that catches it. Advanced retrieval work, such as reranking and hybrid search, is covered in advanced RAG techniques.

Example (hypothetical): a support site with 40,000 articles

Example (hypothetical): a support team runs a help centre with 40,000 articles and answers about 500 search queries a week. Its first semantic search returns the right article in the top five for 310 of 500 questions, so 190 searches end in a wrong or missing answer.

The team samples 100 of the failed searches and finds two causes: 55 fail because the right article is split across two chunks, and 45 fail because users describe the problem in words the articles never use. It re-chunks long guides at their headings and adds the users' words as synonyms.

After the fix, the right article appears in the top five for 385 of 500 questions, up from 310. Each wrong answer used to cost about 6 minutes of follow-up chat, so the 75 fewer failures save about 7 and a half hours a week. The team keeps the 100-question sample and re-runs it after every change.

What are the common mistakes?

The most common semantic search mistakes are skipping measurement, trusting one method alone, and treating the index as a one-time job.

  • Chunking by fixed character count, which splits tables and lists in the middle.
  • Picking an embedding model on benchmark scores instead of your own questions.
  • Indexing stale or duplicate documents, so the retriever returns the wrong version.
  • Never reviewing failed queries, so the same gaps repeat for months.
  • Changing models without re-indexing, which mixes embeddings that cannot be compared.
  • Judging quality by demo queries instead of a fixed test set.

Fix measurement first. Once you can see which searches fail and why, every other practice in this article becomes a small, testable change.

Key takeaways

  • Chunk by idea, not by fixed character count, so tables and lists stay whole
  • Pick an embedding model on your own questions, not on public benchmarks
  • Run hybrid search: keywords for codes and names, meaning for paraphrase
  • Rewrite and expand vague queries, and log the ones that fail
  • Measure with a fixed test set of 50 to 100 real questions after every change

Frequently asked questions

What is the best chunk size for semantic search?

Start with 300 to 500 words and about 10% overlap, then test with real questions. If the right chunk appears but the answer is missing, the chunk is too short. If the wrong chunk wins, it is too long or mixes two topics.

Should I use semantic search or keyword search?

Use both. Keywords win on exact tokens such as product codes, names and error messages, while semantic search wins when users describe a problem in their own words. A hybrid merge of the two ranked lists is the default for most teams.

How many test questions do I need to measure semantic search?

Fifty to 100 real questions, each paired with the document that answers it, is enough to start. Measure how often the right document lands in the top five and how often it is first, and keep the set fixed so changes stay comparable.

Do I need to re-index when I change embedding models?

Yes. Embeddings from different models cannot be compared, so a model change means rebuilding the whole index. Record the model name and version with each index, and treat switching as a planned migration, not a setting change.

Why does my semantic search return the wrong document?

The usual causes are a chunk that mixes two topics, a stale or duplicate document, or a query written in words the content never uses. Review the worst 20 failed queries each week; they will point to the chunking, synonym or content fix you need.

Can semantic search work without a language model?

Yes. The retrieval itself only needs an embedding model and a vector store. A language model is useful for rewriting queries or drafting answers from retrieved chunks, but it is an add-on, not a requirement for semantic search to work.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: AI and agent systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Building semantic search into your product? Talk to Hertiv.

A senior engineer replies within one business day. Or see our RAG Development service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to contact@hertiv.com.

Prefer email? Write to contact@hertiv.com
Estimate costBook a call