在 MediaWiki 搜索中指定偏移量
我正在查询我们正在运行的 MediaWiki 实例。我正在为搜索
api.php?action=opensearch&search=afg&limit=100&format=xml
传递以下参数我没有看到任何方法将偏移量作为参数传递。有谁知道我们如何传递偏移量,或者是否有一个扩展可以使用并查询它以返回可以摄取到我的应用程序中的结果?
I'm querying a MediaWiki instance which we are running. I'm passing the following parameters for the search
api.php?action=opensearch&search=afg&limit=100&format=xml
I didn't see any way to pass the offset as a parameter. Does anybody know how we can pass a offset or if there is an extension which I can use and query it to return results which can be ingested in to my application?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
opensearch api 不适用于连续查询,因此没有偏移参数。
但是,您可以使用 搜索模块(action=query)来获取结果,例如 Special :Search,你也会有一个偏移参数。
The opensearch api isn't made for contuing queries, so there is no offset parameter.
However, you can use the search module (of action=query) for results like in Special:Search, and there you will have an offset parameter, too.
你可以使用这个:
https://en.wikipedia.org/w/api.php?action=query&list=search&prop=info&inprop=url&utf8=&format=json&origin=*&sroffset= 0&srlimit=5&srsearch=your_serch_value
0-5 之间的结果
这将为您提供下一页 ,您可以将偏移量设置为 5 并限制到 5
这将为您提供 5-10 之间的结果,依此类推...
you can use this:
https://en.wikipedia.org/w/api.php?action=query&list=search&prop=info&inprop=url&utf8=&format=json&origin=*&sroffset=0&srlimit=5&srsearch=your_serch_value
this will give you results between 0-5
next page you can set offset to 5 and limit to 5
this will give you results between 5-10, and so on...