public static string Hits2str(ScoreDoc[] hits1, ScoreDoc[] hits2, int start, int end)
{
StringBuilder sb = new StringBuilder();
int len1 = hits1 == null ? 0 : hits1.Length;
int len2 = hits2 == null ? 0 : hits2.Length;
if (end <= 0)
{
end = Math.Max(len1, len2);
}
sb.Append("Hits length1=").Append(len1).Append("\tlength2=").Append(len2);
sb.Append('\n');
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);
}
else
{
sb.Append(" ");
}
sb.Append(",\t");
if (i < len2)
{
sb.Append(" doc").Append(hits2[i].Doc).Append('=').Append(hits2[i].Score);
}
sb.Append('\n');
}
return sb.ToString();
}