Documents - Count
Queries the number of documents in the index.
GET https:///indexes('{indexName}')/docs/$count?api-version=2025-11-01-preview
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
index
|
path | True |
string |
The name of the index. |
|
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
Request Header
| Name | Required | Type | Description |
|---|---|---|---|
| Accept |
The Accept header. |
||
| x-ms-client-request-id |
string (uuid) |
An opaque, globally-unique, client-generated string identifier for the request. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
integer |
The request has succeeded. Media Types: "text/plain; charset=utf-8", "application/json" |
| Other Status Codes |
An unexpected error response. Media Types: "text/plain; charset=utf-8", "application/json" |
Security
api-key
Type:
apiKey
In:
header
OAuth2Auth
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize
Scopes
| Name | Description |
|---|---|
| https://search.azure.com/.default |
Examples
SearchIndexCountDocuments
Sample request
GET https:///indexes('preview-test')/docs/$count?api-version=2025-11-01-preview
Sample response
50
Definitions
| Name | Description |
|---|---|
| Accept |
The Accept header. |
|
Error |
The resource management error additional info. |
|
Error |
The error detail. |
|
Error |
Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). |
Accept
The Accept header.
| Value | Description |
|---|---|
| application/json;odata.metadata=none |
ErrorAdditionalInfo
The resource management error additional info.
| Name | Type | Description |
|---|---|---|
| info |
|
The additional info. |
| type |
string |
The additional info type. |
ErrorDetail
The error detail.
| Name | Type | Description |
|---|---|---|
| additionalInfo |
The error additional info. |
|
| code |
string |
The error code. |
| details |
The error details. |
|
| message |
string |
The error message. |
| target |
string |
The error target. |
ErrorResponse
Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).
| Name | Type | Description |
|---|---|---|
| error |
The error object. |