Skip to content

Commit

Permalink
Added test for range search
Browse files Browse the repository at this point in the history
Closes #60
  • Loading branch information
roji committed Mar 12, 2024
1 parent 053fa31 commit 7419e19
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Milvus.Client.Tests/SearchQueryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,29 @@ public async Task Search_with_offset()
Assert.Collection(results.Limits, l => Assert.Equal(2, l));
}

[Fact]
public async Task Search_with_range_search()
{
var results = await Collection.SearchAsync(
"float_vector",
new ReadOnlyMemory<float>[] { new[] { 0.1f, 0.2f } },
SimilarityMetricType.L2,
limit: 5,
new()
{
ExtraParameters =
{
{ "radius", "60" },
{ "range_filter", "10" }
}
});

Assert.Collection(
results.Ids.LongIds!.Order(),
id => Assert.Equal(2, id),
id => Assert.Equal(3, id));
}

[Fact]
public async Task Search_with_no_results()
{
Expand Down

0 comments on commit 7419e19

Please sign in to comment.