Home / Glossary / AI and machine learning

AI and machine learning

Lexical search

Also searched as: sparse retrieval

In shortLexical search finds documents by matching the actual words in a query to the words in the content. It is the classic keyword approach, often built on an inverted index and scoring methods such as BM25. It is fast and precise for exact terms, but it can miss results that use different words for the same idea.

By Aditya Aman, working in SEO for almost a decade and hands-on with AEO and GEO as those fields have developed. Updated 25 November 2026.

  • What it isRetrieval based on matching words and terms.
  • Also calledKeyword search, sparse retrieval.
  • StrengthExact names, codes and rare terms.
  • WeaknessSynonyms and paraphrase.
  • Common pairingCombined with vector search as hybrid search.

Lexical search treats text as words. The system breaks documents into terms and builds an index that records which documents contain which terms. A query is broken the same way, and documents are scored by how well their terms match, often giving more weight to terms that are rare across the collection.

It is called sparse retrieval because each document is represented by a long list of possible terms where most entries are empty. This contrasts with embeddings, which are dense lists of numbers.

Where does lexical search still win?

Exact match matters more than people expect. Product codes, brand names, legal references, error messages and unusual technical terms are hard for meaning-based systems to handle, but a word index finds them reliably.

It is also easy to explain. You can see why a page matched, which helps when you debug site search or audit what your own pages say.

CaseLexical searchWhy
Search for a part numberWorks wellExact string match
Search for a brand nameWorks wellName appears in text
Question phrased in new wordsOften missesNo shared terms
Typos and variantsNeeds extra handlingStemming or fuzzy match required

What does lexical search mean for SEO?

Search engines use much more than word matching today, but wording still matters. If your page never uses the term a buyer types, a word-based component has nothing to match. Name your service, product category and audience in the words they use, in titles, headings and body text.

That is not a license to repeat a phrase. Use the term where it is natural, and explain related ideas so meaning-based systems can connect them too.

How do you check your lexical coverage?

Compare the words your audience uses with the words on your pages. Sales calls, site search logs and Search Console queries are good sources.

  1. List real phrasesCollect terms from queries, emails and calls.
  2. Search your own siteSee which phrases return the right page and which return nothing.
  3. Add missing terms naturallyWork them into headings, summaries and body text where they fit.
  4. Check for conflictsMake sure several pages do not compete for the same phrase.

What are common lexical search mistakes?

One mistake is using only internal jargon. Buyers rarely use your product naming. Another is assuming that a page that contains a phrase will be found for it. Matching is only the first step, and ranking depends on much more.

Need help with Lexical search on your site?

Tell us what is not working. We will check where this affects your search results and what to fix first.

Book a meetingAEO services

Questions people ask

Is lexical search outdated?

No. It remains fast, precise and easy to debug, and many systems still use it. It is often paired with vector search to cover paraphrase and meaning.

What is BM25?

BM25 is a widely used scoring method in lexical search. It rates how well a document matches the query terms, taking into account how often terms appear and how rare they are across the collection.

Should I still use exact keywords in my content?

Yes, where they are natural. Exact terms help word-based matching and make the page clear to readers. Pair them with plain explanations so meaning-based systems can also connect your page to related questions.

Inspect the original evidence