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.
Signature
Description
Performs a comprehensive search across the Quran that combines simple text search with linguistic (lemma/root) analysis and fuzzy fallback. Results are scored, deduplicated, and sorted by relevance. This is your primary API for Quran search results with scoring and pagination.Parameters
The search query in Arabic text. Non-Arabic characters are automatically stripped during processing.
Array of Quran verses to search. Each verse must satisfy the
VerseInput type with gid, uthmani, and standard fields.Map of verse morphology data indexed by
gid. Each entry contains lemmas and roots arrays for linguistic matching.Dictionary mapping normalized query tokens to their canonical lemma and root forms.
Search options controlling linguistic matching:
lemma(boolean): Enable lemma-based matchingroot(boolean): Enable root-based matchingfuzzy(boolean, optional): Enable fuzzy fallback matching (default: true)
fuzzy: false to disable fuzzy fallback when no exact/lemma/root matches are found.Pagination controls:
page(number, optional): Page number to retrieve (default: 1)limit(number, optional): Results per page (default: 20)
Returns
Array of matching verses with scoring metadata. Each result includes:
- All original verse fields
matchScore(number): Weighted relevance scorematchType(MatchType): Best match type (‘exact’ | ‘lemma’ | ‘root’ | ‘fuzzy’ | ‘none’)matchedTokens(string[]): Deduplicated matched tokens for highlightingtokenTypes(Record<string, MatchType>): Match type for each token
Match type breakdown:
simple(number): Verses with exact text matcheslemma(number): Verses with lemma matchesroot(number): Verses with root matchesfuzzy(number): Verses with only fuzzy matchestotal(number): Total matching verses
Pagination metadata:
totalResults(number): Total matching verses across all pagestotalPages(number): Total number of pagescurrentPage(number): Current page numberlimit(number): Results per page
Scoring system
Match types are weighted differently:| Match type | Score per hit |
|---|---|
| Exact | +3 |
| Lemma | +2 |
| Root | +1 |
| Fuzzy | +0.5 |
Multi-word queries
The search uses AND logic:- Query is split by whitespace into tokens
- Results must match every token (via exact, lemma/root, or fuzzy fallback)
- Scores accumulate across all matched tokens
Examples
Basic search
With pagination
Disable fuzzy matching
Custom dataset
Notes
- The query is automatically normalized (Arabic normalization, tashkeel removal)
- Non-Arabic characters are stripped from the query
- Empty queries return an empty result set
- Results are sorted by
matchScorein descending order - Use
matchedTokenswithgetHighlightRanges()for UI highlighting