You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2016/10/11 18:35:05 UTC

[20/47] lucenenet git commit: Fixed missing call to AddBinaryField that caused many Codecs.DiskDv tests to fail.

Fixed missing call to AddBinaryField that caused many Codecs.DiskDv tests to fail.


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

Branch: refs/heads/master
Commit: c4bd905f2ff600c412a4310b8d9d1ee2a579f7cd
Parents: 824ee5e
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Sun Oct 9 01:42:22 2016 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Tue Oct 11 00:26:21 2016 +0700

----------------------------------------------------------------------
 .../DiskDV/DiskDocValuesFormat.cs               | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c4bd905f/src/Lucene.Net.Codecs/DiskDV/DiskDocValuesFormat.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/DiskDV/DiskDocValuesFormat.cs b/src/Lucene.Net.Codecs/DiskDV/DiskDocValuesFormat.cs
index 75dd484..0448ef4 100644
--- a/src/Lucene.Net.Codecs/DiskDV/DiskDocValuesFormat.cs
+++ b/src/Lucene.Net.Codecs/DiskDV/DiskDocValuesFormat.cs
@@ -22,6 +22,8 @@ namespace Lucene.Net.Codecs.DiskDV
     using Lucene45;
     using Index;
     using System;
+    using Util;
+    using System.Collections.Generic;
 
     /// <summary>
     /// DocValues format that keeps most things on disk.
@@ -43,7 +45,23 @@ namespace Lucene.Net.Codecs.DiskDV
 
         public override DocValuesConsumer FieldsConsumer(SegmentWriteState state)
         {
-            return new Lucene45DocValuesConsumer(state, DATA_CODEC, DATA_EXTENSION, META_CODEC, META_EXTENSION);
+            return new Lucene45DocValuesConsumerAnonymousHelper(this, state);
+        }
+
+        private class Lucene45DocValuesConsumerAnonymousHelper : Lucene45DocValuesConsumer
+        {
+            private readonly DiskDocValuesFormat outerInstance;
+
+            public Lucene45DocValuesConsumerAnonymousHelper(DiskDocValuesFormat outerInstance, SegmentWriteState state)
+                : base(state, DATA_CODEC, DATA_EXTENSION, META_CODEC, META_EXTENSION)
+            {
+                this.outerInstance = outerInstance;
+            }
+
+            protected override void AddTermsDict(FieldInfo field, IEnumerable<BytesRef> values)
+            {
+                AddBinaryField(field, values);
+            }
         }
 
         public override DocValuesProducer FieldsProducer(SegmentReadState state)