# What is semantic search and how does it differ from keyword search?

> Semantic search matches the meaning of a query, often with vector embeddings. Keyword search matches its words. Hybrid search runs both and merges the results.

Canonical: https://promptlyfound.com/ai-search/semantic-search
Updated: 2026-11-20

## Short answer

Semantic search is search that **matches the meaning of a query with the meaning of each document**. Most systems turn the query and each document into vector embeddings and return the documents whose vectors are closest. Keyword search matches the exact terms. Google, Bing and many retrieval systems for AI answers use both, because exact terms such as product codes still need a keyword match.

## Key findings

- Google says its synonym system finds relevant documents that do not contain the exact words of a query, and that keyword matches are still the most basic relevance signal. [1]
- Google introduced neural matching in 2018 to match representations of concepts in queries and pages, and says it is a critical part of how Google retrieves documents. [8]
- In 2019, Microsoft said Bing had turned more than 150 billion pieces of indexed data into vectors and used vector search to find results by concept. [11]
- In Anthropic's tests, combining contextual embeddings with contextual BM25 keyword retrieval cut the top-20 retrieval failure rate by 49%, from 5.7% to 2.9%. Contextual embeddings alone cut it by 35%. [6]
- Google says sites do not need to write long-tail keyword variations for its generative AI features, because AI systems understand synonyms and general meaning. [13]

Google tells site owners that a page does not need every long-tail keyword variation, because its AI systems understand synonyms and general meaning. Exact product codes, model numbers and names still belong on the page, because keyword matching finds them.

Semantic search is search that matches the meaning of a query with the meaning of a document. Keyword search, also called lexical search, matches the words. Google gives an example in [its page on how it ranks results](https://www.google.com/search/howsearchworks/how-search-works/ranking-results/): a search for "change laptop brightness" should find a manufacturer's page that says "adjust laptop brightness". Google's synonym system finds such documents even when they do not contain the exact words of the query.[1]

## Keyword search

Exact words on a page still count in web search. A keyword search engine keeps an inverted index, which lists the documents that contain each word. At query time, it looks up the words of the query and ranks the documents that contain them.

BM25 is a common ranking function for keyword search. [Anthropic's post on Contextual Retrieval](https://www.anthropic.com/news/contextual-retrieval) describes it as an extension of TF-IDF, which measures how important a word is to a document in a collection. BM25 also accounts for document length and limits the weight of a word that repeats many times.[6]

Google calls keyword matching the most basic signal of relevance: content that contains the same keywords as the search query, for example in headings or body text.[1]

## Semantic search with embeddings

Semantic search lets a page match questions phrased in words the page never uses. Most semantic search systems use vector embeddings. An embedding model turns a piece of text into a list of numbers called a vector. Texts with similar meanings get vectors that sit close together. [OpenAI's embeddings guide](https://developers.openai.com/api/docs/guides/embeddings) lists search, clustering, recommendations and classification as uses. Its text-embedding-3-small model returns a vector of 1,536 numbers by default.[3]

A semantic search runs in two stages:

1. Before any query arrives, the system embeds each document or passage and stores the vectors.
2. At query time, it embeds the query with the same model and returns the stored vectors closest to it.

Closeness is usually measured by cosine similarity, the angle between two vectors. OpenAI recommends cosine similarity for its embeddings.[3] [What are vector embeddings?](https://promptlyfound.com/llms/embeddings) covers dimensions, similarity measures and vector databases in more detail.

Bing used this method for web search, as it described in [a 2018 post on deep learning for query semantics](https://blogs.bing.com/search-quality-insights/May-2018/Towards-More-Intelligent-Search-Deep-Learning-for-Query-Semantics). Each query becomes a query vector and each web page a document vector. A model scores the match between the query and a page's title, URL and text with a distance metric such as cosine similarity.[2]

## Semantic search vs keyword search

The two methods fail in different ways. Keyword search misses a relevant page that uses other words. Semantic search can miss an exact string. Anthropic gives the example of a support query for "Error code TS-999": an embedding model can return pages about error codes in general and miss the page about TS-999, which BM25 finds by its exact text.[6]

The [BEIR benchmark](https://arxiv.org/abs/2104.08663) tested 10 retrieval systems on 18 datasets. BM25 held up well as a baseline across those datasets. Dense retrieval models, which search by embeddings, were more efficient to run than re-ranking models. But they often did worse on data they were not trained for.[7]

  <thead><tr><th scope="col">&#8203;</th><th scope="col">Keyword (lexical) search</th><th scope="col">Semantic (vector) search</th></tr></thead>
  <tbody>
    <tr><th scope="row">What it matches</th><td>The words of the query</td><td>The meaning of the query</td></tr>
    <tr><th scope="row">Index</th><td>Inverted index of words</td><td>Vector index of embeddings</td></tr>
    <tr><th scope="row">Common scoring</th><td>BM25</td><td>Cosine similarity between vectors</td></tr>
    <tr><th scope="row">Finds pages that use other words</th><td>Only through synonym expansion</td><td>Yes</td></tr>
    <tr><th scope="row">Exact codes, names and dates</th><td>Precise</td><td>Can miss them</td></tr>
  </tbody>

## Hybrid search

Hybrid search favors a page that explains a topic in plain words and also states its exact terms. It runs a keyword query and a vector query at the same time and merges the results. [Microsoft's documentation of hybrid search in Azure AI Search](https://learn.microsoft.com/en-us/azure/search/hybrid-search-overview) describes one request that runs full-text search and vector search in parallel. The full-text side ranks with BM25. Microsoft says queries over product codes, specialized jargon, dates and people's names perform better with keyword search, because it identifies exact matches.[4]

The two result lists score on different scales, so the system merges them by rank. Azure AI Search uses Reciprocal Rank Fusion (RRF). [Microsoft's page on RRF scoring](https://learn.microsoft.com/en-us/azure/search/hybrid-search-ranking) gives each document a score of 1/(rank + k) in each list, with k set to a small constant such as 60. The scores from each list are added, so a document near the top of both lists ranks highest.[5]

Anthropic describes the same pattern for retrieval-augmented generation. Documents are split into chunks of a few hundred tokens. The top chunks are retrieved with BM25 and with embeddings, and rank fusion combines the two lists. In Anthropic's tests, contextual embeddings alone cut the top-20 retrieval failure rate by 35%, from 5.7% to 3.7%. Combining them with contextual BM25 cut it by 49%, to 2.9%.[6]

## Semantic search in Google Search

Google has matched meaning in Search since at least 2015, so advice to write for synonyms predates Google's AI features. Google documents several systems that match meaning. [Google's post on how AI powers its search results](https://blog.google/products/search/how-ai-powers-great-search-results/), published February 3, 2022, describes three of them:[8]

- RankBrain launched in 2015 as Google's first deep learning system in Search. It relates the words of a query to concepts and helps rank results.
- Neural matching arrived in 2018. It looks at an entire query or page and matches representations of the concepts in each. Google calls it a critical part of how it retrieves relevant documents.
- BERT launched in 2019. It reads how combinations of words express meaning. Google said in 2022 that BERT plays a critical role in almost every English query, in both ranking and retrieval.

[Google's guide to its ranking systems](https://developers.google.com/search/docs/appearance/ranking-systems-guide), last updated December 10, 2025, still lists RankBrain, neural matching and BERT. It also lists passage ranking, a system that identifies individual sections of a page to judge how relevant the page is to a search.[9] Google announced passage ranking on October 15, 2020, in [its Search On post](https://blog.google/products/search/search-on/), and said it would improve 7% of search queries across all languages.[10]

Google does not say whether these systems compare stored vectors, as a vector database does. Its descriptions speak of concepts and representations.

## Semantic search in Bing

Meaning-based retrieval in Bing matters for AI answers, because Microsoft Copilot sends its web queries to Bing. Microsoft has said more about vectors in Bing than Google has about its own systems. In May 2019, it open-sourced SPTAG, the vector search algorithm used in Bing. [Microsoft's announcement of SPTAG](https://news.microsoft.com/source/features/ai/bing-vector-search) said Bing had turned more than 150 billion pieces of indexed data into vectors, including words, page snippets and full queries. Microsoft gave the example of the query "How tall is the tower in Paris?", which Bing can answer with the height of the Eiffel Tower although the query does not contain "Eiffel".[11]

In November 2019, [Microsoft's post on Bing's largest improvement in search experience](https://azure.microsoft.com/en-us/blog/bing-delivers-its-largest-improvement-in-search-experience-using-azure-gpus/) said Bing had used large Transformer models since April 2019 and applied them to every Bing query worldwide.[12] [How retrieval-augmented generation works](https://promptlyfound.com/ai-search/rag) describes how Copilot uses those results.

## Semantic search in AI answers

In Google's AI answers, both keyword relevance and meaning feed retrieval, because Google retrieves with its core ranking systems. AI search products retrieve documents before they write an answer, a method called [retrieval-augmented generation](https://promptlyfound.com/ai-search/rag). Semantic search is one way to run that retrieval step. The paper [Dense Passage Retrieval for Open-Domain Question Answering](https://arxiv.org/abs/2004.04906) showed in 2020 that a retriever using only embeddings outperformed a Lucene BM25 system by 9 to 19 percentage points in top-20 passage retrieval accuracy.[14]

Google says its generative AI features retrieve pages with its core Search ranking systems, from its Search index. [Google's guide to generative AI features in Search](https://developers.google.com/search/docs/fundamentals/ai-optimization-guide), revised July 10, 2026, calls this retrieval-augmented generation, or grounding.[13] Google's own descriptions of those ranking systems cover both keyword relevance and the meaning-based systems above.[1][9] The same guide describes [query fan-out](https://promptlyfound.com/ai-search/query-fan-out), in which the model runs several related searches for one question.

## Writing pages for semantic search

Google's guide makes two statements about how to write for its generative AI features:[13]

- A page does not need every long-tail keyword variation. The guide says AI systems understand synonyms and general meaning and can connect a search with content that does not use the same words.
- A page does not need to be split into small chunks. The guide says Google's systems understand several topics on one page and show the relevant part.

Two more points follow from the documentation above. First, write exact strings such as product codes, model numbers and names in the page text. Systems that combine keyword and vector search match those strings through the keyword side, so the page can be found by them.[4] Second, give each section one specific question to answer. Google's passage ranking judges individual sections of a page, so one strong section can make the whole page relevant to that question.[9] No search engine has published a test of either point.

A page must be crawlable and indexed before any of these systems can retrieve it. [How Google AI Overviews and AI Mode select sources](https://promptlyfound.com/platforms/how-ai-overviews-work) covers the requirements for Google's AI features. To see whether your robots.txt blocks AI search crawlers, run it through the [AI crawler checker](https://promptlyfound.com/tools/ai-crawler-checker).

## Sources

1. How Google determines ranking results. Google Search. https://www.google.com/search/howsearchworks/how-search-works/ranking-results/
2. Towards more intelligent search: deep learning for query semantics. Microsoft Bing Blog, 2018-05-01. https://blogs.bing.com/search-quality-insights/May-2018/Towards-More-Intelligent-Search-Deep-Learning-for-Query-Semantics
3. Vector embeddings. OpenAI API documentation. https://developers.openai.com/api/docs/guides/embeddings
4. Hybrid search using vectors and full-text search in Azure AI Search. Microsoft Learn, 2026-08-31. https://learn.microsoft.com/en-us/azure/search/hybrid-search-overview
5. Hybrid search scoring (RRF). Microsoft Learn. https://learn.microsoft.com/en-us/azure/search/hybrid-search-ranking
6. Introducing Contextual Retrieval. Anthropic, 2024-09-19. https://www.anthropic.com/news/contextual-retrieval
7. BEIR: A heterogenous benchmark for zero-shot evaluation of information retrieval models. arXiv (Thakur et al.), 2021-04-17. https://arxiv.org/abs/2104.08663
8. How AI powers great search results. Google, 2022-02-03. https://blog.google/products/search/how-ai-powers-great-search-results/
9. A guide to Google Search ranking systems. Google Search Central, 2025-12-10. https://developers.google.com/search/docs/appearance/ranking-systems-guide
10. How AI is powering a more helpful Google. Google, 2020-10-15. https://blog.google/products/search/search-on/
11. As search needs evolve, Microsoft makes AI tools for better search available to researchers and developers. Microsoft Source, 2019-05-15. https://news.microsoft.com/source/features/ai/bing-vector-search
12. Bing delivers its largest improvement in search experience using Azure GPUs. Microsoft Azure Blog, 2019-11-18. https://azure.microsoft.com/en-us/blog/bing-delivers-its-largest-improvement-in-search-experience-using-azure-gpus/
13. Optimizing your website for generative AI features on Google Search. Google Search Central, 2026-07-10. https://developers.google.com/search/docs/fundamentals/ai-optimization-guide
14. Dense passage retrieval for open-domain question answering. arXiv (Karpukhin et al.), 2020-04-10. https://arxiv.org/abs/2004.04906

---

This is a plain-text copy of https://promptlyfound.com/ai-search/semantic-search from Promptly Found. The web page is the canonical version and includes the charts.
