发送请求:
{
"action": "query",
"format": "json",
"prop": "categories",
"titles": "Barry Archbold",
"redirects": 1,
"utf8": 1,
"formatversion": "2",
"clcategories": "Category:Living people" //one of this page's category
}
返回响应:
{
"batchcomplete": true,
"query": {
"pages": [
{
"pageid": 40902107,
"ns": 0,
"title": "Barry Archbold",
"categories": [
{
"ns": 14,
"title": "Category:Living people"
}]...
但是如果我根据Wiki's Category Tree将clcategories
更改为Category:Life
的父类别之一Category:Living people
,则categories
数组将不会显示在响应中:
{
"batchcomplete": true,
"query": {
"pages": [
{
"pageid": 40902107,
"ns": 0,
"title": "Barry Archbold"
}
]
}
}
按标题查询时,是否可以按祖先类别过滤响应?