Apache Solr open-source search software
LUCENE-8825: Improve CheckHits's Printing Capabilities
Atri Sharma965fd194d116
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txtindex b476b73652a..0f40170c5e6 100644--- a/lucene/CHANGES.txt+++ b/lucene/CHANGES.txt@@ -80,6 +80,11 @@ Improvements* LUCENE-8818: Fix smokeTestRelease.py encoding bug (janhoy)+Test Framework++* LUCENE-8825: CheckHits now display the shard index in case of mismatch+ between top hits. (Atri Sharma via Adrien Grand)+======================= Lucene 8.1.1 =======================(No Changes)diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/CheckHits.java b/lucene/test-framework/src/java/org/apache/lucene/search/CheckHits.javaindex b015e15a193..36a77fb2b7e 100644--- a/lucene/test-framework/src/java/org/apache/lucene/search/CheckHits.java+++ b/lucene/test-framework/src/java/org/apache/lucene/search/CheckHits.java@@ -232,14 +232,15 @@ public class CheckHits {for (int i=start; i<end; i++) {sb.append("hit=").append(i).append(':');if (i<len1) {- sb.append(" doc").append(hits1[i].doc).append('=').append(hits1[i].score);+ sb.append(" doc").append(hits1[i].doc).append('=').append(hits1[i].score).append(" shardIndex=").append(hits1[i].shardIndex);} else {sb.append(" ");}sb.append(",\t");if (i<len2) {- sb.append(" doc").append(hits2[i].doc).append('=').append(hits2[i].score);+ sb.append(" doc").append(hits2[i].doc).append('=').append(hits2[i].score).append(" shardIndex=").append(hits2[i].shardIndex);}+sb.append('\n');}return sb.toString();