Documents - Get
Retrieves a document from the index.
GET https:///indexes('{indexName}')/docs('{key}')?api-version=2025-11-01-preview
GET https:///indexes('{indexName}')/docs('{key}')?api-version=2025-11-01-preview&$select={$select}
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
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 minLength: 1 |
The API version to use for this operation. |
|
$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 |
|---|---|---|---|
| Accept |
The Accept header. |
||
| x-ms-query-source-authorization |
string |
Token identifying the user for which the query is being executed. This token is used to enforce security restrictions on documents. |
|
| x-ms-enable-elevated-read |
boolean |
A value that enables elevated read that bypass document level permission checks for the query operation. |
|
| x-ms-client-request-id |
string (uuid) |
An opaque, globally-unique, client-generated string identifier for the request. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
Lookup |
The request has succeeded. |
| Other Status Codes |
An unexpected error response. |
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
SearchIndexGetDocument
Sample request
GET https:///indexes('preview-test')/docs('1')?api-version=2025-11-01-preview&$select=id,description,name,category,ownerId
Sample response
{
"id": "1",
"name": "test",
"description": "test1 hello",
"category": "purple",
"ownerId": "sam"
}
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. |