Keyword Search vs Semantic Search
This is an important concept because it explains why embeddings are useful.
Keyword Search looks for matching words. Semantic Search looks for matching meaning.
Keyword Search
Keyword search tries to find documents containing the same words as the user's search.
For example, the user searches:
A keyword search looks for words like:
- learn
- Python
If a document says:
That's a strong keyword match.
Semantic Search
Semantic search focuses on meaning rather than exact words.
The wording is different, but the meaning is similar.
Side-by-Side Example
Let's say your database contains:
Document A:
"How to reset your password"
Document B:
"How to update your email address"
Document C:
"Recover access to your account after forgetting credentials"
User searches:
Keyword Search
It looks for:
- forgot
- password
- account
It may rank Document A highly because of "password".
Semantic Search
It looks at the meaning:
Document C may be highly relevant even though it doesn't use the exact phrase "forgot my password".
Keyword Search looks for matching words. Semantic Search looks for matching meaning.