Method SearchSimilarVectorsAsync
SearchSimilarVectorsAsync(string, float[], uint, bool, bool, CancellationToken)
Asynchronously searches for vectors within the specified collection that are similar to a given query vector.
Task<List<(PointEntry Point, float Score)>> SearchSimilarVectorsAsync(string collectionIdentifier, float[] vector, uint limit, bool getVector, bool getMetadata, CancellationToken cancellationToken = default)
Parameters
collectionIdentifierstringThe name of the collection to search within.
vectorfloat[]The query vector used to compute similarity against stored vectors. The length of this vector should match the collection's defined vector size.
limituintThe maximum number of similar vector entries to return.
getVectorboolIf
true, the vector data for each matching entry will be included in the results.getMetadataboolIf
true, the metadata for each matching entry will be included in the results.cancellationTokenCancellationTokenAn optional token to cancel the asynchronous search operation.
Returns
- Task<List<(PointEntry Point, float Score)>>
A task representing the asynchronous search operation. The task result is a list of tuples, where each tuple contains a PointEntry and a
floatsimilarity score. The similarity score is computed using the underlying vector similarity algorithm defined by the implementation.