IDocumentsOperations.SearchWithHttpMessagesAsync Method

Definition

Overloads

SearchWithHttpMessagesAsync(String, SearchParameters, SearchRequestOptions, Dictionary<String,List<String>>, CancellationToken)

Searches for documents in the search index. https://docs.microsoft.com/rest/api/searchservice/Search-Documents

SearchWithHttpMessagesAsync<T>(String, SearchParameters, SearchRequestOptions, Dictionary<String,List<String>>, CancellationToken)

Searches for documents in the search index. https://docs.microsoft.com/rest/api/searchservice/Search-Documents

SearchWithHttpMessagesAsync(String, SearchParameters, SearchRequestOptions, Dictionary<String,List<String>>, CancellationToken)

Searches for documents in the search index. https://docs.microsoft.com/rest/api/searchservice/Search-Documents

public System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Azure.Search.Models.DocumentSearchResult<Microsoft.Azure.Search.Models.Document>>> SearchWithHttpMessagesAsync (string searchText, Microsoft.Azure.Search.Models.SearchParameters searchParameters, Microsoft.Azure.Search.Models.SearchRequestOptions searchRequestOptions = default, System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<string>> customHeaders = default, System.Threading.CancellationToken cancellationToken = default);
abstract member SearchWithHttpMessagesAsync : string * Microsoft.Azure.Search.Models.SearchParameters * Microsoft.Azure.Search.Models.SearchRequestOptions * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Azure.Search.Models.DocumentSearchResult<Microsoft.Azure.Search.Models.Document>>>
Public Function SearchWithHttpMessagesAsync (searchText As String, searchParameters As SearchParameters, Optional searchRequestOptions As SearchRequestOptions = Nothing, Optional customHeaders As Dictionary(Of String, List(Of String)) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of AzureOperationResponse(Of DocumentSearchResult(Of Document)))

Parameters

searchText
String

A full-text search query expression; Use null or "*" to match all documents. See https://docs.microsoft.com/rest/api/searchservice/Simple-query-syntax-in-Azure-Search for more information about search query syntax.

searchParameters
SearchParameters

Parameters to further refine the search query.

searchRequestOptions
SearchRequestOptions

Additional parameters for the operation

customHeaders
Dictionary<String,List<String>>

The headers that will be added to request.

cancellationToken
CancellationToken

The cancellation token.

Returns

Response containing the documents matching the query.

Remarks

The non-generic overloads of the Search, SearchAsync, and SearchWithHttpMessagesAsync 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.

If Azure Cognitive Search can't include all results in a single response, the response returned will include a continuation token that can be passed to ContinueSearch to retrieve more results. See DocumentSearchResult.ContinuationToken for more information.

Applies to

SearchWithHttpMessagesAsync<T>(String, SearchParameters, SearchRequestOptions, Dictionary<String,List<String>>, CancellationToken)

Searches for documents in the search index. https://docs.microsoft.com/rest/api/searchservice/Search-Documents

public System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Azure.Search.Models.DocumentSearchResult<T>>> SearchWithHttpMessagesAsync<T> (string searchText, Microsoft.Azure.Search.Models.SearchParameters searchParameters, Microsoft.Azure.Search.Models.SearchRequestOptions searchRequestOptions = default, System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<string>> customHeaders = default, System.Threading.CancellationToken cancellationToken = default);
abstract member SearchWithHttpMessagesAsync : string * Microsoft.Azure.Search.Models.SearchParameters * Microsoft.Azure.Search.Models.SearchRequestOptions * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Azure.Search.Models.DocumentSearchResult<'T>>>
Public Function SearchWithHttpMessagesAsync(Of T) (searchText As String, searchParameters As SearchParameters, Optional searchRequestOptions As SearchRequestOptions = Nothing, Optional customHeaders As Dictionary(Of String, List(Of String)) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of AzureOperationResponse(Of DocumentSearchResult(Of 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

searchText
String

A full-text search query expression; Use null or "*" to match all documents. See https://docs.microsoft.com/rest/api/searchservice/Simple-query-syntax-in-Azure-Search for more information about search query syntax.

searchParameters
SearchParameters

Parameters to further refine the search query.

searchRequestOptions
SearchRequestOptions

Additional parameters for the operation

customHeaders
Dictionary<String,List<String>>

The headers that will be added to request.

cancellationToken
CancellationToken

The cancellation token.

Returns

Response containing the documents matching the query.

Remarks

The generic overloads of the Search, SearchAsync, and SearchWithHttpMessagesAsync methods support mapping of 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.

If Azure Cognitive Search can't include all results in a single response, the response returned will include a continuation token that can be passed to ContinueSearch to retrieve more results. See DocumentSearchResult.ContinuationToken for more information.

Applies to