Searching for content with the REST API and CQL always limits results to 50
プラットフォームについて: Data Center のみ。 - This article only applies to Atlassian apps on the Data Center プラットフォーム。
この KB は Data Center バージョンの製品用に作成されています。Data Center 固有ではない機能の Data Center KB は、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。 Server* 製品のサポートは 2024 年 2 月 15 日に終了しました。Server 製品を実行している場合は、 アトラシアン Server サポート終了 のお知らせにアクセスして、移行オプションを確認してください。
*Fisheye および Crucible は除く
要約
Searching for content using the REST API and Confluence Query Language (CQL) always returns a maximum of 50 results, despite increasing the limit parameter. For example:
BASEURL/rest/api/content/search?expand=space,body.view,history.lastUpdated&cql=type=page+AND+space.type=global+AND+lastmodified>2020-09-27&start=0&limit=50&status=current原因
When using the rest/api/content/search endpoint with CQL, there are limits hardcoded in the backend that govern how many results will be returned based on expansions that are requested. When the "body" expansion is specified, the limit is set to 50. If no expansions are specified, results are limited to 1000. And if other expansions besides "body" are specified, the limit is set to 200.
ソリューション
エンドポイントを利用する際に "body" expand を指定しない。上記の例を使う場合、リクエストを次のようにします。
BASEURL/rest/api/content/search?expand=space,history.lastUpdated&cql=type=page+AND+space.type=global+AND+lastmodified>2020-09-27&start=0&limit=50&status=currentThat will return a maximum of 200 results.
この内容はお役に立ちましたか?