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)
303
public 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)
106
var 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)
28
var result = await collection.
SearchAsync
("[1, 1, 0]", top: 1).SingleAsync();
39
var result = await collection.
SearchAsync
("[1, 1, 0]", top: 1).SingleAsync();
50
var result = await collection.
SearchAsync
("[1, 1, 0]", top: 1).SingleAsync();
61
var result = await collection.
SearchAsync
("[1, 1, 0]", top: 1).SingleAsync();
81
var result = await collection.
SearchAsync
("[1, 1, 0]", top: 1).SingleAsync();
101
var result = await collection.
SearchAsync
("[1, 1, 0]", top: 1).SingleAsync();
128
var result = await collection.
SearchAsync
(new Customer(), top: 1).SingleAsync();
141
var result = await collection.
SearchAsync
("[1, 1, 1]", top: 1).SingleAsync();
153
var exception = await Assert.ThrowsAsync<NotSupportedException>(() => collection.
SearchAsync
("foo", top: 1).ToListAsync().AsTask());
174
var exception = await Assert.ThrowsAsync<InvalidOperationException>(() => collection.
SearchAsync
(8, top: 1).ToListAsync().AsTask());
203
var result = await collection.
SearchAsync
(new ReadOnlyMemory<float>([100, 1, 3]), top: 1).SingleAsync();
227
var result = await collection.
SearchAsync
(new ReadOnlyMemory<float>([200, 1, 3]), top: 1).SingleAsync();
260
var result = await collection.
SearchAsync
(new ReadOnlyMemory<float>([300, 1, 3]), top: 1).SingleAsync();
263
result = await collection.
SearchAsync
(new ReadOnlyMemory<float>([400, 1, 3]), top: 1).SingleAsync();
296
var result = await collection.
SearchAsync
(new ReadOnlyMemory<float>([500, 1, 3]), top: 1).SingleAsync();
299
result = await collection.
SearchAsync
(new ReadOnlyMemory<float>([600, 1, 3]), top: 1).SingleAsync();
312
var exception = await Assert.ThrowsAsync<NotSupportedException>(() => collection.
SearchAsync
("[1, 0, 0]", top: 1, new() { IncludeVectors = true }).ToListAsync().AsTask());
FilterTests.cs (3)
50
async () => await fixture.DynamicCollection.
SearchAsync
(
512
var actual = await fixture.Collection.
SearchAsync
(
532
var dynamicActual = await fixture.DynamicCollection.
SearchAsync
(
IndexKindTests.cs (1)
49
var 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 })
73
await Collection.
SearchAsync
(new ReadOnlyMemory<float>([1, 2, 3]), top: 1).ToListAsync());
Support\TestStore.cs (1)
144
var results = collection.
SearchAsync
(
TypeTests\DataTypeTests.cs (4)
361
var result = (await collection.
SearchAsync
(fixture.Vector, top: 100, new() { Filter = filter }).SingleAsync()).Record;
376
result = (await collection.
SearchAsync
(fixture.Vector, top: 100, new() { Filter = filter }).SingleAsync()).Record;
402
var result = (await dynamicCollection.
SearchAsync
(fixture.Vector, top: 100, new() { Filter = filter }).SingleAsync()).Record;
419
result = (await dynamicCollection.
SearchAsync
(fixture.Vector, top: 100, new() { Filter = filter }).SingleAsync()).Record;
TypeTests\EmbeddingTypeTests.cs (3)
77
var result2 = await collection.
SearchAsync
(value, top: 1, new() { IncludeVectors = true, Filter = r => r.Int == 42 }).SingleAsync();
124
var dynamicResult2 = await dynamicCollection.
SearchAsync
(value, top: 1, new() { IncludeVectors = true, Filter = r => (int)r["Int"]! == 43 }).SingleAsync();
171
var result4 = await collection2.
SearchAsync
("does not matter", top: 1, new() { Filter = r => r.Int == 44 }).SingleAsync();