Search
GospeLib provides two complementary search capabilities: full-text search powered by Typesense and smart reference parsing that recognizes scripture citations and navigates directly to passages.
Overview
Full-Text Search
Typesense indexes all scripture passages, topics, and lexicon entries for sub-50ms search responses. Users can search across the entire canon or filter by:
- Book -- Limit to a specific book (e.g., only Book of Mormon)
- Testament -- Old Testament, New Testament, or Restoration scripture
- Corpus -- Biblical, Book of Mormon, Doctrine and Covenants, Pearl of Great Price, Pseudepigrapha
Results are ranked by relevance with highlighted matching text. Pagination supports browsing through large result sets.
Reference Lookup
The reference parser recognizes standard scripture citation formats and navigates directly to the passage without requiring a full-text search:
| Input | Parsed As |
|---|---|
John 3:16 | Gospel of John, chapter 3, verse 16 |
1 Ne. 3:7 | 1 Nephi, chapter 3, verse 7 |
D&C 89:1-4 | Doctrine and Covenants, section 89, verses 1-4 |
Moses 1 | Book of Moses, chapter 1 (full chapter) |
Gen 1:1-2:3 | Genesis, chapter 1 verse 1 through chapter 2 verse 3 |
Reference parsing happens client-side via the @gospelib/scripture-ref package, providing instant navigation without a network round-trip.
Search UI
The search interface is accessible from:
- Search bar in the application header -- Standard search input with type-ahead suggestions
- Command palette (
Cmd+K) -- Three-tier ranked results:- Tier 1 (<80ms): Fuzzy search over local passage index
- Tier 2 (50-200ms): FalkorDB context-aware suggestions based on current reading position
- Tier 3 (200-1000ms): AI-powered suggestions for complex queries
The command palette supports prefix modes for targeted search:
| Prefix | Searches |
|---|---|
| (none) | Everything |
> | Commands and actions |
@ | Symbols (people, places) |
# | Topics |
? | AI-powered questions |
/ | Plugin commands |
Rate Limits
Search is available on all tiers with different rate limits:
| Plan | Search Requests |
|---|---|
| Reader (free) | 20/min |
| Scholar | 200/min |
| Academic | 1000/min |
Deep Dive: Typesense Integration
The ingest pipeline includes a Typesense sync stage that indexes passages into three Typesense collections:
passages-- Scripture text with book, chapter, verse, corpus, and translation metadatatopics-- Topical Guide and Bible Dictionary entrieslexicon-- Strong's Hebrew and Greek dictionary entries
The content service exposes search through GET /search with query, filters, and pagination parameters. Typesense handles tokenization, stemming, and typo tolerance automatically.
Related Pages
- Scripture Reader -- Search results navigate to the reader
- Services > Content -- Content API search endpoint
- Architecture > Data > Typesense -- Search index configuration
- Subscriptions -- Search rate limits by plan tier