Skip to content

Commit

Permalink
Fix test TestKnnByteVectorQuery.testToString (apache#13134)
Browse files Browse the repository at this point in the history
Co-authored-by: Shubham Chaudhary <cshbha@amazon.com>
  • Loading branch information
shubhamvishu and Shubham Chaudhary authored Feb 26, 2024
1 parent ca06693 commit 6eba1fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ public boolean isCacheable(LeafReaderContext ctx) {

@Override
public String toString(String field) {
return "DocAndScoreQuery[" + docs[0] + ",...][" + scores[0] + ",...]";
return "DocAndScoreQuery[" + docs[0] + ",...][" + scores[0] + ",...]," + maxScore;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -842,8 +842,8 @@ void assertDocScoreQueryToString(Query query) {
// The string should contain matching docIds and their score.
// Since a forceMerge could occur in this test, we must not assert that a specific doc_id is
// matched
// But that instead the string format is expected and that the score is 1.0
assertTrue(queryString.matches("DocAndScoreQuery\\[\\d+,...]\\[1.0,...]"));
// But that instead the string format is expected and that the max score is 1.0
assertTrue(queryString.matches("DocAndScoreQuery\\[\\d+,...]\\[\\d+.\\d+,...],1.0"));
}

/**
Expand Down

0 comments on commit 6eba1fb

Please sign in to comment.