Documents - Get

Lekéri a dokumentumot az indexből.

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

URI-paraméterek

Name In Kötelező Típus Description
endpoint
path True

string

A keresési szolgáltatás végponti URL-címe.

indexName
path True

string

Az index neve.

key
path True

string

A lekérni kívánt dokumentum kulcsa.

api-version
query True

string

Ügyfél API-verziója.

$select
query

string[]

A dokumentumhoz beolvasandó mezőnevek listája; A nem lekért mezők hiányoznak a visszaadott dokumentumból.

Kérelem fejléce

Name Kötelező Típus Description
x-ms-client-request-id

string (uuid)

A kéréssel együtt küldött nyomkövetési azonosító, amely segít a hibakeresésben.

Válaszok

Name Típus Description
200 OK

LookupDocument

A kért dokumentumot tartalmazó válasz.

Other Status Codes

ErrorResponse

Hibaválasz.

Példák

SearchIndexGetDocument

Mintakérelem

GET https://previewexampleservice.search.windows.net/indexes('preview-test')/docs('1')?$select=id,description,name,category,ownerId&api-version=2024-09-01-preview

Mintaválasz

{
  "id": "1",
  "name": "test",
  "description": "test1 hello",
  "category": "purple",
  "ownerId": "sam"
}

Definíciók

Name Description
ErrorAdditionalInfo

Az erőforrás-kezelési hiba további információi.

ErrorDetail

A hiba részletei.

ErrorResponse

Hibaválasz

ErrorAdditionalInfo

Az erőforrás-kezelési hiba további információi.

Name Típus Description
info

object

A további információk.

type

string

A további információtípus.

ErrorDetail

A hiba részletei.

Name Típus Description
additionalInfo

ErrorAdditionalInfo[]

A hiba további információi.

code

string

A hibakód.

details

ErrorDetail[]

A hiba részletei.

message

string

A hibaüzenet.

target

string

A hibacél.

ErrorResponse

Hibaválasz

Name Típus Description
error

ErrorDetail

A hibaobjektum.