共用方式為


IDocumentsOperations.SuggestWithHttpMessagesAsync Method

Definition

Overloads

SuggestWithHttpMessagesAsync(String, String, SuggestParameters, SearchRequestOptions, Dictionary<String,List<String>>, CancellationToken)

Suggests query terms based on input text and matching documents in the search index. https://docs.microsoft.com/rest/api/searchservice/Suggestions

SuggestWithHttpMessagesAsync<T>(String, String, SuggestParameters, SearchRequestOptions, Dictionary<String,List<String>>, CancellationToken)

Suggests query terms based on input text and matching documents in the search index. https://docs.microsoft.com/rest/api/searchservice/Suggestions

SuggestWithHttpMessagesAsync(String, String, SuggestParameters, SearchRequestOptions, Dictionary<String,List<String>>, CancellationToken)

Suggests query terms based on input text and matching documents in the search index. https://docs.microsoft.com/rest/api/searchservice/Suggestions

public System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Azure.Search.Models.DocumentSuggestResult<Microsoft.Azure.Search.Models.Document>>> SuggestWithHttpMessagesAsync (string searchText, string suggesterName, Microsoft.Azure.Search.Models.SuggestParameters suggestParameters, 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 SuggestWithHttpMessagesAsync : string * string * Microsoft.Azure.Search.Models.SuggestParameters * 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.DocumentSuggestResult<Microsoft.Azure.Search.Models.Document>>>
Public Function SuggestWithHttpMessagesAsync (searchText As String, suggesterName As String, suggestParameters As SuggestParameters, 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 DocumentSuggestResult(Of Document)))

Parameters

searchText
String

The search text on which to base suggestions.

suggesterName
String

The name of the suggester as specified in the suggesters collection that's part of the index definition.

suggestParameters
SuggestParameters

Parameters to further refine the suggestion 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 suggested text and documents matching the query.

Remarks

The non-generic overloads of the Suggest, SuggestAsync, and SuggestWithHttpMessagesAsync 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

SuggestWithHttpMessagesAsync<T>(String, String, SuggestParameters, SearchRequestOptions, Dictionary<String,List<String>>, CancellationToken)

Suggests query terms based on input text and matching documents in the search index. https://docs.microsoft.com/rest/api/searchservice/Suggestions

public System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Azure.Search.Models.DocumentSuggestResult<T>>> SuggestWithHttpMessagesAsync<T> (string searchText, string suggesterName, Microsoft.Azure.Search.Models.SuggestParameters suggestParameters, 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 SuggestWithHttpMessagesAsync : string * string * Microsoft.Azure.Search.Models.SuggestParameters * 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.DocumentSuggestResult<'T>>>
Public Function SuggestWithHttpMessagesAsync(Of T) (searchText As String, suggesterName As String, suggestParameters As SuggestParameters, 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 DocumentSuggestResult(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

The search text on which to base suggestions.

suggesterName
String

The name of the suggester as specified in the suggesters collection that's part of the index definition.

suggestParameters
SuggestParameters

Parameters to further refine the suggestion 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 suggested text and documents matching the query.

Remarks

The generic overloads of the Suggest, SuggestAsync, and SuggestWithHttpMessagesAsync 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.

Applies to