Documentation Index
Fetch the complete documentation index at: https://mintlify.com/adelpro/quran-search-engine/llms.txt
Use this file to discover all available pages before exploring further.
Overview
All types are exported fromquran-search-engine and provide full TypeScript support for search operations, highlighting, and data structures.
Core types
QuranText
Represents a single verse in the Quran dataset. This is the input type for search operations.Unique global verse identifier (1-6236)
Chapter number (1-114)
Verse number within the chapter
Formatted verse identifier for display (e.g., “1:1”)
Verse text in Uthmani script with diacritics (commonly used for display and highlighting)
Verse text in standard Arabic script (used for exact text matching)
Full verse text including Bismillah where applicable
Page number in the Mushaf
Juz (part) number (1-30)
Chapter name in Arabic
Chapter name in English
Romanized chapter name
ScoredQuranText
ExtendsQuranText with search scoring and highlighting metadata. This is the type returned in search results.
Total score for this verse based on match quality:
- Exact matches: +3 per token
- Lemma matches: +2 per token
- Root matches: +1 per token
- Fuzzy matches: +0.5 per token
The best overall match type for this verse:
'exact', 'lemma', 'root', 'fuzzy', or 'none'Deduplicated array of query tokens that matched in this verse (used for highlighting)
Optional mapping of each matched token to its match type (used for match-type-specific highlighting)
SearchResponse
The complete response object returned by thesearch() function.
Array of matching verses, sorted by match score (highest first)
SearchOptions
Configuration options for search behavior.Enable lemma-based matching (requires morphology data and word map)
Enable root-based matching (requires morphology data and word map)
Enable fuzzy fallback matching. Defaults to
true. Set to false to disable fuzzy search entirely.SearchCounts
Match statistics returned by the search function, providing breakdown of results by match type.Number of verses with exact text matches
Number of verses with lemma-based matches
Number of verses with root-based matches
Number of verses with only fuzzy matches
Total number of matching verses across all types
Morphology types
MorphologyAya
Morphological data for a single verse, containing lemmas and roots for linguistic matching.Global verse identifier matching
QuranText.gidArray of normalized lemma forms for all words in the verse
Array of Arabic roots for all words in the verse
WordMap
Dictionary mapping normalized query tokens to their canonical lemma and root forms.Match types
MatchType
Enumeration of possible match types for search results.Direct text match in the verse (highest priority, score: +3)
Lemma-based match using morphological analysis (score: +2)
Root-based match using Arabic roots (score: +1)
Fuzzy match fallback when no exact/lemma/root match found (score: +0.5)
No match (used internally)
HighlightRange
Represents a character range to highlight in the text, returned bygetHighlightRanges().
Starting character index (0-based, inclusive)
Ending character index (0-based, exclusive)
The original query token that matched this range
The type of match for this range
Pagination types
PaginationOptions
Options for paginating search results.Page number to retrieve (1-based). Defaults to
1.Number of results per page. Defaults to
10.Custom dataset types
VerseInput
Minimal interface required for custom verse datasets.Unique verse identifier (used to join with morphology data)
Verse text with diacritics (used for fuzzy fallback and highlighting)
Verse text in standard form (used for exact text matching)