次の方法で共有


Documents - Get

インデックスからドキュメントを取得します。

GET {endpoint}/indexes('{indexName}')/docs('{key}')?api-version=2023-11-01
GET {endpoint}/indexes('{indexName}')/docs('{key}')?$select={$select}&api-version=2023-11-01

URI パラメーター

名前 / 必須 説明
endpoint
path True

string

検索サービスのエンドポイント URL。

indexName
path True

string

インデックスの名前です。

key
path True

string

取得するドキュメントのキー。

api-version
query True

string

クライアント API のバージョン。

$select
query

string[]

ドキュメント用に取得するフィールド名の一覧。取得されないフィールドは、返されたドキュメントに表示されません。

要求ヘッダー

名前 必須 説明
x-ms-client-request-id

string

uuid

デバッグに役立つ要求と共に送信された追跡 ID。

応答

名前 説明
200 OK

LookupDocument

要求されたドキュメントを含む応答。

Other Status Codes

SearchError

エラー応答。

SearchIndexGetDocument

要求のサンプル

GET https://myservice.search.windows.net/indexes('myindex')/docs('1')?$select=docId,title,description&api-version=2023-11-01

応答のサンプル

{
  "description": "Cheapest hotel in town",
  "docId": "1",
  "title": "Nice Hotel"
}

定義

SearchError

API のエラー条件について説明します。

名前 説明
code

string

サーバー定義のエラー コードのセットの 1 つ。

details

SearchError[]

この報告されたエラーの原因となった特定のエラーに関する詳細の配列。

message

string

エラーの人間が判読できる表現。