Documents - Get
從索引擷取文件。
GET {endpoint}/indexes('{indexName}')/docs('{key}')?api-version=2026-08-01-preview
GET {endpoint}/indexes('{indexName}')/docs('{key}')?api-version=2026-08-01-preview&$select={$select}
URI 參數
| 名稱 | 位於 | 必要 | 類型 | Description |
|---|---|---|---|---|
|
endpoint
|
path | True |
string (uri) |
搜尋服務的端點 URL。 |
|
index
|
path | True |
string |
索引的名稱。 |
|
key
|
path | True |
string |
要擷取的文件金鑰。 |
|
api-version
|
query | True |
string minLength: 1 |
用於此作業的 API 版本。 |
|
$select
|
query |
string[] |
要為檔擷取的域名清單;未擷取的任何字段都會從傳回的檔中遺失。 |
要求標頭
| 名稱 | 必要 | 類型 | Description |
|---|---|---|---|
| Accept |
接受標頭。 |
||
| x-ms-query-source-authorization |
string |
識別正在執行查詢的使用者的權杖。 此權杖可用來對文件強制執行安全性限制。 |
|
| x-ms-enable-elevated-read |
boolean |
啟用提高許可權讀取的值,可略過查詢作業的文件層級許可權檢查。 |
|
| x-ms-client-request-id |
string (uuid) |
要求不透明、全域唯一、用戶端產生的字串標識碼。 |
回應
| 名稱 | 類型 | Description |
|---|---|---|
| 200 OK |
Lookup |
要求已成功。 |
| Other Status Codes |
未預期的錯誤回應。 |
安全性
api-key
類型:
apiKey
位於:
header
OAuth2Auth
類型:
oauth2
Flow:
implicit
授權 URL:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize
範圍
| 名稱 | Description |
|---|---|
| https://search.azure.com/.default |
範例
SearchIndexGetDocument
範例要求
GET https://typespecpreviewexampleservice.search.windows.net/indexes('preview-test')/docs('1')?api-version=2026-08-01-preview&$select=id,description,name,category,ownerId
範例回覆
{
"id": "1",
"name": "test",
"description": "test1 hello",
"category": "purple",
"ownerId": "sam"
}
定義
| 名稱 | Description |
|---|---|
| Accept |
接受標頭。 |
|
Error |
資源管理錯誤其他資訊。 |
|
Error |
錯誤詳細資料。 |
|
Error |
所有 Azure Resource Manager API 的常見錯誤回應,以傳回失敗作業的錯誤詳細數據。 (這也遵循 OData 錯誤回應格式。)。 |
Accept
接受標頭。
| 值 | Description |
|---|---|
| application/json;odata.metadata=none |
ErrorAdditionalInfo
資源管理錯誤其他資訊。
| 名稱 | 類型 | Description |
|---|---|---|
| info |
其他資訊。 |
|
| type |
string |
其他信息類型。 |
ErrorDetail
錯誤詳細資料。
| 名稱 | 類型 | Description |
|---|---|---|
| additionalInfo |
錯誤的其他資訊。 |
|
| code |
string |
錯誤碼。 |
| details |
錯誤詳情 |
|
| message |
string |
錯誤訊息。 |
| target |
string |
錯誤目標。 |
ErrorResponse
所有 Azure Resource Manager API 的常見錯誤回應,以傳回失敗作業的錯誤詳細數據。 (這也遵循 OData 錯誤回應格式。)。
| 名稱 | 類型 | Description |
|---|---|---|
| error |
error 物件。 |