lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [10/33] lucenenet git commit: Lucene.Net.Codecs.BlockTerms.FixedGapTermsIndexWriter: Reviewed and fixed some minor logic differences from Lucene
Date Fri, 17 Mar 2017 22:28:40 GMT
Lucene.Net.Codecs.BlockTerms.FixedGapTermsIndexWriter: Reviewed and fixed some minor logic
differences from Lucene


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

Branch: refs/heads/api-work
Commit: fb6580e2e736185c11b3ff4066be758cdc4a75ef
Parents: 6281c03
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Fri Mar 17 02:47:02 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Fri Mar 17 02:47:02 2017 +0700

----------------------------------------------------------------------
 .../BlockTerms/FixedGapTermsIndexWriter.cs          | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fb6580e2/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexWriter.cs b/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexWriter.cs
index 1e8fefb..c1731da 100644
--- a/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexWriter.cs
+++ b/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexWriter.cs
@@ -82,16 +82,17 @@ namespace Lucene.Net.Codecs.BlockTerms
 
         public override FieldWriter AddField(FieldInfo field, long termsFilePointer)
         {
-            var writer = new SimpleFieldWriter(this, field, termsFilePointer);
+            //System.out.println("FGW: addFfield=" + field.name);
+            SimpleFieldWriter writer = new SimpleFieldWriter(this, field, termsFilePointer);
             _fields.Add(writer);
             return writer;
         }
 
-        /// <remarks>
+        /// <summary>
         /// NOTE: if your codec does not sort in unicode code
         /// point order, you must override this method, to simply
-        /// return indexedTerm.length.
-        /// </remarks>
+        /// return indexedTerm.Length.
+        /// </summary>
         protected virtual int IndexedTermPrefixLength(BytesRef priorTerm, BytesRef indexedTerm)
         {
             // As long as codec sorts terms in unicode codepoint
@@ -147,12 +148,15 @@ namespace Lucene.Net.Codecs.BlockTerms
                 // First term is first indexed term:
                 //System.output.println("FGW: checkIndexTerm text=" + text.utf8ToString());
                 if (0 == (numTerms++ % outerInstance._termIndexInterval))
+                {
                     return true;
-
+                }
                 // save last term just before next index term so we
                 // can compute wasted suffix
-                if (0 == numTerms % outerInstance._termIndexInterval)
+                else if (0 == numTerms % outerInstance._termIndexInterval)
+                {
                     lastTerm.CopyBytes(text);
+                }
 
                 return false;
             }


Mime
View raw message