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/en-us/library/azure/dn798936.aspx for more information)

Namespace: Microsoft.Azure.Search
Assembly: Microsoft.Azure.Search (in Microsoft.Azure.Search.dll)

Usage

'Usage
Dim instance As IDocumentOperations
Dim searchText As String
Dim suggesterName As String
Dim suggestParameters As SuggestParameters
Dim cancellationToken As CancellationToken
Dim returnValue As Task(Of DocumentSuggestResponse)

returnValue = instance.SuggestAsync(searchText, suggesterName, suggestParameters, cancellationToken)

Syntax

'Declaration
Function SuggestAsync ( _
    searchText As String, _
    suggesterName As String, _
    suggestParameters As SuggestParameters, _
    cancellationToken As CancellationToken _
) As Task(Of DocumentSuggestResponse)
Task<DocumentSuggestResponse> SuggestAsync (
    string searchText,
    string suggesterName,
    SuggestParameters suggestParameters,
    CancellationToken cancellationToken
)
Task<DocumentSuggestResponse^>^ SuggestAsync (
    String^ searchText, 
    String^ suggesterName, 
    SuggestParameters^ suggestParameters, 
    CancellationToken cancellationToken
)
Task<DocumentSuggestResponse> SuggestAsync (
    String searchText, 
    String suggesterName, 
    SuggestParameters suggestParameters, 
    CancellationToken cancellationToken
)
function SuggestAsync (
    searchText : String, 
    suggesterName : String, 
    suggestParameters : SuggestParameters, 
    cancellationToken : CancellationToken
) : Task<DocumentSuggestResponse>

Parameters

  • searchText
    The search text on which to base suggestions.
  • suggestParameters
    Parameters to further refine the suggestion query.
  • suggesterName
    The name of the suggester as specified in the suggesters collection that's part of the index definition.
  • cancellationToken
    Cancellation token.

Return Value

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(String,Generic IEnumerable,CancellationToken) for more information.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows Vista, Windows 7, Windows Server 2008, Windows 8.1, Windows Server 2012 R2, Windows 8 and Windows Server 2012

Target Platforms

See Also

Reference

IDocumentOperations Interface
IDocumentOperations Members
Microsoft.Azure.Search Namespace