Documents - Get
Retrieves a document from the index.
GET {endpoint}/indexes('{indexName}')/docs('{key}')?api-version=2025-09-01
GET {endpoint}/indexes('{indexName}')/docs('{key}')?$select={$select}&api-version=2025-09-01
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. |
|
key
|
path | True |
string |
The key of the document to retrieve. |
|
api-version
|
query | True |
string |
Client Api Version. |
|
$select
|
query |
string[] |
List of field names to retrieve for the document; Any field not retrieved will be missing from the returned document. |
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 |
Lookup |
Response containing the requested document. |
| Other Status Codes |
Error response. |
Examples
SearchIndexGetDocument
Sample request
GET https://stableexampleservice.search.windows.net/indexes('stable-test')/docs('1')?$select=id,description,name,category,ownerId&api-version=2025-09-01
Sample response
{
"id": "1",
"name": "test",
"description": "test1 hello",
"category": "purple",
"ownerId": "sam"
}
Definitions
| Name | Description |
|---|---|
|
Error |
The resource management error additional info. |
|
Error |
The error detail. |
|
Error |
Error response |
ErrorAdditionalInfo
The resource management error additional info.
| Name | Type | Description |
|---|---|---|
| info |
object |
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
Error response
| Name | Type | Description |
|---|---|---|
| error |
The error object. |