Skip to content
Search docs
Search docs…

Choosing a scope

search_library names one of twelve shelves. What each contains, what they leave out, and why scoping matters even where it is optional.

On this page

search_library requires a scope. The raw shamela_* searches do not — but the reason the curated one insists is worth understanding before you decide to skip it.

Why a scope is required

Full-text search over this library ranks results by term statistics — roughly, how unusual your words are and how often they appear on a page. That is a reasonable default for a search engine and a bad one for a library of religious texts, because term frequency knows nothing about scholarly authority.

Two real examples, both from searching the whole library:

  • التيمم (dry ablution) returns 26,098 hits, topped by a poetry anthology from 710 AH. Every fiqh manual that actually rules on the subject sits below it.
  • إنما الأعمال بالنيات returns 6,815 hits in which Sahih al-Bukhari never appears at all — buried under minor collections that merely repeat the hadith more often per page.

An assistant handed those results would cite them confidently.

search_library therefore will not run without a scope. shamela_search_pages will, and there are real uses for it — but if you are asking “where is this text printed,” scope the search.

The twelve scopes

ScopeContainsBooks
hadith-primaryThe eight primary collections, each pinned to a specific printing8
tafsir-canonicalIbn Kathir, al-Tabari, Ibn al-Jawzi and three more, read in that order6
fiqh-hanafiHanafi fiqh, plus usul and general fiqh1,034
fiqh-malikiMaliki fiqh, plus usul and general fiqh1,036
fiqh-shafiiShafi’i fiqh, plus usul and general fiqh1,037
fiqh-hanbaliHanbali fiqh, plus usul and general fiqh1,100
fiqh-comparativeAll four schools, plus inheritance, governance and fatwa collections1,559
aqeedahCreed and sects958
hadith-sciencesHadith commentary, takhrij, and the sciences of hadith1,957
tafsirThe whole tafsir shelf and Quranic sciences586
seerahProphetic biography, history, and biographical dictionaries972
lughaArabic language, lexicons, grammar and adab1,052

The two small scopes are small on purpose

hadith-primary (8 books) and tafsir-canonical (6 books) are curated lists, not categories.

hadith-primary pins each collection to a named printing: al-Bukhari is the Sultaniyya, Muslim is the ʿAbd al-Baqi numbering, and so on. This does two jobs at once. It keeps the search focused — the full sunnah category is 1,243 books, and searching all of them surfaces minor works that merely repeat a hadith. And it makes the page number mean something: printings paginate differently, so a volume and page without a named edition is not a citation a reader can check.

tafsir-canonical exists because the underlying verse index reads books in catalogue order, which is an accident of numbering rather than a judgement. For one verse that meant a grammar-parsing work and an esoteric commentary were surfaced while Ibn Kathir and al-Tabari — both indexed for that same verse — went unread. The curated list fixes the order.

Use the broad tafsir scope (586 books) when you want breadth; use tafsir-canonical when you want the works most readers would expect to be consulted first.

Picking one

If you are asking about…Start with
Whether a hadith exists, and where it is printedhadith-primary
What a well-known commentator said about a versetafsir-canonical
A ruling within one schoolfiqh-hanafi, fiqh-maliki, fiqh-shafii, fiqh-hanbali
How the schools differ on a questionfiqh-comparative
A grading, a chain, or how a hadith was receivedhadith-sciences
A point of creedaqeedah
An event, a life, or a narrator’s biographyseerah
What an Arabic word means or how it is parsedlugha

Scope narrows which books are searched, never how the words are matched. A scope with 8 books and one with 1,957 run the same search — you get fewer, better-placed results from the small one.

What the scopes do not cover

The twelve scopes span 26 of the catalogue’s 41 categories — 7,084 of 8,594 books. The remaining 1,510 have no scope of their own and are reachable only through the raw shamela_* tools:

Not in any scopeBooks
الأدب — literature and belles-lettres406
كتب عامة — general works357
التجويد والقراءات — tajwīd and qirāʾāt152
الجوامع — comprehensive collections137
فهارس الكتب والأدلة — indexes and guides102
البلدان والرحلات — geography and travel97
العلل والسؤلات الحديثية — hadith defects and questions78
الأنساب — genealogy52
البلاغة — rhetoric44
Six smaller categories (poetry, medicine, logic, prosody, other)85

If your question lands on one of those shelves — a qirāʾāt ruling, a narrator’s genealogy, a point of ʿilal — search_library will come back empty even though the books are there. Use shamela_search_pages with an explicit category_ids scope instead, which you can look up with shamela_list_categories.

If a scope returns nothing, that is information rather than a dead end. Try the broader neighbour — tafsir-canonical → tafsir, or one school → fiqh-comparative — and note that the narrower shelf was silent.

Edit this page on GitHub