Condividi tramite


DocumentsOperationsExtensions.SuggestAsync Method

Definition

Overloads

SuggestAsync(IDocumentsOperations, String, String, SuggestParameters, SearchRequestOptions, CancellationToken)

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

SuggestAsync<T>(IDocumentsOperations, String, String, SuggestParameters, SearchRequestOptions, CancellationToken)

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

SuggestAsync(IDocumentsOperations, String, String, SuggestParameters, SearchRequestOptions, CancellationToken)

Source:
DocumentsOperationsExtensions.cs

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

public static System.Threading.Tasks.Task<Microsoft.Azure.Search.Models.DocumentSuggestResult<Microsoft.Azure.Search.Models.Document>> SuggestAsync (this Microsoft.Azure.Search.IDocumentsOperations operations, string searchText, string suggesterName, Microsoft.Azure.Search.Models.SuggestParameters suggestParameters = default, Microsoft.Azure.Search.Models.SearchRequestOptions searchRequestOptions = default, System.Threading.CancellationToken cancellationToken = default);
static member SuggestAsync : Microsoft.Azure.Search.IDocumentsOperations * string * string * Microsoft.Azure.Search.Models.SuggestParameters * Microsoft.Azure.Search.Models.SearchRequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Search.Models.DocumentSuggestResult<Microsoft.Azure.Search.Models.Document>>
<Extension()>
Public Function SuggestAsync (operations As IDocumentsOperations, searchText As String, suggesterName As String, Optional suggestParameters As SuggestParameters = Nothing, Optional searchRequestOptions As SearchRequestOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of DocumentSuggestResult(Of Document))

Parameters

operations
IDocumentsOperations

The operations group for this extension method.

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

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

SuggestAsync<T>(IDocumentsOperations, String, String, SuggestParameters, SearchRequestOptions, CancellationToken)

Source:
DocumentsOperationsExtensions.cs

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

public static System.Threading.Tasks.Task<Microsoft.Azure.Search.Models.DocumentSuggestResult<T>> SuggestAsync<T> (this Microsoft.Azure.Search.IDocumentsOperations operations, string searchText, string suggesterName, Microsoft.Azure.Search.Models.SuggestParameters suggestParameters = default, Microsoft.Azure.Search.Models.SearchRequestOptions searchRequestOptions = default, System.Threading.CancellationToken cancellationToken = default);
static member SuggestAsync : Microsoft.Azure.Search.IDocumentsOperations * string * string * Microsoft.Azure.Search.Models.SuggestParameters * Microsoft.Azure.Search.Models.SearchRequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Search.Models.DocumentSuggestResult<'T>>
<Extension()>
Public Function SuggestAsync(Of T) (operations As IDocumentsOperations, searchText As String, suggesterName As String, Optional suggestParameters As SuggestParameters = Nothing, Optional searchRequestOptions As SearchRequestOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(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

operations
IDocumentsOperations

The operations group for this extension method.

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

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