你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Documents - Count
查询索引中的文档数。
GET {endpoint}/indexes('{indexName}')/docs/$count?api-version=2023-11-01
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
endpoint
|
path | True |
string |
搜索服务的终结点 URL。 |
index
|
path | True |
string |
索引的名称。 |
api-version
|
query | True |
string |
客户端 API 版本。 |
请求头
名称 | 必需 | 类型 | 说明 |
---|---|---|---|
x-ms-client-request-id |
string uuid |
随请求一起发送以帮助调试的跟踪 ID。 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
integer |
|
Other Status Codes |
错误响应。 |
示例
SearchIndexCountDocuments
Sample Request
GET https://myservice.search.windows.net/indexes('myindex')/docs/$count?api-version=2023-11-01
Sample Response
427
定义
SearchError
描述 API 的错误条件。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
服务器定义的一组错误代码中的一个。 |
details |
有关导致此项报告错误的特定错误的详细信息数组。 |
|
message |
string |
错误的用户可读表示形式。 |