你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

IDocumentsOperations.SearchWithHttpMessagesAsync 方法

定义

重载

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

在搜索索引中搜索文档。 https://docs.microsoft.com/rest/api/searchservice/Search-Documents

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

在搜索索引中搜索文档。 https://docs.microsoft.com/rest/api/searchservice/Search-Documents

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

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)))

参数

searchText
String

全文搜索查询表达式;使用 null 或“*”匹配所有文档。 有关搜索查询语法的详细信息,请参阅 https://docs.microsoft.com/rest/api/searchservice/Simple-query-syntax-in-Azure-Search

searchParameters
SearchParameters

用于进一步优化搜索查询的参数。

searchRequestOptions
SearchRequestOptions

操作的其他参数

customHeaders
Dictionary<String,List<String>>

将添加到请求的标头。

cancellationToken
CancellationToken

取消标记。

返回

包含与查询匹配的文档的响应。

注解

Search、SearchAsync 和 SearchWithHttpMessagesAsync 方法的非泛型重载会尽力尝试将响应有效负载中的 JSON 类型映射到 .NET 类型。 有关详细信息,请参阅GetWithHttpMessagesAsync(String, IEnumerable<String>, SearchRequestOptions, Dictionary<String,List<String>>, CancellationToken)

如果Azure 认知搜索无法在单个响应中包含所有结果,则返回的响应将包含一个延续标记,该标记可传递给 ContinueSearch 以检索更多结果。 有关详细信息,请参阅DocumentSearchResult.ContinuationToken

适用于

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

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)))

类型参数

T

映射到索引架构的 CLR 类型。 可以从索引中以文档的形式检索此类型的实例。

参数

searchText
String

全文搜索查询表达式;使用 null 或“*”匹配所有文档。 有关搜索查询语法的详细信息,请参阅 https://docs.microsoft.com/rest/api/searchservice/Simple-query-syntax-in-Azure-Search

searchParameters
SearchParameters

用于进一步优化搜索查询的参数。

searchRequestOptions
SearchRequestOptions

操作的其他参数

customHeaders
Dictionary<String,List<String>>

将添加到请求的标头。

cancellationToken
CancellationToken

取消标记。

返回

包含与查询匹配的文档的响应。

注解

Search、SearchAsync 和 SearchWithHttpMessagesAsync 方法的泛型重载支持通过类型参数 T 将搜索字段类型映射到 .NET 类型。有关类型映射的更多详细信息,请参阅 GetWithHttpMessagesAsync<T>(String, IEnumerable<String>, SearchRequestOptions, Dictionary<String,List<String>>, CancellationToken)

如果Azure 认知搜索无法在单个响应中包含所有结果,则返回的响应将包含一个延续标记,该标记可传递给 ContinueSearch 以检索更多结果。 有关详细信息,请参阅DocumentSearchResult.ContinuationToken

适用于