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 logging
Date Sat, 23 May 2015 01:45:52 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/failingtests 9b1c1dc5d -> b10af1143


more logging


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

Branch: refs/heads/failingtests
Commit: b10af11434f013cd57a1276033aff7b515b7a2df
Parents: 9b1c1dc
Author: Laimonas Simutis <laimis@gmail.com>
Authored: Fri May 22 21:45:24 2015 -0400
Committer: Laimonas Simutis <laimis@gmail.com>
Committed: Fri May 22 21:45:24 2015 -0400

----------------------------------------------------------------------
 src/Lucene.Net.Core/Search/TermScorer.cs             | 15 ++++++++++++++-
 src/Lucene.Net.Tests/core/Search/TestTopDocsMerge.cs |  1 +
 2 files changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b10af114/src/Lucene.Net.Core/Search/TermScorer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/TermScorer.cs b/src/Lucene.Net.Core/Search/TermScorer.cs
index cd6633e..0796198 100644
--- a/src/Lucene.Net.Core/Search/TermScorer.cs
+++ b/src/Lucene.Net.Core/Search/TermScorer.cs
@@ -1,4 +1,5 @@
 using System.Diagnostics;
+using System.Text;
 
 namespace Lucene.Net.Search
 {
@@ -63,7 +64,9 @@ namespace Lucene.Net.Search
         /// <returns> the document matching the query or NO_MORE_DOCS if there are
no more documents. </returns>
         public override int NextDoc()
         {
-            return DocsEnum.NextDoc();
+            var docId = DocsEnum.NextDoc();
+            OutputCollector.Current.AppendLine(this.DocsEnum.GetType().ToString() + " - "
+ docId);
+            return docId;
         }
 
         public override float Score()
@@ -97,4 +100,14 @@ namespace Lucene.Net.Search
             return "scorer(" + weight + ")";
         }
     }
+
+    public class OutputCollector
+    {
+        public static StringBuilder Current;
+
+        public static void Init(StringBuilder instance)
+        {
+            Current = instance;
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b10af114/src/Lucene.Net.Tests/core/Search/TestTopDocsMerge.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestTopDocsMerge.cs b/src/Lucene.Net.Tests/core/Search/TestTopDocsMerge.cs
index 8e159c1..a41da69 100644
--- a/src/Lucene.Net.Tests/core/Search/TestTopDocsMerge.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestTopDocsMerge.cs
@@ -191,6 +191,7 @@ namespace Lucene.Net.Search
             for (int iter = 0; iter < 1000 * RANDOM_MULTIPLIER; iter++)
             {
                 var outputCollector = new StringBuilder();
+                OutputCollector.Init(outputCollector);
 
                 // TODO: custom FieldComp...
                 Query query = new TermQuery(new Term("text", tokens[Random().Next(tokens.Length)]));


Mime
View raw message