Fix test TestKnnByteVectorQuery.testToString (#13134)

Co-authored-by: Shubham Chaudhary <cshbha@amazon.com>
This commit is contained in:
Shubham Chaudhary 2024-02-26 13:01:49 +05:30 committed by GitHub
parent ca06693a16
commit 6eba1fb537
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -442,7 +442,7 @@ abstract class AbstractKnnVectorQuery extends Query {
@Override
public String toString(String field) {
return "DocAndScoreQuery[" + docs[0] + ",...][" + scores[0] + ",...]";
return "DocAndScoreQuery[" + docs[0] + ",...][" + scores[0] + ",...]," + maxScore;
}
@Override

View File

@ -842,8 +842,8 @@ abstract class BaseKnnVectorQueryTestCase extends LuceneTestCase {
// 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"));
}
/**