Wiktionary/MediaWiki 搜索和后缀过滤

Wiktionary/MediaWiki Search & Suffix Filtering

我正在构建一个应用程序,希望使用 Wiktionary 单词和定义作为数据源。在我的查询中,我希望能够搜索所有维基词典条目,这些条目在标题或定义中类似于用户提供的术语,但也有以指定后缀(或一组后缀之一)结尾的标题。

例如,我想查找所有包含单词 "large dog" 的 Wiktionary 条目,如下所示: https://en.wiktionary.org/w/api.php?action=query&list=search&srsearch=large%20dog

但进一步过滤结果以仅包含标题以 "d" 结尾的条目。因此,在该示例中,将返回 "boarhound"、"Saint Bernard" 和 "unleashed"。

MediaWiki 搜索是否可行 API?你有什么建议吗?

这在 ElasticSearch/CirrusSearch 中很可能实现,但是 disabled for performance reasons. You can still use it on your wiki, or attempt smart search queries

通常我使用维基词典 yanker, which can access the page table of the database. Your example (one-letter suffix) would be huge, but for instance .*hound$ 发现:

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