How I Successfully Implemented quran-search-engine in open-mushaf-native
Clean, paginated Quran search with rich highlighting in a React Native Mushaf
Search for a command to run...
Clean, paginated Quran search with rich highlighting in a React Native Mushaf
No comments yet. Be the first to comment.
How we solved the aspect ratio constraint problem and created a more flexible rendering system for Quran pages. Live Demo: http://mubin.adelpro.us.kg The Problem with Fixed Ratios When Open Quran
The Quran is text. But the Quran is also recitation, interpretation, and lived practice. A static page displaying Arabic text misses all of that. I wanted to build something that kept the Arabic text
Discover the latest features in quran-search-engine v0.3.x-(athar). Learn about the performance boosts, new search layers, the new inverted index, and how to seamlessly migrate from v0.1.5.

Lubb AI Writer is designed to be provider-agnostic. That means you’re not locked into paid APIs. With OpenRouter, you can run it completely free using community models. Here’s the exact setup. 1) Clon
Open-source project: browser extension + REST API for AI text enhancement. Supports OpenAI, Claude, Gemini, Ollama, and more.


When I started building advanced search for open-mushaf-native, I wanted three things:
The quran-search-engine package is what made that possible. Instead of reinventing search from scratch, I delegated the heavy logic to a dedicated library and focused my app code on UI and UX.
This article explains how I integrated quran-search-engine into my app, what new features it unlocked (like pagination), and how it helped me shorten the codebase, reduce files, and still add more features and highlights.
quran-search-engineBefore using the package, implementing Quran search meant handling all of this myself:
That approach quickly becomes complex and hard to maintain.
quran-search-engine solved that by providing:
search function that takes the Quran text, morphology data, and a word mapSo instead of spreading search logic across multiple files, I only need to:
search(...) with the right parametersYes – the integration was straightforward because the package has a clean, focused API.
At a high level, my implementation was:
import { search, type QuranText, type MorphologyAya, type WordMap } from 'quran-search-engine';search call in a custom React hook (useQuranSearch) that:searchresults, counts, and helper methods for highlightingFlatList and infinite scroll.Because the package does the heavy lifting, the React Native side stays relatively small:
The hard parts (morphology, token-level matching, fuzzy search) all live inside quran-search-engine, not scattered across the app.
One of the biggest wins from the package is native support for pagination.
The search function accepts page and limit options. Instead of loading all matches at once, I can ask only for:
In the app, I use:
page: React state that tracks the current pagePAGE_SIZE: a constant, for example 50FlatList.onEndReached: to detect when the user scrolls near the end and then increment pageEvery time page changes, my useQuranSearch hook calls:
search(
normalizedQuery,
quranData,
morphologyMap,
wordMap,
{
lemma: advancedOptions.lemma,
root: advancedOptions.root,
fuzzy: advancedOptions.fuzzy,
},
{
page,
limit: PAGE_SIZE,
},
);
This gave me infinite scroll through FlatList:
From a user perspective, it feels like a smooth endless list of search results. From a developer perspective, it’s just a page number and a FlatList.
Before leaning on quran-search-engine, a search feature tends to produce:
With the package, I was able to centralize and simplify:
useQuranSearch).That means:
quran-search-engine handles how to search the QuranThe result is a much cleaner architecture:
The package doesn’t just return verses; it returns rich metadata.
For each verse, it includes:
exact, lemma, root, fuzzy)I use that data to build:
Because the engine already tells me which tokens matched and how, adding more features is straightforward:
In other words, quran-search-engine lets me focus on UX, not parsing and matching.
If you look at the actual integration, the core parts are surprisingly small:
search(...) with options and paginationpageResults and counts in React stategetPositiveTokens helper to classify matched tokenspage, results, hasMore, and isLoadingMoreFlatList with onEndReachedHighlightText component with colorsCompared to building a full search engine from scratch, the amount of app code is very reasonable. Most of my time went into UI design and UX details, not low‑level search algorithms.
Using quran-search-engine in open-mushaf-native gave me:
Instead of being “the search engine project”, my app stays what it should be: a beautiful, focused Quran reading experience, powered under the hood by a dedicated search package.
If you are building your own Quran app, my advice is simple: let quran-search-engine do the heavy lifting and spend your energy on the user experience.