1
Install the package
Complete the installation to add quran-search-engine to your project.
2
Load the data
Load the Quran dataset, morphology map, and word map at app startup:
Examples assume an async context (Node 18+, ESM, or browser).
3
Perform a search
Use the
search function with your query and loaded data:Search options
Thesearch function accepts the following options to control matching behavior:
Match scoring
Each match type has a different score weight:Pagination
Control the number of results returned using pagination options:Search response structure
TheSearchResponse object contains:
results: Array ofScoredQuranTextobjects with match metadatacounts: Breakdown of matches by type (exact, lemma, root, fuzzy)pagination: Current page info and total results
Next steps
Search API
Explore all search options and advanced features
Highlighting
Learn how to highlight matched text in your UI