Skip to content

Commit f18166d

Browse files
committed
add integration test
1 parent 450abf8 commit f18166d

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

tests/MongoDB.Driver.Tests/Search/AtlasSearchTests.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,23 @@ public void RankFusion()
734734
"Battle for the Planet of the Apes", "King Kong Lives", "Mighty Joe Young");
735735
}
736736

737+
[Fact]
738+
public void Rerank()
739+
{
740+
const int numDocsToRerank = 10;
741+
742+
var result = GetMoviesCollection<Movie>()
743+
.Aggregate()
744+
.Search(Builders<Movie>.Search.Text("plot", "apes"))
745+
.Rerank(RerankQuery.Text("a movie about intelligent apes who take over civilization"), "plot", numDocsToRerank, "rerank-2.5-lite")
746+
.Project<Movie>(Builders<Movie>.Projection
747+
.MetaScore(m => m.Score))
748+
.ToList();
749+
750+
result.Count.Should().BeGreaterThan(0).And.BeLessOrEqualTo(numDocsToRerank);
751+
result.Should().BeInDescendingOrder(m => m.Score);
752+
}
753+
737754
[Fact]
738755
public void SearchSequenceToken()
739756
{

0 commit comments

Comments
 (0)