মূল বিষয়বস্তুতে যান

Why scope matters: one search on one shelf and on all

One Arabic query run in three scopes and across the whole library, with real results, plus the twelve scopes and an example question for each.

এই পাতাটি এখনও অনূদিত হয়নি — ইংরেজি সংস্করণ দেখানো হচ্ছে।

এই পাতায়

A search over 8,594 books has to decide which books to look in. The Quran Gallery Shamela server at https://qurangallery.com/mcp/shamela makes you name a shelf (a scope) for its main search tool, shamela_search_library. This page shows what that changes by running one query in several scopes.

All results below were returned by the live server on 2026-11-01. For the list of scopes and what they leave out, see Choosing a scope.

One query, four places

The query is «إنما الأعمال بالنيات», the wording of a well-known hadith. The first three rows use shamela_search_library, so they are comparable. The last row is a different tool, described below.

Where it was searchedBooks searchedMatchesWhat the first rows were
hadith-primary83Sunan Ibn Majah 5/ 305, Sahih al-Bukhari 1/ 6, Sunan Abi Dawud 3/ 526 (a footnote)
tafsir-canonical612Tafsir Ibn Kathir 3/ 196, then four pages of al-Tafsir al-Munir by al-Zuhayli
lugha1,05299Ihya’ ‘Ulum al-Din 4/ 362, then four books on other subjects that quote the hadith
the whole library, shamela_search with no scopeall6,815The first 10 rows were commentaries, a fatwa collection and other works. None was one of the eight primary collections

The query is the same and the engine is the same. What differs is the question the call answers.

  • In hadith-primary the answer to “where is this hadith printed?” comes first, with the edition and the printed page.
  • In tafsir-canonical the wording is found too, but in commentaries that quote it.
  • In lugha the hits are books that quote the hadith while discussing something else.
  • Across the whole library the count is 6,815 pages and the first rows were works that discuss the hadith. This is a correct result for “which pages mention these words”. It is a poor one for “where is the hadith printed”.

None of these is wrong. An assistant that searches only one place and reports it as the answer to a different question is wrong.

Why the whole-library list reads that way

Full-text search ranks by term statistics: how rare the words are and how often they occur on a page. It has no notion of which book is the source and which one quotes it. A scope is how you tell it. The hadith-primary shelf contains eight books, so every hit is in a collection.

The whole-library call used shamela_search (match: 'words') with no scope. That tool allows it. shamela_search_library does not: calling it with no scope is an error that lists the twelve names (Ten test cases, case 8).

The same rule applies to a fiqh question

The four school scopes search the school’s own shelf first and then fill from the wider scope (usul, general fiqh, issues). For fiqh-shafii a search for «زكاة الفطر» reported booksSearched: 90, which is the Shafi’i shelf, and totalMatches: 100. The first rows were:

BookPrinted pageEdition
Asna al-matalib fi sharh Rawd al-talib, Zakariyya al-Ansari2/ 487ed. al-‘Ilmiyya
Hilyat al-‘ulama’, al-Shashi7/ 187ed. al-Risala al-Haditha
‘Ujalat al-muhtaj, Ibn al-Mulaqqin1/ 495none in the result

This shows where the topic is discussed in the school’s books. It is not a ruling. An answer built on it should say which school’s books were searched and quote the passage, not summarise a position.

One scope is one shelf per call

A call to shamela_search_library takes one scope. It does not take a list, and it does not combine two shelves. To look in two places, make two calls and keep the results apart, naming the scope beside each:

  1. Search hadith-primary for the printed source.
  2. Search hadith-sciences or tafsir-canonical for what scholars said about it.
  3. In the answer, say which result came from which shelf.

Two shelves in one call would bring back the problem above, a single ranked list that mixes sources with the books that quote them. If a scope finds nothing, widen it deliberately (for example tafsir-canonical to tafsir, or one school to fiqh-comparative) and say that the narrower one was silent.

The twelve scopes

The names, labels and contents below are those defined in the server’s scope list. Book counts are from Choosing a scope. The example questions show what each scope is for, and each is a thing to look for in the books. None of them asks for a ruling.

ScopeWhat it coversBooksExample question
hadith-primaryThe eight primary hadith collections, each pinned to one printing8Where is the wording «إنما الأعمال بالنيات» printed?
tafsir-canonicalIbn Kathir, al-Tabari, Ibn al-Jawzi first, then three more6What do the main commentaries say on «آية الكرسي»?
fiqh-hanafiHanafi fiqh, plus usul, general fiqh and issues1,034Which Hanafi books have a chapter «باب زكاة الفطر»?
fiqh-malikiMaliki fiqh, plus usul, general fiqh and issues1,036Which Maliki books discuss «صلاة الجمع في السفر»?
fiqh-shafiiShafi’i fiqh, plus usul, general fiqh and issues1,037Which Shafi’i books discuss «زكاة الفطر»?
fiqh-hanbaliHanbali fiqh, plus usul, general fiqh and issues1,100Which Hanbali books discuss «التيمم»?
fiqh-comparativeAll four schools, plus comparative works, inheritance, governance, fatwa1,559Where do the schools’ books treat «الوقف» side by side?
aqeedahCreed and sects958Which creed texts use the term «الإيمان»?
hadith-sciencesHadith commentary, takhrij and the sciences of hadith1,957Where do commentaries on hadith discuss «إنما الأعمال بالنيات»?
tafsirThe whole tafsir shelf and Quranic sciences586Which tafsir works discuss «القيوم»?
seerahProphetic biography, history and biographical dictionaries972Where is «غزوة بدر» described, and by whom?
lughaArabic language, lexicons, grammar and adab1,052How do the lexicons define «النية»?

Together the twelve scopes cover 26 of the 41 catalogue categories, which is 7,084 of 8,594 books. The rest (tajwid and qira’at, hadith defects, genealogy and others) are reachable only through the raw shamela_* tools.

For the school scopes the count above is the whole scope. A search first queries the school’s own shelf, which is smaller (90 books for Shafi’i), as the result above shows.

What to take from this

  • Pick the scope that matches the question: a source, a commentary, a school’s books, a language point.
  • Report the scope next to the result. “Found in the eight primary collections” and “found in a language book” are different claims.
  • Do not treat a long hit list as stronger evidence than a short one from the right shelf.
  • To check a result you have, read the page back and use the printed edition and page in the citation. Reading a result explains each field.
GitHub-এ এই পাতা সম্পাদনা করুন