Skip to main content
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

The search 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:
The response includes pagination metadata:

Search response structure

The SearchResponse object contains:
  • results: Array of ScoredQuranText objects with match metadata
  • counts: Breakdown of matches by type (exact, lemma, root, fuzzy)
  • pagination: Current page info and total results
Each result includes:

Next steps

Search API

Explore all search options and advanced features

Highlighting

Learn how to highlight matched text in your UI