Lucene.Net.Search.CheckHits.Hits2str C# (CSharp) Method

Hits2str() public static method

public static Hits2str ( Lucene.Net.Search.ScoreDoc hits1, Lucene.Net.Search.ScoreDoc hits2, int start, int end ) : string
hits1 Lucene.Net.Search.ScoreDoc
hits2 Lucene.Net.Search.ScoreDoc
start int
end int
return string
        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();
        }