# Keyword Search

> Search that finds pages with the exact words you typed.

**Field:** Artificial Intelligence  
**Category:** Retrieval & Search  
**Also known as:** Lexical Search, Full-Text Search

## Think of it like

Think of it like the index at the back of a book. You look up a word and get its pages.

## Definition

Keyword search finds documents that contain the words in the query. It keeps a table, called an inverted index, that maps each word to the documents that hold it. A query looks up its words and ranks the matches, often with a formula such as BM25. It is fast, cheap and very good at exact names, codes and rare terms. It misses texts that say the same thing in other words.

## Example

Lucy searches the parts list for 'XJ-200'. Keyword search finds the one page that names that part straight away.

## Why it matters

It is still the best tool for exact matches, and it is a key half of most modern AI search.

## Common mistake

Writing it off as old. In many tests, keyword search alone beats semantic search on names and codes.

## Three principles

- **Exact words.** What you type is what it finds.
- **Inverted index.** Word to documents.
- **Great at codes.** Misses other wording.

## Related terms

- [Okapi BM25](https://learn.benibix.com/term/ai/okapi-bm25)
- [Semantic Search](https://learn.benibix.com/term/ai/semantic-search)
- [Hybrid Search](https://learn.benibix.com/term/ai/hybrid-search)
- [Term Frequency-Inverse Document Frequency (TF-IDF)](https://learn.benibix.com/term/ai/tf-idf)
- [Inverted Index](https://learn.benibix.com/term/ai/inverted-index)
- [Sparse Vector](https://learn.benibix.com/term/ai/sparse-vector)

## Told apart from

- [Semantic Search vs Keyword Search](https://learn.benibix.com/compare/semantic-search-vs-keyword-search): People often think semantic search is just a smarter keyword search that wins every time. Keyword search matches the exact words, so it is best at names, codes and rare terms. Semantic search matches meaning, so it finds the same idea in other words. Each misses what the other finds. That is why most good systems run both.

![A table that maps each word to the documents that hold it. The words of the question are looked up, and the documents on both lists come back.](https://learn.benibix.com/diagrams/rt-keyword-search.svg)

---

Source: https://learn.benibix.com/term/ai/keyword-search
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
