Implemented interface member:
method
SearchAsync<TInput>
Microsoft.Extensions.VectorData.IVectorSearchable<TRecord>.SearchAsync<TInput>(TInput, System.Int32, Microsoft.Extensions.VectorData.VectorSearchOptions<TRecord>, System.Threading.CancellationToken)
1 override of SearchAsync
Microsoft.Extensions.VectorData.ConformanceTests (1)
DependencyInjectionTests.cs (1)
303public override IAsyncEnumerable<VectorSearchResult<TRecord>> SearchAsync<TInput>(
44 references to SearchAsync
Microsoft.Extensions.VectorData.Abstractions (2)
VectorSearchOptions.cs (2)
11/// Defines options for vector search via <see cref="VectorStoreCollection{TKey, TRecord}.SearchAsync{TInput}"/>. 26/// If this property isn't set provided, <see cref="VectorStoreCollection{TKey, TRecord}.SearchAsync{TInput}"/> checks if there is a vector property to use by default, and
Microsoft.Extensions.VectorData.ConformanceTests (42)
DistanceFunctionTests.cs (4)
106var results = await collection.SearchAsync(baseVector, top: 3).ToListAsync(); 129.SearchAsync( 141.SearchAsync(new ReadOnlyMemory<float>([1, 0, 0, 0]), top: 3) 147.SearchAsync(
EmbeddingGenerationTests.cs (17)
28var result = await collection.SearchAsync("[1, 1, 0]", top: 1).SingleAsync(); 39var result = await collection.SearchAsync("[1, 1, 0]", top: 1).SingleAsync(); 50var result = await collection.SearchAsync("[1, 1, 0]", top: 1).SingleAsync(); 61var result = await collection.SearchAsync("[1, 1, 0]", top: 1).SingleAsync(); 81var result = await collection.SearchAsync("[1, 1, 0]", top: 1).SingleAsync(); 101var result = await collection.SearchAsync("[1, 1, 0]", top: 1).SingleAsync(); 128var result = await collection.SearchAsync(new Customer(), top: 1).SingleAsync(); 141var result = await collection.SearchAsync("[1, 1, 1]", top: 1).SingleAsync(); 153var exception = await Assert.ThrowsAsync<NotSupportedException>(() => collection.SearchAsync("foo", top: 1).ToListAsync().AsTask()); 174var exception = await Assert.ThrowsAsync<InvalidOperationException>(() => collection.SearchAsync(8, top: 1).ToListAsync().AsTask()); 203var result = await collection.SearchAsync(new ReadOnlyMemory<float>([100, 1, 3]), top: 1).SingleAsync(); 227var result = await collection.SearchAsync(new ReadOnlyMemory<float>([200, 1, 3]), top: 1).SingleAsync(); 260var result = await collection.SearchAsync(new ReadOnlyMemory<float>([300, 1, 3]), top: 1).SingleAsync(); 263result = await collection.SearchAsync(new ReadOnlyMemory<float>([400, 1, 3]), top: 1).SingleAsync(); 296var result = await collection.SearchAsync(new ReadOnlyMemory<float>([500, 1, 3]), top: 1).SingleAsync(); 299result = await collection.SearchAsync(new ReadOnlyMemory<float>([600, 1, 3]), top: 1).SingleAsync(); 312var exception = await Assert.ThrowsAsync<NotSupportedException>(() => collection.SearchAsync("[1, 0, 0]", top: 1, new() { IncludeVectors = true }).ToListAsync().AsTask());
FilterTests.cs (3)
50async () => await fixture.DynamicCollection.SearchAsync( 512var actual = await fixture.Collection.SearchAsync( 532var dynamicActual = await fixture.DynamicCollection.SearchAsync(
IndexKindTests.cs (1)
49var result = await collection.SearchAsync(new ReadOnlyMemory<float>([10, 30, 50]), top: 1).SingleAsync();
ModelTests\BasicModelTests.cs (3)
424.SearchAsync( 437.SearchAsync( 450.SearchAsync(
ModelTests\DynamicModelTests.cs (3)
317.SearchAsync( 330.SearchAsync( 343.SearchAsync(
ModelTests\MultiVectorModelTests.cs (3)
59.SearchAsync(new ReadOnlyMemory<float>([1, 2, 3]), top: 1, new() { VectorProperty = r => r.Vector1, IncludeVectors = true }) 64.SearchAsync(new ReadOnlyMemory<float>([10, 2, 6]), top: 1, new() { VectorProperty = r => r.Vector2, IncludeVectors = true }) 73await Collection.SearchAsync(new ReadOnlyMemory<float>([1, 2, 3]), top: 1).ToListAsync());
Support\TestStore.cs (1)
144var results = collection.SearchAsync(
TypeTests\DataTypeTests.cs (4)
361var result = (await collection.SearchAsync(fixture.Vector, top: 100, new() { Filter = filter }).SingleAsync()).Record; 376result = (await collection.SearchAsync(fixture.Vector, top: 100, new() { Filter = filter }).SingleAsync()).Record; 402var result = (await dynamicCollection.SearchAsync(fixture.Vector, top: 100, new() { Filter = filter }).SingleAsync()).Record; 419result = (await dynamicCollection.SearchAsync(fixture.Vector, top: 100, new() { Filter = filter }).SingleAsync()).Record;
TypeTests\EmbeddingTypeTests.cs (3)
77var result2 = await collection.SearchAsync(value, top: 1, new() { IncludeVectors = true, Filter = r => r.Int == 42 }).SingleAsync(); 124var dynamicResult2 = await dynamicCollection.SearchAsync(value, top: 1, new() { IncludeVectors = true, Filter = r => (int)r["Int"]! == 43 }).SingleAsync(); 171var result4 = await collection2.SearchAsync("does not matter", top: 1, new() { Filter = r => r.Int == 44 }).SingleAsync();