lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lai...@apache.org
Subject lucenenet git commit: more output
Date Sat, 23 May 2015 14:30:01 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/failingtests b4406c746 -> 0af2d193b


more output


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/0af2d193
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/0af2d193
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/0af2d193

Branch: refs/heads/failingtests
Commit: 0af2d193b812f3169a50d3cf55edf6b69da79e3c
Parents: b4406c7
Author: Laimonas Simutis <laimis@gmail.com>
Authored: Sat May 23 10:29:45 2015 -0400
Committer: Laimonas Simutis <laimis@gmail.com>
Committed: Sat May 23 10:29:45 2015 -0400

----------------------------------------------------------------------
 src/Lucene.Net.Core/Search/HitQueue.cs         |  3 ---
 src/Lucene.Net.Core/Search/TopDocsCollector.cs | 20 +++++++++++++++++++-
 2 files changed, 19 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/0af2d193/src/Lucene.Net.Core/Search/HitQueue.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/HitQueue.cs b/src/Lucene.Net.Core/Search/HitQueue.cs
index 81aa3be..8bc2fb8 100644
--- a/src/Lucene.Net.Core/Search/HitQueue.cs
+++ b/src/Lucene.Net.Core/Search/HitQueue.cs
@@ -81,13 +81,10 @@ namespace Lucene.Net.Search
             if (hitA.Score == hitB.Score)
             {
                 result = hitA.Doc > hitB.Doc;
-                OutputCollector.AppendLine("Equal scrore, by doc " + hitA + " is less than
" + hitB + ": " + result);
-
             }
             else
             {
                 result = hitA.Score < hitB.Score;
-                OutputCollector.AppendLine("By scrore " + hitA + " is less than " + hitB
+ ": " + result);
             }
 
             return result;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/0af2d193/src/Lucene.Net.Core/Search/TopDocsCollector.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/TopDocsCollector.cs b/src/Lucene.Net.Core/Search/TopDocsCollector.cs
index 3b28e63..8636904 100644
--- a/src/Lucene.Net.Core/Search/TopDocsCollector.cs
+++ b/src/Lucene.Net.Core/Search/TopDocsCollector.cs
@@ -156,6 +156,14 @@ namespace Lucene.Net.Search
             // pq.size() or totalHits.
             int size = TopDocsSize();
 
+            var arr = Pq.ToArray();
+            OutputCollector.AppendLine("Preparing top docs, hits:");
+            foreach (var a in arr)
+            {
+                OutputCollector.AppendLine(a.ToString());
+            }
+            OutputCollector.AppendLine("---");
+
             // Don't bother to throw an exception, just return an empty TopDocs in case
             // the parameters are invalid or out of range.
             // TODO: shouldn't we throw IAE if apps give bad params here so they dont
@@ -174,14 +182,24 @@ namespace Lucene.Net.Search
             // Note that this loop will usually not be executed, since the common usage
             // should be that the caller asks for the last howMany results. However it's
             // needed here for completeness.
+            OutputCollector.AppendLine("Popping:");
             for (int i = Pq.Size() - start - howMany; i > 0; i--)
             {
-                Pq.Pop();
+                var popped = Pq.Pop();
+                OutputCollector.AppendLine(popped.ToString());
             }
+            OutputCollector.AppendLine("---");
 
             // Get the requested results from pq.
             PopulateResults(results, howMany);
 
+            OutputCollector.AppendLine("Results:");
+            foreach (var r in results)
+            {
+                OutputCollector.AppendLine(r.ToString());
+            }
+            OutputCollector.AppendLine("---");
+            
             return NewTopDocs(results, start);
         }
     }


Mime
View raw message