다음을 통해 공유


DocumentsOperationsExtensions.Get Method

Definition

Overloads

Get(IDocumentsOperations, String, IEnumerable<String>, SearchRequestOptions)

Retrieves a document from the search index. https://docs.microsoft.com/rest/api/searchservice/Lookup-Document

Get<T>(IDocumentsOperations, String, IEnumerable<String>, SearchRequestOptions)

Retrieves a document from the search index. https://docs.microsoft.com/rest/api/searchservice/Lookup-Document

Get(IDocumentsOperations, String, IEnumerable<String>, SearchRequestOptions)

Source:
DocumentsOperationsExtensions.cs

Retrieves a document from the search index. https://docs.microsoft.com/rest/api/searchservice/Lookup-Document

public static Microsoft.Azure.Search.Models.Document Get (this Microsoft.Azure.Search.IDocumentsOperations operations, string key, System.Collections.Generic.IEnumerable<string> selectedFields = default, Microsoft.Azure.Search.Models.SearchRequestOptions searchRequestOptions = default);
static member Get : Microsoft.Azure.Search.IDocumentsOperations * string * seq<string> * Microsoft.Azure.Search.Models.SearchRequestOptions -> Microsoft.Azure.Search.Models.Document
<Extension()>
Public Function Get (operations As IDocumentsOperations, key As String, Optional selectedFields As IEnumerable(Of String) = Nothing, Optional searchRequestOptions As SearchRequestOptions = Nothing) As Document

Parameters

operations
IDocumentsOperations

The operations group for this extension method.

key
String

The key of the document to retrieve; See https://docs.microsoft.com/rest/api/searchservice/Naming-rules for the rules for constructing valid document keys.

selectedFields
IEnumerable<String>

List of field names to retrieve for the document; Any field not retrieved will be missing from the returned document. All retrievable fields are included in the result by default.

searchRequestOptions
SearchRequestOptions

Additional parameters for the operation

Returns

The requested document.

Remarks

The non-generic overloads of the Get, GetAsync, and GetWithHttpMessagesAsync methods make a best-effort attempt to map JSON types in the response payload to .NET types. See GetWithHttpMessagesAsync(String, IEnumerable<String>, SearchRequestOptions, Dictionary<String,List<String>>, CancellationToken) for more information.

Applies to

Get<T>(IDocumentsOperations, String, IEnumerable<String>, SearchRequestOptions)

Source:
DocumentsOperationsExtensions.cs

Retrieves a document from the search index. https://docs.microsoft.com/rest/api/searchservice/Lookup-Document

public static T Get<T> (this Microsoft.Azure.Search.IDocumentsOperations operations, string key, System.Collections.Generic.IEnumerable<string> selectedFields = default, Microsoft.Azure.Search.Models.SearchRequestOptions searchRequestOptions = default);
static member Get : Microsoft.Azure.Search.IDocumentsOperations * string * seq<string> * Microsoft.Azure.Search.Models.SearchRequestOptions -> 'T
<Extension()>
Public Function Get(Of T) (operations As IDocumentsOperations, key As String, Optional selectedFields As IEnumerable(Of String) = Nothing, Optional searchRequestOptions As SearchRequestOptions = Nothing) As T

Type Parameters

T

The CLR type that maps to the index schema. Instances of this type can be retrieved as documents from the index.

Parameters

operations
IDocumentsOperations

The operations group for this extension method.

key
String

The key of the document to retrieve; See https://docs.microsoft.com/rest/api/searchservice/Naming-rules for the rules for constructing valid document keys.

selectedFields
IEnumerable<String>

List of field names to retrieve for the document; Any field not retrieved will have null or default as its corresponding property value in the returned object. All retrievable fields are included in the result by default.

searchRequestOptions
SearchRequestOptions

Additional parameters for the operation

Returns

T

The requested document.

Remarks

The generic overloads of the Get, GetAsync, and GetWithHttpMessagesAsync methods support mapping of Azure Search field types to .NET types via the type parameter T. See GetWithHttpMessagesAsync<T>(String, IEnumerable<String>, SearchRequestOptions, Dictionary<String,List<String>>, CancellationToken) for more details on the type mapping.

Applies to