textrawl
byJeff Green
Concepts

Semantic Search

How textrawl finds relevant documents

textrawl uses vector similarity to find documents related to your query, not just keyword matching.

Keyword SearchSemantic Search
Exact matchesMeaning matches
"auth config" → "auth config""auth config" → "setting up authentication"
Fast, preciseUnderstands synonyms
Misses paraphrasesMay miss exact terms

Hybrid Approach

textrawl combines both:

  1. Full-text search: PostgreSQL tsvector for keywords
  2. Semantic search: pgvector cosine similarity for meaning
  3. RRF fusion: Reciprocal Rank Fusion combines results

How It Works

Query: "How do I set up user login?"

    ┌────┴────┐
    │         │
    ▼         ▼
 Keywords   Embedding
    │         │
    ▼         ▼
 FTS Match  Cosine Similarity
    │         │
    └────┬────┘


    RRF Fusion


   Ranked Results

Query Examples

QueryBest MatchWhy
"PRJ-12345"Exact documentKeyword match
"authentication setup"Auth docsSemantic + keyword
"how do I log in"Auth docsSemantic understanding

Tuning Weights

Control the balance:

{
  "fullTextWeight": 1.5,
  "semanticWeight": 0.5
}

Higher fullTextWeight favors keyword matches.

Or:

{
  "fullTextWeight": 0.5,
  "semanticWeight": 1.5
}

Higher semanticWeight favors semantic understanding.

Default is 1.0 for both (balanced).

On this page