IDocumentOperations.SuggestAsync Method
Applies To: Microsoft Azure
Namespace: Microsoft.Azure.Search
Assembly: Microsoft.Azure.Search (in Microsoft.Azure.Search.dll)
Overload List
| Name | Description | |
|---|---|---|
![]() |
SuggestAsync(String, String, SuggestParameters, CancellationToken) | Suggests query terms based on input text and matching documents in the Azure Search index. (see https://msdn.microsoft.com/library/azure/dn798936.aspx for more information) |
![]() |
SuggestAsync<T>(String, String, SuggestParameters, CancellationToken) | Suggests query terms based on input text and matching documents in the Azure Search index. (see https://msdn.microsoft.com/library/azure/dn798936.aspx for more information) |
See Also
IDocumentOperations Interface
Microsoft.Azure.Search Namespace
Return to top
IDocumentOperations.SuggestAsync Method (String, String, SuggestParameters, CancellationToken)
Suggests query terms based on input text and matching documents in the Azure Search index. (see https://msdn.microsoft.com/library/azure/dn798936.aspx for more information)
Syntax
Task<DocumentSuggestResponse> SuggestAsync(
string searchText,
string suggesterName,
SuggestParameters suggestParameters,
CancellationToken cancellationToken
)
Task<DocumentSuggestResponse^>^ SuggestAsync(
String^ searchText,
String^ suggesterName,
SuggestParameters^ suggestParameters,
CancellationToken cancellationToken
)
abstract SuggestAsync :
searchText:string *
suggesterName:string *
suggestParameters:SuggestParameters *
cancellationToken:CancellationToken -> Task<DocumentSuggestResponse>
Function SuggestAsync (
searchText As String,
suggesterName As String,
suggestParameters As SuggestParameters,
cancellationToken As CancellationToken
) As Task(Of DocumentSuggestResponse)
Parameters
searchText
Type: System.StringThe search text on which to base suggestions.
suggesterName
Type: System.StringThe name of the suggester as specified in the suggesters collection that's part of the index definition.
suggestParameters
Type: Microsoft.Azure.Search.Models.SuggestParametersParameters to further refine the suggestion query.
cancellationToken
Type: System.Threading.CancellationTokenCancellation token.
Return Value
Type: System.Threading.Tasks.Task<DocumentSuggestResponse>
Response containing the suggested text and documents matching the query.
Remarks
The non-generic overloads of the Suggest and SuggestAsync methods make a best-effort attempt to map JSON types in the response payload to .NET types. See GetAsync for more information.
Return to top
IDocumentOperations.SuggestAsync<T> Method (String, String, SuggestParameters, CancellationToken)
Suggests query terms based on input text and matching documents in the Azure Search index. (see https://msdn.microsoft.com/library/azure/dn798936.aspx for more information)
Syntax
Task<DocumentSuggestResponse<T>> SuggestAsync<T>(
string searchText,
string suggesterName,
SuggestParameters suggestParameters,
CancellationToken cancellationToken
)
where T : class
generic<typename T>
where T : ref class
Task<DocumentSuggestResponse<T>^>^ SuggestAsync(
String^ searchText,
String^ suggesterName,
SuggestParameters^ suggestParameters,
CancellationToken cancellationToken
)
abstract SuggestAsync<'T when 'T : not struct> :
searchText:string *
suggesterName:string *
suggestParameters:SuggestParameters *
cancellationToken:CancellationToken -> Task<DocumentSuggestResponse<'T>>
Function SuggestAsync(Of T As Class) (
searchText As String,
suggesterName As String,
suggestParameters As SuggestParameters,
cancellationToken As CancellationToken
) As Task(Of DocumentSuggestResponse(Of T))
Parameters
searchText
Type: System.StringThe search text on which to base suggestions.
suggesterName
Type: System.StringThe name of the suggester as specified in the suggesters collection that's part of the index definition.
suggestParameters
Type: Microsoft.Azure.Search.Models.SuggestParametersParameters to further refine the suggestion query.
cancellationToken
Type: System.Threading.CancellationTokenCancellation token.
Return Value
Type: System.Threading.Tasks.Task<DocumentSuggestResponse<T>>
Response containing the suggested text and documents matching the query.
Type Parameters
- T
The CLR type that maps to the index schema. Instances of this type can be retrieved as documents from the index.
Remarks
The generic overloads of the Suggest and SuggestAsync methods support mapping of Azure Search field types to .NET types via the type parameter T. See GetAsync<T> for more details on the type mapping.
Return to top
.jpeg)