Documents - Count
Queries the number of documents in the index.
GET {endpoint}/indexes('{indexName}')/docs/$count?api-version=2023-10-01-Preview
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
endpoint
|
path | True |
string |
The endpoint URL of the search service. |
index
|
path | True |
string |
The name of the index. |
api-version
|
query | True |
string |
Client Api Version. |
Request Header
Name | Required | Type | Description |
---|---|---|---|
x-ms-client-request-id |
string uuid |
The tracking ID sent with the request to help with debugging. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
integer |
|
Other Status Codes |
Error response. |
Examples
SearchIndexCountDocuments
Sample request
GET https://myservice.search.windows.net/indexes('myindex')/docs/$count?api-version=2023-10-01-Preview
Sample response
427
Definitions
SearchError
Describes an error condition for the API.
Name | Type | Description |
---|---|---|
code |
string |
One of a server-defined set of error codes. |
details |
An array of details about specific errors that led to this reported error. |
|
message |
string |
A human-readable representation of the error. |