Concepts
Semantic Search
How textrawl finds relevant documents
textrawl uses vector similarity to find documents related to your query, not just keyword matching.
Keyword vs Semantic Search
| Keyword Search | Semantic Search |
|---|---|
| Exact matches | Meaning matches |
| "auth config" → "auth config" | "auth config" → "setting up authentication" |
| Fast, precise | Understands synonyms |
| Misses paraphrases | May miss exact terms |
Hybrid Approach
textrawl combines both:
- Full-text search: PostgreSQL tsvector for keywords
- Semantic search: pgvector cosine similarity for meaning
- RRF fusion: Reciprocal Rank Fusion combines results
How It Works
Query Examples
| Query | Best Match | Why |
|---|---|---|
| "PRJ-12345" | Exact document | Keyword match |
| "authentication setup" | Auth docs | Semantic + keyword |
| "how do I log in" | Auth docs | Semantic understanding |
Tuning Weights
Control the balance:
Higher fullTextWeight favors keyword matches.
Or:
Higher semanticWeight favors semantic understanding.
Default is 1.0 for both (balanced).