DocumentsOperationsExtensions.Get Method

Definition

Overloads

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

Retrieves a document from the search index.

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

Retrieves a document from the search index.

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

Retrieves a document from the search index.

public static Microsoft.Azure.Search.Models.Document Get (this Microsoft.Azure.Search.IDocumentsOperations operations, string key, System.Collections.Generic.IEnumerable<string> selectedFields = null, Microsoft.Azure.Search.Models.SearchRequestOptions searchRequestOptions = null);
static member Get : Microsoft.Azure.Search.IDocumentsOperations * string * seq<string> * Microsoft.Azure.Search.Models.SearchRequestOptions -> Microsoft.Azure.Search.Models.Document

Parameters

operations
IDocumentsOperations

The operations group for this extension method.

key
String

The key of the document to retrieve; See 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.

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

Retrieves a document from the search index.

public static T Get<T> (this Microsoft.Azure.Search.IDocumentsOperations operations, string key, System.Collections.Generic.IEnumerable<string> selectedFields = null, Microsoft.Azure.Search.Models.SearchRequestOptions searchRequestOptions = null);
static member Get : Microsoft.Azure.Search.IDocumentsOperations * string * seq<string> * Microsoft.Azure.Search.Models.SearchRequestOptions -> '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 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