Community Wishlist Survey 2022/Wikisource/Search in books
Appearance
Search in books
- Problem: When books are transcluded into many pages, it is difficult to search text in them. For example, if I want to search Ajax in the Iliad, I must open 24 transclusions (
Iliad/Canto I
,Iliad/Canto II
, etc.) and make a text search in every page; another solution, but which is barely known even by contributors of Wikisource, would be using the advanced search, namely its field "Subpages of this page". To remedy this, some contributors create a new page with the full text of the book :Iliad/Full text
. I think it would be more useful to provide a search bar in every page of the main namespace which allows to find text in the current page or in all subpages. - Proposed solution: Provide a search bar on every page of the main namespace, giving results in the current page or in the whole book. In a word, this search bar would search text exactly in the same pages as the ones exported by the Export button. More precisely, it might be inserted next to the Export button, at the very top of the page, and may function in a similar way: if the Export button enables to export only the current page, the search bar reads « Search in this page » and gives the same results as Ctrl+F/Cmd+F; but when the Export button enables to export the whole book, the search bar reads « Search in full book ».
- Who would benefit: ::Readers: on French Wikisource, the full text page of famous books (like Candide by Voltaire) are more read than the individual transclusions, because readers consult these books on Wikisource mainly for full text search.
- Editors: we could save time if we stopped creating full text pages, which often have problems (too many templates, broken links, etc.)
- More comments: Idea of improvement : enabling regular expressions in this search bar (which is impossible with Ctrl+F: it would then justify the presence of this search bar in every page).
- Phabricator tickets: task T309490
- Proposer: ElioPrrl (talk) 10:14, 14 January 2022 (UTC)
Discussion
- But transcluded pages does not contain the text of the book. In
Iliad/Canto I
, there is not "The wrath of Peleus' son etc.", but<pages index="Homer - Iliad, translation Pope, 1909.djvu", etc.
. And even if it would, for the average user, use prefixes, keywords, etc., is not easy. On every page of Gallica (webpage of the French National Library) or Internet Archive, when you consult a book in their portal, there are two search bar: the first one for searching in the whole website, the second one (commonly integrated in the book viewer) for searching the book. — ElioPrrl (talk) 12:31, 17 January 2022 (UTC)- Your use case above does not adequately explain what you're trying to explain to me then, because I still don't get why searching in wikitext doesn't get you what you want. Izno (talk) 19:26, 17 January 2022 (UTC)
- @Izno:: Are you used to Wikisource? In Wikisource, the text of a page is rarely contained in the wikitext, but is transcluded from another page. Example : this transclusion only contains
<pages index="Homer - Iliad, translation Pope, 1909.djvu" from=35 to=51 />
, a command that transcludes the text containes in this page and the following ones; and note that the reader normally never accesses the Page: namespace. Therefore, even when restricting results to subpages of a given page, usinginsource:
to search transclusions of a book would not give any result: give it a try! In fact, the results are better without this parameter. - Anyway, this a very complicated way, only known by contributors, not by the average user. In the same way, it is possible, on IA or the BnF, to use the advanced search to find words in a given book; but all users of IA and BnF search books not this way, but by using the search bar integrated in the book viewer. I ask to emulate this functioning in Wikisource: a search bar integrated to transclusions. I advise you to consult SWilson's first solution below to understand what I mean. — ElioPrrl (talk) 09:55, 18 January 2022 (UTC)
- @Izno:: Are you used to Wikisource? In Wikisource, the text of a page is rarely contained in the wikitext, but is transcluded from another page. Example : this transclusion only contains
- Your use case above does not adequately explain what you're trying to explain to me then, because I still don't get why searching in wikitext doesn't get you what you want. Izno (talk) 19:26, 17 January 2022 (UTC)
- But transcluded pages does not contain the text of the book. In
- It's actually sort of already possible to put a search box in the 'indicators' area (where the export button is). Here's a hacky version: https://en.wikisource.beta.wmflabs.org/wiki/Test_Book — although, it's only possible to set a prefix to search, rather than following all the rules that WS Export uses (e.g. finding subpages referenced within
ws-summary
sections). I'm not sure of the best way around that, because it'd be really slow to determine what the extent of the work is (and even then it's still not foolproof), but we could think about adding a 'search' button next to export which would display a search dialog with some more info and the search form. —SWilson (WMF) (talk) 06:08, 17 January 2022 (UTC)
- Thanks! You have completely understood my thought. No matter if the first solution is not totally reliable: it's easier to urge developers into improving an existing tool than creating it from scratch. I only thought that, in order to save developer's time, the lines of code used in WSexport to select the pages to be exported could be reused for this new purpose, but maybe it's not feasible. — ElioPrrl (talk) 12:31, 17 January 2022 (UTC)
- The prefix parameter would be basepagename, not fullpagename. The intent is to searh pages with the same base page. Other than that, excellent.--Snævar (talk) 07:10, 20 January 2022 (UTC)
- @SWilson (WMF) and Snævar: I can also notice that sometimes the books may have transclusions whose title does not begin with the title of the base page. In particular, in French Wikisource, sometimes the complete works of an author are transcluded under their different titles; for example, in the book whose table of contents is found in
Complete Works of Molière
, the different plays are transcluded in the pagesTartufe
,Don Juan
, etc., notComplete Works of Molière/Tartufe
,Complete Works of Molière/Don Juan
(this is something I criticise on French Wikisource, but the very major part of the contributors still creates pages this way, because of this issue: they are afraid that under the long title the readers could not find the page, and they don't want to waste their time creating redirections to prevent this). — ElioPrrl (talk) 12:02, 4 February 2022 (UTC)
- @SWilson (WMF) and Snævar: I can also notice that sometimes the books may have transclusions whose title does not begin with the title of the base page. In particular, in French Wikisource, sometimes the complete works of an author are transcluded under their different titles; for example, in the book whose table of contents is found in
- @ElioPrrl, maybe I did not understand every aspect of your question, but look at a random ns0 page in it.wikisource, e.g. this Iliad: under the header you can see a search box available also by the layman to have a full search of a word in the entire work (here is the result for Aiace). Is this what you asked for? - εΔω 08:18, 4 February 2022 (UTC)
- @OrbiliusMagister: It is indeed what I am asking for. It seems that it is added automatically by your template Intestazione, doesn't it ? It would be nice if it could be added automatically on every page of ns0, even those without any template. — ElioPrrl (talk) 12:04, 4 February 2022 (UTC)
- @ElioPrrl: helping other users is my pleasure. On it.source the search box is actually an embedded Template:Ricerca, but you may just help yourself with it in many projects. - εΔω 20:13, 4 February 2022 (UTC)
- @OrbiliusMagister: It is indeed what I am asking for. It seems that it is added automatically by your template Intestazione, doesn't it ? It would be nice if it could be added automatically on every page of ns0, even those without any template. — ElioPrrl (talk) 12:04, 4 February 2022 (UTC)
Voting
- Support --Bicolino34 (talk) 18:08, 28 January 2022 (UTC)
- Support —The Editor's Apprentice (talk) 18:44, 28 January 2022 (UTC)
- Support --Arnd (talk) 20:20, 28 January 2022 (UTC)
- Support --YodinT 21:04, 28 January 2022 (UTC)
- Support Lectrician1 (talk) 22:52, 28 January 2022 (UTC)
- Support Noé (talk) 00:17, 29 January 2022 (UTC)
- Support Sathira15 (talk) 02:55, 29 January 2022 (UTC)
- Support Most needed search facility Balajijagadesh (talk) 04:36, 29 January 2022 (UTC)
- Support Satdeep Gill (talk) 07:26, 29 January 2022 (UTC)
- Support ··· 🌸 Rachmat04 · ☕ 08:14, 29 January 2022 (UTC)
- Support Bischnu (talk) 14:17, 29 January 2022 (UTC)
- Support --Raymonde Lanthier (talk) 14:24, 29 January 2022 (UTC)
- Support Rajdeep ghuman (talk) 14:40, 29 January 2022 (UTC)
- Support very useful and important, espcially for dictionaries. Cheers, VIGNERON * discut. 16:21, 29 January 2022 (UTC)
- Support --Denis Gagne52 (talk) 17:13, 29 January 2022 (UTC)
- Support --Cunegonde1 (talk) 18:22, 29 January 2022 (UTC)
- Support Viticulum (talk) 18:24, 29 January 2022 (UTC)
- Support Agus Damanik (talk) 01:47, 30 January 2022 (UTC)
- Support --Le ciel est par dessus le toit (talk) 08:32, 30 January 2022 (UTC)
- Support TheInternetGnome (talk) 08:35, 30 January 2022 (UTC)
- Support — Bilorv (talk) 10:47, 30 January 2022 (UTC)
- Support -- with the possibility of regular expressions search ! --F0x1 (talk) 19:18, 30 January 2022 (UTC)
- Support Libcub (talk) 00:47, 31 January 2022 (UTC)
- Support --Jagseer S Sidhu (talk) 09:48, 31 January 2022 (UTC)
- Support Sohom Datta (talk) 11:34, 31 January 2022 (UTC)
- Support Sannita - not just another it.wiki sysop 12:10, 31 January 2022 (UTC)
- Support Hb2007 (talk) 15:20, 31 January 2022 (UTC)
- Support JAn Dudík (talk) 21:38, 31 January 2022 (UTC)
- Support --Susanna Giaccai (talk) 10:22, 1 February 2022 (UTC)
- Support Szymonel (talk) 13:45, 1 February 2022 (UTC)
- Support Wargo (talk) 22:44, 1 February 2022 (UTC)
- Support Hiàn (talk) 04:24, 2 February 2022 (UTC)
- Support KingAntenor (talk) 07:07, 2 February 2022 (UTC)
- Support Dugal harpreet (talk) 13:33, 2 February 2022 (UTC)
- Support Trlit (talk) 23:35, 2 February 2022 (UTC)
- Support Silver hr (talk) 14:04, 3 February 2022 (UTC)
- Support εΔω 08:24, 4 February 2022 (UTC)
- Support Hedger z Castleton (talk) 16:07, 4 February 2022 (UTC)
- Support AlwynapHuw (talk) 19:57, 4 February 2022 (UTC)
- Support Thingofme (talk) 02:37, 5 February 2022 (UTC)
- Support Yes! Em-mustapha talk 16:43, 5 February 2022 (UTC)
- Support--Vulp❯❯❯here! 09:28, 6 February 2022 (UTC)
- Support —— Eric Liu(Talk) 10:52, 6 February 2022 (UTC)
- Support Daniel Case (talk) 18:25, 6 February 2022 (UTC)
- Support Ayumu Ozaki (talk) 04:16, 7 February 2022 (UTC)
- Support I'm going to interpret this as: "Make a logical search index, which indexes results per book instead of per page" —TheDJ (talk • contribs) 15:59, 7 February 2022 (UTC)
- Support paul2520 (talk) 16:57, 8 February 2022 (UTC)
- Support Languageseeker (talk) 04:47, 9 February 2022 (UTC)
- Support β16 - (talk) 09:50, 9 February 2022 (UTC)
- Support would save lot of time for people interested in books i.e., wikisource users Pavithra.A (talk) 16:16, 9 February 2022 (UTC)
- Support Would increase the usage of wikisource. J.shobia (talk) 16:24, 9 February 2022 (UTC)
- Support Gaurav (talk) 03:38, 11 February 2022 (UTC)
- Support Jl sg (talk) 10:09, 11 February 2022 (UTC)
- Support Forrestkirby (talk) 15:34, 11 February 2022 (UTC)