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.
Halaman ini belum diterjemahkan — menampilkan versi bahasa Inggris.
Di halaman ini
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 searched | Books searched | Matches | What the first rows were |
|---|---|---|---|
hadith-primary | 8 | 3 | Sunan Ibn Majah 5/ 305, Sahih al-Bukhari 1/ 6, Sunan Abi Dawud 3/ 526 (a footnote) |
tafsir-canonical | 6 | 12 | Tafsir Ibn Kathir 3/ 196, then four pages of al-Tafsir al-Munir by al-Zuhayli |
lugha | 1,052 | 99 | Ihya’ ‘Ulum al-Din 4/ 362, then four books on other subjects that quote the hadith |
the whole library, shamela_search with no scope | all | 6,815 | The 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-primarythe answer to “where is this hadith printed?” comes first, with the edition and the printed page. - In
tafsir-canonicalthe wording is found too, but in commentaries that quote it. - In
lughathe 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:
| Book | Printed page | Edition |
|---|---|---|
| Asna al-matalib fi sharh Rawd al-talib, Zakariyya al-Ansari | 2/ 487 | ed. al-‘Ilmiyya |
| Hilyat al-‘ulama’, al-Shashi | 7/ 187 | ed. al-Risala al-Haditha |
| ‘Ujalat al-muhtaj, Ibn al-Mulaqqin | 1/ 495 | none 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:
- Search
hadith-primaryfor the printed source. - Search
hadith-sciencesortafsir-canonicalfor what scholars said about it. - 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.
| Scope | What it covers | Books | Example question |
|---|---|---|---|
hadith-primary | The eight primary hadith collections, each pinned to one printing | 8 | Where is the wording «إنما الأعمال بالنيات» printed? |
tafsir-canonical | Ibn Kathir, al-Tabari, Ibn al-Jawzi first, then three more | 6 | What do the main commentaries say on «آية الكرسي»? |
fiqh-hanafi | Hanafi fiqh, plus usul, general fiqh and issues | 1,034 | Which Hanafi books have a chapter «باب زكاة الفطر»? |
fiqh-maliki | Maliki fiqh, plus usul, general fiqh and issues | 1,036 | Which Maliki books discuss «صلاة الجمع في السفر»? |
fiqh-shafii | Shafi’i fiqh, plus usul, general fiqh and issues | 1,037 | Which Shafi’i books discuss «زكاة الفطر»? |
fiqh-hanbali | Hanbali fiqh, plus usul, general fiqh and issues | 1,100 | Which Hanbali books discuss «التيمم»? |
fiqh-comparative | All four schools, plus comparative works, inheritance, governance, fatwa | 1,559 | Where do the schools’ books treat «الوقف» side by side? |
aqeedah | Creed and sects | 958 | Which creed texts use the term «الإيمان»? |
hadith-sciences | Hadith commentary, takhrij and the sciences of hadith | 1,957 | Where do commentaries on hadith discuss «إنما الأعمال بالنيات»? |
tafsir | The whole tafsir shelf and Quranic sciences | 586 | Which tafsir works discuss «القيوم»? |
seerah | Prophetic biography, history and biographical dictionaries | 972 | Where is «غزوة بدر» described, and by whom? |
lugha | Arabic language, lexicons, grammar and adab | 1,052 | How 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.