2
votes

I'm building an application that will hopefully use Wiktionary words and definitions as a data source. In my queries, I'd like to be able to search for all Wiktionary entries that are similar to user provided terms in either the title or definition, but also have titles ending with a specified suffix (or one of a set of suffixes).

For example, I want to find all Wiktionary entries that contain the words "large dog", like this: https://en.wiktionary.org/w/api.php?action=query&list=search&srsearch=large%20dog

But further filter the results to only contain entries with titles ending with "d". So in that example, "boarhound", "Saint Bernard", and "unleashed" would be returned.

Is this possible with the MediaWiki search API? Do you have any recommendations?

1
Not possible AFAIK - a similar feature request is T12808.Tgr

1 Answers

1
votes

This is mostly possible with ElasticSearch/CirrusSearch, but disabled for performance reasons. You can still use it on your wiki, or attempt smart search queries.

Usually for Wiktionary I use yanker, which can access the page table of the database. Your example (one-letter suffix) would be huge, but for instance .*hound$ finds:

Afghan_hound Bavarian_mountain_hound Foxhound Irish_Wolfhound Mahound Otterhound Russian_Wolfhound Scottish_Deerhound Tripehound basset_hound bearhound black_horehound bloodhound boarhound bookhound boozehound buckhound chowhound coon_hound coonhound covert-hound covert_hound coverthound deerhound double-nosed_andean_tiger_hound elkhound foxhound gazehound gorehound grayhound greyhound harehound heckhound hell-hound hell_hound hellhound hoarhound horehound hound limehound lyam-hound minkhound newshound nursehound otterhound powder_hound powderhound publicity-hound publicity_hound rock_hound rockhound scent_hound scenthound shag-hound sighthound sleuth-hound sleuthhound slot-hound slowhound sluthhound smooth_hound smoothhound smuthound staghound war_hound whorehound wolfhound