You are not logged in.
Is there a way to restrict the results of the Wiki search to one (or several) languages? I often get many results in languages I cannot read, sometimes ten or more translations of the same page.
Officer, I had to drive home - I was way too drunk to teleport!
Offline
surfraw's archwiki elvis has a language switch to restrict results.
Offline
Thanks! Very timely in more ways than one, as I have just installed surfraw today.
However... Surfraw does not get different results from the web interface for me. It chooses a different server to query depending on the language option, but the wiki.archlinux.org server can return all kinds of languages other than English. It will be helpful for a major non-English language, though.
I have read the wiki internationalisation thread since my first post (shame on me for not doing so earlier). A post there suggests that searching the Wiki by language was considered impossible in late 2010. Has this changed?
Possibly an English-only search would require all other languages being migrated to their own wikis.
Officer, I had to drive home - I was way too drunk to teleport!
Offline
Yes, as far as I know, you can either search the language wikis for specific results, or use the main wiki and cope with everything.
Offline
This thread looks very similar to https://bbs.archlinux.org/viewtopic.php?id=150476
Perhaps my post there may help you: https://bbs.archlinux.org/viewtopic.php … 2#p1174452
Offline
This thread looks very similar to https://bbs.archlinux.org/viewtopic.php?id=150476
Yes, that is the same question. I searched only the topics, not the full text, and included the keyword "language", so I missed it. (Should have been more thorough.)
Thank you for pointing me to the MediaWiki API and the relevant Wiki pages. I'll post again if/when I have scripted something more or less usable.
Regarding the discussion of Wiki internationalisation, it occurs to me that just including the (local) name of the language somwhere on each page would go a long way. One could then get rid of most false positives by including the language as a search term (assuming the Wiki search, unlike web search engines, actually greps the documents). Of course this is a bit of a hack.
Officer, I had to drive home - I was way too drunk to teleport!
Offline
Regarding the discussion of Wiki internationalisation, it occurs to me that just including the (local) name of the language somwhere on each page would go a long way. One could then get rid of most false positives by including the language as a search term (assuming the Wiki search, unlike web search engines, actually greps the documents). Of course this is a bit of a hack.
Maybe I haven't understood well what you mean, but the local name of the language is already included in all non-English article titles in the form "English_Title_(Language)", so restricting the search results to a non-English language is already as easy as including the language name in the search keywords; the only problem that we're having is when searching specifically for English articles with the wiki's interface (i.e. not through another client using API calls), and the two solutions proposed in https://wiki.archlinux.org/index.php/Help_talk:I18n are currently the only ones I'm aware of (adding an "_(English)" suffix to English articles won't be taken into consideration).
Offline
Yes, you are right. I was thinking of including the language name somewhere on the page, but that amounts to the same thing.
Officer, I had to drive home - I was way too drunk to teleport!
Offline
I have put together a Perl script that seems to work. Download here. It searches titles normally, unless you add a plus sign as the last argument. (The API does not seem to support searching both titles and page text simultaneously.) Adding more plus signs in the last argument retrieves more search results. The number of results printed will vary depending on how many of the API results are English. The metadata printed can be customised by modifying the @props array.
What I have not managed is to exclude redirect pages from the results. This is supposed to work via the srredirect API parameter, but I have tried the values 0, off and false, without success. What is the canonical boolean-false value of the MediaWiki API?
Officer, I had to drive home - I was way too drunk to teleport!
Offline