QdrantVectorDbClient.FindNearestInCollectionAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Find the nearest vectors in a collection using vector similarity search.
public System.Collections.Generic.IAsyncEnumerable<(Microsoft.SemanticKernel.Connectors.Qdrant.QdrantVectorRecord, double)> FindNearestInCollectionAsync (string collectionName, ReadOnlyMemory<float> target, double threshold, int top = 1, bool withVectors = false, System.Collections.Generic.IEnumerable<string>? requiredTags = default, System.Threading.CancellationToken cancellationToken = default);
abstract member FindNearestInCollectionAsync : string * ReadOnlyMemory<single> * double * int * bool * seq<string> * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<ValueTuple<Microsoft.SemanticKernel.Connectors.Qdrant.QdrantVectorRecord, double>>
override this.FindNearestInCollectionAsync : string * ReadOnlyMemory<single> * double * int * bool * seq<string> * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<ValueTuple<Microsoft.SemanticKernel.Connectors.Qdrant.QdrantVectorRecord, double>>
Public Function FindNearestInCollectionAsync (collectionName As String, target As ReadOnlyMemory(Of Single), threshold As Double, Optional top As Integer = 1, Optional withVectors As Boolean = false, Optional requiredTags As IEnumerable(Of String) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of ValueTuple(Of QdrantVectorRecord, Double))
Parameters
- collectionName
- String
The name assigned to a collection of vectors.
- target
- ReadOnlyMemory<Single>
The vector to compare the collection's vectors with.
- threshold
- Double
The minimum relevance threshold for returned results.
- top
- Int32
The maximum number of similarity results to return.
- withVectors
- Boolean
Whether to include the vector data in the returned results.
- requiredTags
- IEnumerable<String>
Qdrant tags used to filter the results.
- cancellationToken
- CancellationToken
The CancellationToken to monitor for cancellation requests. The default is None.