Skip to main content

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

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:

InputParsed As
John 3:16Gospel of John, chapter 3, verse 16
1 Ne. 3:71 Nephi, chapter 3, verse 7
D&C 89:1-4Doctrine and Covenants, section 89, verses 1-4
Moses 1Book of Moses, chapter 1 (full chapter)
Gen 1:1-2:3Genesis, 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:

  1. Search bar in the application header -- Standard search input with type-ahead suggestions
  2. 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:

PrefixSearches
(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:

PlanSearch Requests
Reader (free)20/min
Scholar200/min
Academic1000/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 metadata
  • topics -- Topical Guide and Bible Dictionary entries
  • lexicon -- 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.