Semantic search versus keyword search

Keyword search compares letters: it finds what contains the terms of the query. Semantic search compares meanings: it finds what means the same, even if it uses other words. Neither always wins, which is why current search engines combine the two in what is called hybrid search.

By Joan Martorell

How do they differ?

KeywordSemantic
What it comparesThe terms of the query with those of the text.The meaning of the query with that of each text.
How it does itA word index and a relevance formula.Meaning vectors (embeddings) and the distance between them.
Gets rightCodes, references, proper names, exact phrases.Synonyms, descriptions of a need, natural language.
Gets wrongSynonyms and intent. Without added tolerance, typos too.Codes and meaningless strings. It can return something “similar” that is not what was asked for.
What it needsOnly the texts.An embedding model, and computing one vector per element and per query.
Why it returns somethingEasy to explain: it contains the word.Less obvious: it is close in meaning.

When does keyword search win?

  • When the user knows the exact identifier: a reference, a product code, an order number.
  • With proper names and uncommon brands, which a language model may not know.
  • When you need a guaranteed literal match, for example in legal texts.

When does semantic search win?

  • With synonyms: “sofa” and “couch”, “laptop” and “notebook”.
  • When the query describes an intent and not an object: “something to hang a picture”.
  • With natural language questions, like those of a help centre.
  • When the catalogue uses a technical vocabulary and users a colloquial one.

It is running both at once and combining their results. That way a typo is resolved by text matching, a synonym is resolved by semantic matching, and the user does not need to know which of the two did the work.

XEYE works this way on every query. It computes a text score with fuzzy matching, which tolerates typos and partial words, and a semantic score, and returns a combined score per result. If you ask for it with include_score_breakdown, the response includes the two separately.

What does the data say?

We measured XEYE with queries labelled by type on three catalogues in Spanish. This is the fraction of queries in which the expected element came in first position:

Query type10 products250 activities4,727 codes
Synonym0.890.930.43
Intent1.000.770.50
Typo1.000.750.67
Attribute0.890.780.50
Top-1 with the default model. Methodology and limits on the results page.

Two takeaways. In the Products catalogue, synonym and intent queries, which a keyword search engine cannot resolve, hit the first position in 89% and 100% of cases, and in Activities synonym is the strongest category. And in the large, dense catalogue, the strongest category is typo, the only one that text matching can resolve on its own. The two signals complement each other. The full data is in measured results.

Which one should I choose?

  • Keyword only if your users almost always search by code or exact name.
  • Hybrid in almost every other case: product catalogues, help centres, directories.
  • Semantic only is rarely worth it: you lose typo tolerance and accuracy with codes.

If you want to try hybrid search without building anything, a semantic search API gives it to you ready-made.

Frequently asked questions

Does semantic search understand typos?

Not reliably. A typo can change the vector of a short word a lot. That is why hybrid search adds fuzzy text matching, which is designed for typos.

Is semantic search slower?

It adds one step: turning the query into a vector. In our measurements, the full hybrid search takes 28 to 55 milliseconds on average on the server with the default model.

Do I need a lot of data for it to work?

No. The models come already trained on general text. It works with a catalogue of ten elements.

What is fuzzy matching?

A text comparison that measures how similar two strings are instead of requiring them to be equal. That is why “runing shoos” finds “running shoes”.

Try it with your own data

Create an account, upload a list and run your first search in about five minutes. You start with €5 of credit, no card required.

Keep reading