Skip to main content
Keyword search finds content by matching exact words and phrases. It uses your database’s full-text search capabilities to find documents containing specific terms.

How It Works

  1. Text parsing: Your query is broken into searchable terms
  2. Index lookup: The system finds documents containing those terms
  3. Ranking: Results are ordered by relevance (term frequency, document length, etc.)
When using PgVector, this leverages PostgreSQL’s built-in full-text search. Other databases use their native text search capabilities. Use vector search if users phrase things differently than your docs. Use hybrid search if you want both exact matching and semantic understanding.

Configuration

Basic Setup

With Reranking

Add a reranker to improve result ordering:

Example

keyword_search.py

Next Steps

Hybrid Search

Combine keyword search with vector similarity

Vector Search

Search by semantic meaning