VectorStoreCollection<TKey,TRecord>.SearchAsync<TInput> 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
在向量存储中搜索类似于给定值的记录。
public abstract System.Collections.Generic.IAsyncEnumerable<Microsoft.Extensions.VectorData.VectorSearchResult<TRecord>> SearchAsync<TInput>(TInput searchValue, int top, Microsoft.Extensions.VectorData.VectorSearchOptions<TRecord>? options = default, System.Threading.CancellationToken cancellationToken = default);
abstract member SearchAsync : 'Input * int * Microsoft.Extensions.VectorData.VectorSearchOptions<'Record (requires 'Record : null)> * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<Microsoft.Extensions.VectorData.VectorSearchResult<'Record>>
Public MustOverride Function SearchAsync(Of TInput) (searchValue As TInput, top As Integer, Optional options As VectorSearchOptions(Of TRecord) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of VectorSearchResult(Of TRecord))
类型参数
- TInput
要对其执行相似性搜索的输入值的类型。
参数
- searchValue
- TInput
要对其执行相似性搜索的值。 有关更多详细信息,请参阅“备注”部分。
- top
- Int32
要返回的最大结果数。
- options
- VectorSearchOptions<TRecord>
控制搜索行为的选项。
- cancellationToken
- CancellationToken
要 CancellationToken 监视取消请求。 默认值为 None。
返回
IAsyncEnumerable<VectorSearchResult<TRecord>>
矢量搜索找到的记录,包括结果分数。