lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [2/2] lucenenet git commit: Various cleanups and API .NETification
Date Wed, 18 Feb 2015 05:29:46 GMT
Various cleanups and API .NETification


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

Branch: refs/heads/master
Commit: f26f7649b313d93dd935e8248ea2a837e46f30e5
Parents: 4b24d4c
Author: Itamar Syn-Hershko <itamar@code972.com>
Authored: Wed Feb 18 07:29:32 2015 +0200
Committer: Itamar Syn-Hershko <itamar@code972.com>
Committed: Wed Feb 18 07:29:32 2015 +0200

----------------------------------------------------------------------
 .../Analysis/NumericTokenStream.cs              |  5 --
 .../Codecs/Lucene3x/Lucene3xFields.cs           | 66 ++++++++++----------
 .../Codecs/Lucene3x/SegmentTermDocs.cs          |  4 +-
 .../Codecs/Lucene3x/TermBuffer.cs               |  4 +-
 .../Codecs/Lucene3x/TermInfosReader.cs          |  8 +--
 .../Codecs/Lucene3x/TermInfosReaderIndex.cs     | 15 ++---
 src/Lucene.Net.Core/Index/AtomicReader.cs       | 24 +++----
 src/Lucene.Net.Core/Index/BufferedUpdates.cs    |  2 +-
 .../Index/BufferedUpdatesStream.cs              | 16 ++---
 src/Lucene.Net.Core/Index/DocValuesUpdate.cs    |  4 +-
 .../Index/FreqProxTermsWriterPerField.cs        |  2 +-
 src/Lucene.Net.Core/Index/PrefixCodedTerms.cs   | 14 ++---
 src/Lucene.Net.Core/Index/Term.cs               | 45 ++++++-------
 src/Lucene.Net.Core/Index/TermContext.cs        |  4 +-
 src/Lucene.Net.Core/Search/AutomatonQuery.cs    |  6 +-
 src/Lucene.Net.Core/Search/FuzzyQuery.cs        | 28 ++++-----
 src/Lucene.Net.Core/Search/IndexSearcher.cs     |  2 +-
 src/Lucene.Net.Core/Search/MultiPhraseQuery.cs  | 40 ++++++------
 .../Search/Payloads/PayloadTermQuery.cs         |  8 ++-
 src/Lucene.Net.Core/Search/PhraseQuery.cs       | 10 +--
 src/Lucene.Net.Core/Search/PrefixQuery.cs       | 22 +++----
 src/Lucene.Net.Core/Search/RegexpQuery.cs       |  4 +-
 .../Search/Spans/SpanTermQuery.cs               | 14 ++---
 src/Lucene.Net.Core/Search/TermQuery.cs         | 28 ++++-----
 src/Lucene.Net.Queries/CommonTermsQuery.cs      |  6 +-
 src/Lucene.Net.Queries/TermFilter.cs            | 19 +++---
 src/Lucene.Net.Queries/TermsFilter.cs           |  4 +-
 .../Search/ShardSearchingTestBase.cs            |  2 +-
 .../Taxonomy/TestTaxonomyFacetCounts2.cs        |  2 +-
 .../core/Codecs/Lucene3x/TestSurrogates.cs      | 42 ++++++-------
 .../core/Index/TestAddIndexes.cs                |  2 +-
 .../core/Index/TestDirectoryReader.cs           |  2 +-
 .../Index/TestDocumentsWriterDeleteQueue.cs     |  8 +--
 .../core/Index/TestIndexWriterExceptions.cs     |  2 +-
 .../core/Index/TestIndexWriterReader.cs         |  2 +-
 .../core/Index/TestMultiLevelSkipList.cs        |  2 +-
 src/Lucene.Net.Tests/core/Index/TestPayloads.cs |  8 +--
 .../core/Index/TestPerSegmentDeletes.cs         |  2 +-
 .../core/Index/TestSegmentTermDocs.cs           | 12 ++--
 .../core/Search/TestMinShouldMatch2.cs          |  2 +-
 .../core/Search/TestPrefixRandom.cs             |  8 +--
 .../core/Search/TestRegexpRandom2.cs            | 17 +++--
 42 files changed, 250 insertions(+), 267 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Core/Analysis/NumericTokenStream.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Analysis/NumericTokenStream.cs b/src/Lucene.Net.Core/Analysis/NumericTokenStream.cs
index 189de93..99ce145 100644
--- a/src/Lucene.Net.Core/Analysis/NumericTokenStream.cs
+++ b/src/Lucene.Net.Core/Analysis/NumericTokenStream.cs
@@ -24,11 +24,6 @@ namespace Lucene.Net.Analysis
      * limitations under the License.
      */
 
-    // for javadocs
-    // for javadocs
-    // for javadocs
-    // for javadocs
-
     /// <summary>
     /// <b>Expert:</b> this class provides a <seealso cref="TokenStream"/>
     /// for indexing numeric values that can be used by {@link

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Core/Codecs/Lucene3x/Lucene3xFields.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/Lucene3x/Lucene3xFields.cs b/src/Lucene.Net.Core/Codecs/Lucene3x/Lucene3xFields.cs
index b87f12f..e2e4c6d 100644
--- a/src/Lucene.Net.Core/Codecs/Lucene3x/Lucene3xFields.cs
+++ b/src/Lucene.Net.Core/Codecs/Lucene3x/Lucene3xFields.cs
@@ -77,7 +77,7 @@ namespace Lucene.Net.Codecs.Lucene3x
             bool success = false;
             try
             {
-                TermInfosReader r = new TermInfosReader(dir, info.Name, fieldInfos, context, indexDivisor);
+                var r = new TermInfosReader(dir, info.Name, fieldInfos, context, indexDivisor);
                 if (indexDivisor == -1)
                 {
                     TisNoIndex = r;
@@ -371,7 +371,7 @@ namespace Lucene.Net.Codecs.Lucene3x
                 // Cannot be null (or move to next field) because at
                 // "worst" it'd seek to the same term we are on now,
                 // unless we are being called from seek
-                if (t2 == null || t2.Field() != InternedFieldName)
+                if (t2 == null || t2.Field != InternedFieldName)
                 {
                     return false;
                 }
@@ -383,7 +383,7 @@ namespace Lucene.Net.Codecs.Lucene3x
 
                 // Now test if prefix is identical and we found
                 // a non-BMP char at the same position:
-                BytesRef b2 = t2.Bytes();
+                BytesRef b2 = t2.Bytes;
                 Debug.Assert(b2.Offset == 0);
 
                 bool matches;
@@ -446,7 +446,7 @@ namespace Lucene.Net.Codecs.Lucene3x
                             OuterInstance.TermsDict.SeekEnum(TermEnum, SeekTermEnum.Term(), true);
                             //newSuffixStart = downTo+4;
                             NewSuffixStart = downTo;
-                            ScratchTerm.CopyBytes(TermEnum.Term().Bytes());
+                            ScratchTerm.CopyBytes(TermEnum.Term().Bytes);
                             didSeek = true;
                             if (DEBUG_SURROGATES)
                             {
@@ -510,14 +510,14 @@ namespace Lucene.Net.Codecs.Lucene3x
 
                     // We could hit EOF or different field since this
                     // was a seek "forward":
-                    if (t2 != null && t2.Field() == InternedFieldName)
+                    if (t2 != null && t2.Field == InternedFieldName)
                     {
                         if (DEBUG_SURROGATES)
                         {
-                            Console.WriteLine("      got term=" + UnicodeUtil.ToHexString(t2.Text()) + " " + t2.Bytes());
+                            Console.WriteLine("      got term=" + UnicodeUtil.ToHexString(t2.Text()) + " " + t2.Bytes);
                         }
 
-                        BytesRef b2 = t2.Bytes();
+                        BytesRef b2 = t2.Bytes;
                         Debug.Assert(b2.Offset == 0);
 
                         // Set newSuffixStart -- we can't use
@@ -599,13 +599,13 @@ namespace Lucene.Net.Codecs.Lucene3x
                 // current term.
 
                 // TODO: can we avoid this copy?
-                if (TermEnum.Term() == null || TermEnum.Term().Field() != InternedFieldName)
+                if (TermEnum.Term() == null || TermEnum.Term().Field != InternedFieldName)
                 {
                     ScratchTerm.Length = 0;
                 }
                 else
                 {
-                    ScratchTerm.CopyBytes(TermEnum.Term().Bytes());
+                    ScratchTerm.CopyBytes(TermEnum.Term().Bytes);
                 }
 
                 if (DEBUG_SURROGATES)
@@ -710,7 +710,7 @@ namespace Lucene.Net.Codecs.Lucene3x
                             }
                             else
                             {
-                                Console.WriteLine("      hit term=" + UnicodeUtil.ToHexString(t2.Text()) + " " + (t2 == null ? null : t2.Bytes()));
+                                Console.WriteLine("      hit term=" + UnicodeUtil.ToHexString(t2.Text()) + " " + (t2 == null ? null : t2.Bytes));
                             }
                         }
 
@@ -718,9 +718,9 @@ namespace Lucene.Net.Codecs.Lucene3x
                         // EOF or a different field:
                         bool matches;
 
-                        if (t2 != null && t2.Field() == InternedFieldName)
+                        if (t2 != null && t2.Field == InternedFieldName)
                         {
-                            BytesRef b2 = t2.Bytes();
+                            BytesRef b2 = t2.Bytes;
                             Debug.Assert(b2.Offset == 0);
                             if (b2.Length >= upTo + 3 && IsHighBMPChar(b2.Bytes, upTo))
                             {
@@ -755,7 +755,7 @@ namespace Lucene.Net.Codecs.Lucene3x
                             // TODO: more efficient seek?
                             OuterInstance.TermsDict.SeekEnum(TermEnum, SeekTermEnum.Term(), true);
 
-                            ScratchTerm.CopyBytes(SeekTermEnum.Term().Bytes());
+                            ScratchTerm.CopyBytes(SeekTermEnum.Term().Bytes);
 
                             // +3 because we don't need to check the char
                             // at upTo: we know it's > BMP
@@ -802,7 +802,7 @@ namespace Lucene.Net.Codecs.Lucene3x
                 UnicodeSortOrder = OuterInstance.SortTermsByUnicode();
 
                 Term t = TermEnum.Term();
-                if (t != null && t.Field() == InternedFieldName)
+                if (t != null && t.Field == InternedFieldName)
                 {
                     NewSuffixStart = 0;
                     PrevTerm.Length = 0;
@@ -853,7 +853,7 @@ namespace Lucene.Net.Codecs.Lucene3x
 
                 Term t = TermEnum.Term();
 
-                if (t != null && t.Field() == InternedFieldName && term.BytesEquals(t.Bytes()))
+                if (t != null && t.Field == InternedFieldName && term.BytesEquals(t.Bytes))
                 {
                     // If we found an exact match, no need to do the
                     // surrogate dance
@@ -861,10 +861,10 @@ namespace Lucene.Net.Codecs.Lucene3x
                     {
                         Console.WriteLine("  seek exact match");
                     }
-                    Current = t.Bytes();
+                    Current = t.Bytes;
                     return SeekStatus.FOUND;
                 }
-                else if (t == null || t.Field() != InternedFieldName)
+                else if (t == null || t.Field != InternedFieldName)
                 {
                     // TODO: maybe we can handle this like the next()
                     // into null?  set term as prevTerm then dance?
@@ -891,7 +891,7 @@ namespace Lucene.Net.Codecs.Lucene3x
 
                             if (SeekToNonBMP(SeekTermEnum, ScratchTerm, i))
                             {
-                                ScratchTerm.CopyBytes(SeekTermEnum.Term().Bytes());
+                                ScratchTerm.CopyBytes(SeekTermEnum.Term().Bytes);
                                 OuterInstance.TermsDict.SeekEnum(TermEnum, SeekTermEnum.Term(), false);
 
                                 NewSuffixStart = 1 + i;
@@ -900,7 +900,7 @@ namespace Lucene.Net.Codecs.Lucene3x
 
                                 // Found a match
                                 // TODO: faster seek?
-                                Current = TermEnum.Term().Bytes();
+                                Current = TermEnum.Term().Bytes;
                                 return SeekStatus.NOT_FOUND;
                             }
                         }
@@ -926,7 +926,7 @@ namespace Lucene.Net.Codecs.Lucene3x
                         Console.WriteLine("  seek hit non-exact term=" + UnicodeUtil.ToHexString(t.Text()));
                     }
 
-                    BytesRef br = t.Bytes();
+                    BytesRef br = t.Bytes;
                     Debug.Assert(br.Offset == 0);
 
                     SetNewSuffixStart(term, br);
@@ -934,16 +934,16 @@ namespace Lucene.Net.Codecs.Lucene3x
                     SurrogateDance();
 
                     Term t2 = TermEnum.Term();
-                    if (t2 == null || t2.Field() != InternedFieldName)
+                    if (t2 == null || t2.Field != InternedFieldName)
                     {
                         // PreFlex codec interns field names; verify:
-                        Debug.Assert(t2 == null || !t2.Field().Equals(InternedFieldName));
+                        Debug.Assert(t2 == null || !t2.Field.Equals(InternedFieldName));
                         Current = null;
                         return SeekStatus.END;
                     }
                     else
                     {
-                        Current = t2.Bytes();
+                        Current = t2.Bytes;
                         Debug.Assert(!UnicodeSortOrder || term.CompareTo(Current) < 0, "term=" + UnicodeUtil.ToHexString(term.Utf8ToString()) + " vs current=" + UnicodeUtil.ToHexString(Current.Utf8ToString()));
                         return SeekStatus.NOT_FOUND;
                     }
@@ -995,20 +995,20 @@ namespace Lucene.Net.Codecs.Lucene3x
                         return null;
                         // PreFlex codec interns field names:
                     }
-                    else if (TermEnum.Term().Field() != InternedFieldName)
+                    else if (TermEnum.Term().Field != InternedFieldName)
                     {
                         return null;
                     }
                     else
                     {
-                        return Current = TermEnum.Term().Bytes();
+                        return Current = TermEnum.Term().Bytes;
                     }
                 }
 
                 // TODO: can we use STE's prevBuffer here?
-                PrevTerm.CopyBytes(TermEnum.Term().Bytes());
+                PrevTerm.CopyBytes(TermEnum.Term().Bytes);
 
-                if (TermEnum.Next() && TermEnum.Term().Field() == InternedFieldName)
+                if (TermEnum.Next() && TermEnum.Term().Field == InternedFieldName)
                 {
                     NewSuffixStart = TermEnum.NewSuffixStart;
                     if (DEBUG_SURROGATES)
@@ -1017,15 +1017,15 @@ namespace Lucene.Net.Codecs.Lucene3x
                     }
                     SurrogateDance();
                     Term t = TermEnum.Term();
-                    if (t == null || t.Field() != InternedFieldName)
+                    if (t == null || t.Field != InternedFieldName)
                     {
                         // PreFlex codec interns field names; verify:
-                        Debug.Assert(t == null || !t.Field().Equals(InternedFieldName));
+                        Debug.Assert(t == null || !t.Field.Equals(InternedFieldName));
                         Current = null;
                     }
                     else
                     {
-                        Current = t.Bytes();
+                        Current = t.Bytes;
                     }
                     return Current;
                 }
@@ -1042,15 +1042,15 @@ namespace Lucene.Net.Codecs.Lucene3x
                     SurrogateDance();
 
                     Term t = TermEnum.Term();
-                    if (t == null || t.Field() != InternedFieldName)
+                    if (t == null || t.Field != InternedFieldName)
                     {
                         // PreFlex codec interns field names; verify:
-                        Debug.Assert(t == null || !t.Field().Equals(InternedFieldName));
+                        Debug.Assert(t == null || !t.Field.Equals(InternedFieldName));
                         return null;
                     }
                     else
                     {
-                        Current = t.Bytes();
+                        Current = t.Bytes;
                         return Current;
                     }
                 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Core/Codecs/Lucene3x/SegmentTermDocs.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/Lucene3x/SegmentTermDocs.cs b/src/Lucene.Net.Core/Codecs/Lucene3x/SegmentTermDocs.cs
index 62a6ee9..5f3e303 100644
--- a/src/Lucene.Net.Core/Codecs/Lucene3x/SegmentTermDocs.cs
+++ b/src/Lucene.Net.Core/Codecs/Lucene3x/SegmentTermDocs.cs
@@ -102,9 +102,9 @@ namespace Lucene.Net.Codecs.Lucene3x
         internal virtual void Seek(TermInfo ti, Term term)
         {
             Count = 0;
-            FieldInfo fi = FieldInfos.FieldInfo(term.Field());
+            FieldInfo fi = FieldInfos.FieldInfo(term.Field);
             this.IndexOptions = (fi != null) ? fi.FieldIndexOptions : FieldInfo.IndexOptions.DOCS_AND_FREQS_AND_POSITIONS;
-            CurrentFieldStoresPayloads = (fi != null) ? fi.HasPayloads() : false;
+            CurrentFieldStoresPayloads = (fi != null) && fi.HasPayloads();
             if (ti == null)
             {
                 Df = 0;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Core/Codecs/Lucene3x/TermBuffer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/Lucene3x/TermBuffer.cs b/src/Lucene.Net.Core/Codecs/Lucene3x/TermBuffer.cs
index c8644f8..befd6bf 100644
--- a/src/Lucene.Net.Core/Codecs/Lucene3x/TermBuffer.cs
+++ b/src/Lucene.Net.Core/Codecs/Lucene3x/TermBuffer.cs
@@ -101,8 +101,8 @@ namespace Lucene.Net.Codecs.Lucene3x
                 Reset();
                 return;
             }
-            Bytes.CopyBytes(term.Bytes());
-            Field = String.Intern(term.Field());
+            Bytes.CopyBytes(term.Bytes);
+            Field = String.Intern(term.Field);
             CurrentFieldNumber = -1;
             this.Term = term;
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Core/Codecs/Lucene3x/TermInfosReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/Lucene3x/TermInfosReader.cs b/src/Lucene.Net.Core/Codecs/Lucene3x/TermInfosReader.cs
index 52650b5..fba3a01 100644
--- a/src/Lucene.Net.Core/Codecs/Lucene3x/TermInfosReader.cs
+++ b/src/Lucene.Net.Core/Codecs/Lucene3x/TermInfosReader.cs
@@ -211,13 +211,13 @@ namespace Lucene.Net.Codecs.Lucene3x
 
         private int CompareAsUTF16(Term term1, Term term2)
         {
-            if (term1.Field().Equals(term2.Field()))
+            if (term1.Field.Equals(term2.Field))
             {
-                return LegacyComparator.Compare(term1.Bytes(), term2.Bytes());
+                return LegacyComparator.Compare(term1.Bytes, term2.Bytes);
             }
             else
             {
-                return term1.Field().CompareTo(term2.Field());
+                return term1.Field.CompareTo(term2.Field);
             }
         }
 
@@ -256,7 +256,7 @@ namespace Lucene.Net.Codecs.Lucene3x
 
         internal static Term DeepCopyOf(Term other)
         {
-            return new Term(other.Field(), BytesRef.DeepCopyOf(other.Bytes()));
+            return new Term(other.Field, BytesRef.DeepCopyOf(other.Bytes));
         }
 
         internal TermInfo SeekEnum(SegmentTermEnum enumerator, Term term, bool useCache)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Core/Codecs/Lucene3x/TermInfosReaderIndex.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/Lucene3x/TermInfosReaderIndex.cs b/src/Lucene.Net.Core/Codecs/Lucene3x/TermInfosReaderIndex.cs
index ae33667..7c70826 100644
--- a/src/Lucene.Net.Core/Codecs/Lucene3x/TermInfosReaderIndex.cs
+++ b/src/Lucene.Net.Core/Codecs/Lucene3x/TermInfosReaderIndex.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.IO;
 
 namespace Lucene.Net.Codecs.Lucene3x
 {
@@ -82,9 +83,9 @@ namespace Lucene.Net.Codecs.Lucene3x
             for (int i = 0; indexEnum.Next(); i++)
             {
                 Term term = indexEnum.Term();
-                if (currentField == null || !currentField.Equals(term.Field()))
+                if (currentField == null || !currentField.Equals(term.Field))
                 {
-                    currentField = term.Field();
+                    currentField = term.Field;
                     fieldStrs.Add(currentField);
                     fieldCounter++;
                 }
@@ -136,10 +137,10 @@ namespace Lucene.Net.Codecs.Lucene3x
             // read the term
             int fieldId = input.ReadVInt();
             Term field = Fields[fieldId];
-            Term term = new Term(field.Field(), input.ReadString());
+            Term term = new Term(field.Field, input.ReadString());
 
             // read the terminfo
-            TermInfo termInfo = new TermInfo();
+            var termInfo = new TermInfo();
             termInfo.DocFreq = input.ReadVInt();
             if (termInfo.DocFreq >= SkipInterval)
             {
@@ -205,7 +206,7 @@ namespace Lucene.Net.Codecs.Lucene3x
             // read the term
             int fieldId = input.ReadVInt();
             Term field = Fields[fieldId];
-            return new Term(field.Field(), input.ReadString());
+            return new Term(field.Field, input.ReadString());
         }
 
         /// <summary>
@@ -254,7 +255,7 @@ namespace Lucene.Net.Codecs.Lucene3x
                 reuse.Length = input.ReadVInt();
                 reuse.Grow(reuse.Length);
                 input.ReadBytes(reuse.Bytes, 0, reuse.Length);
-                return Comparator.Compare(term.Bytes(), reuse);
+                return Comparator.Compare(term.Bytes, reuse);
             }
             return c;
         }
@@ -273,7 +274,7 @@ namespace Lucene.Net.Codecs.Lucene3x
         private int CompareField(Term term, int termIndex, PagedBytesDataInput input)
         {
             input.Position = IndexToDataOffset.Get(termIndex);
-            return term.Field().CompareTo(Fields[input.ReadVInt()].Field());
+            return System.String.Compare(term.Field, Fields[input.ReadVInt()].Field, System.StringComparison.Ordinal);
         }
 
         internal virtual long RamBytesUsed()

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Core/Index/AtomicReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/AtomicReader.cs b/src/Lucene.Net.Core/Index/AtomicReader.cs
index a48a1bb..f88e280 100644
--- a/src/Lucene.Net.Core/Index/AtomicReader.cs
+++ b/src/Lucene.Net.Core/Index/AtomicReader.cs
@@ -114,13 +114,13 @@ namespace Lucene.Net.Index
             {
                 return 0;
             }
-            Terms terms = fields.Terms(term.Field());
+            Terms terms = fields.Terms(term.Field);
             if (terms == null)
             {
                 return 0;
             }
             TermsEnum termsEnum = terms.Iterator(null);
-            if (termsEnum.SeekExact(term.Bytes()))
+            if (termsEnum.SeekExact(term.Bytes))
             {
                 return termsEnum.DocFreq();
             }
@@ -144,13 +144,13 @@ namespace Lucene.Net.Index
             {
                 return 0;
             }
-            Terms terms = fields.Terms(term.Field());
+            Terms terms = fields.Terms(term.Field);
             if (terms == null)
             {
                 return 0;
             }
             TermsEnum termsEnum = terms.Iterator(null);
-            if (termsEnum.SeekExact(term.Bytes()))
+            if (termsEnum.SeekExact(term.Bytes))
             {
                 return termsEnum.TotalTermFreq();
             }
@@ -209,16 +209,16 @@ namespace Lucene.Net.Index
         ///  <seealso cref= TermsEnum#docs(Bits, DocsEnum)  </seealso>
         public DocsEnum TermDocsEnum(Term term)
         {
-            Debug.Assert(term.Field() != null);
-            Debug.Assert(term.Bytes() != null);
+            Debug.Assert(term.Field != null);
+            Debug.Assert(term.Bytes != null);
             Fields fields = Fields;
             if (fields != null)
             {
-                Terms terms = fields.Terms(term.Field());
+                Terms terms = fields.Terms(term.Field);
                 if (terms != null)
                 {
                     TermsEnum termsEnum = terms.Iterator(null);
-                    if (termsEnum.SeekExact(term.Bytes()))
+                    if (termsEnum.SeekExact(term.Bytes))
                     {
                         return termsEnum.Docs(LiveDocs, null);
                     }
@@ -234,16 +234,16 @@ namespace Lucene.Net.Index
         ///  <seealso cref= TermsEnum#docsAndPositions(Bits, DocsAndPositionsEnum)  </seealso>
         public DocsAndPositionsEnum TermPositionsEnum(Term term)
         {
-            Debug.Assert(term.Field() != null);
-            Debug.Assert(term.Bytes() != null);
+            Debug.Assert(term.Field != null);
+            Debug.Assert(term.Bytes != null);
             Fields fields = Fields;
             if (fields != null)
             {
-                Terms terms = fields.Terms(term.Field());
+                Terms terms = fields.Terms(term.Field);
                 if (terms != null)
                 {
                     TermsEnum termsEnum = terms.Iterator(null);
-                    if (termsEnum.SeekExact(term.Bytes()))
+                    if (termsEnum.SeekExact(term.Bytes))
                     {
                         return termsEnum.DocsAndPositions(LiveDocs, null);
                     }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Core/Index/BufferedUpdates.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/BufferedUpdates.cs b/src/Lucene.Net.Core/Index/BufferedUpdates.cs
index a043e87..295034c 100644
--- a/src/Lucene.Net.Core/Index/BufferedUpdates.cs
+++ b/src/Lucene.Net.Core/Index/BufferedUpdates.cs
@@ -241,7 +241,7 @@ namespace Lucene.Net.Index
             NumTermDeletes.IncrementAndGet();
             if (current == null)
             {
-                BytesUsed.AddAndGet(BYTES_PER_DEL_TERM + term.Bytes_Renamed.Length + (RamUsageEstimator.NUM_BYTES_CHAR * term.Field().Length));
+                BytesUsed.AddAndGet(BYTES_PER_DEL_TERM + term.Bytes.Length + (RamUsageEstimator.NUM_BYTES_CHAR * term.Field.Length));
             }
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Core/Index/BufferedUpdatesStream.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/BufferedUpdatesStream.cs b/src/Lucene.Net.Core/Index/BufferedUpdatesStream.cs
index dd32e73..5fd762f 100644
--- a/src/Lucene.Net.Core/Index/BufferedUpdatesStream.cs
+++ b/src/Lucene.Net.Core/Index/BufferedUpdatesStream.cs
@@ -481,10 +481,10 @@ namespace Lucene.Net.Index
                     // Since we visit terms sorted, we gain performance
                     // by re-using the same TermsEnum and seeking only
                     // forwards
-                    if (!term.Field().Equals(currentField))
+                    if (!string.Equals(term.Field, currentField, StringComparison.Ordinal))
                     {
-                        Debug.Assert(currentField == null || currentField.CompareTo(term.Field()) < 0);
-                        currentField = term.Field();
+                        Debug.Assert(currentField == null || currentField.CompareTo(term.Field) < 0);
+                        currentField = term.Field;
                         Terms terms = fields.Terms(currentField);
                         if (terms != null)
                         {
@@ -504,7 +504,7 @@ namespace Lucene.Net.Index
 
                     // System.out.println("  term=" + term);
 
-                    if (termsEnum.SeekExact(term.Bytes()))
+                    if (termsEnum.SeekExact(term.Bytes))
                     {
                         // we don't need term frequencies for this
                         DocsEnum docsEnum = termsEnum.Docs(rld.LiveDocs, docs, DocsEnum.FLAG_NONE);
@@ -585,11 +585,11 @@ namespace Lucene.Net.Index
                     // which will get same docIDUpto, yet will still need to respect the order
                     // those updates arrived.
 
-                    if (!term.Field().Equals(currentField))
+                    if (!string.Equals(term.Field, currentField, StringComparison.Ordinal))
                     {
                         // if we change the code to process updates in terms order, enable this assert
                         //        assert currentField == null || currentField.compareTo(term.field()) < 0;
-                        currentField = term.Field();
+                        currentField = term.Field;
                         Terms terms = fields.Terms(currentField);
                         if (terms != null)
                         {
@@ -608,7 +608,7 @@ namespace Lucene.Net.Index
                     }
                     // System.out.println("  term=" + term);
 
-                    if (termsEnum.SeekExact(term.Bytes()))
+                    if (termsEnum.SeekExact(term.Bytes))
                     {
                         // we don't need term frequencies for this
                         DocsEnum docsEnum = termsEnum.Docs(rld.LiveDocs, docs, DocsEnum.FLAG_NONE);
@@ -697,7 +697,7 @@ namespace Lucene.Net.Index
                 Debug.Assert(LastDeleteTerm == null || term.CompareTo(LastDeleteTerm) > 0, "lastTerm=" + LastDeleteTerm + " vs term=" + term);
             }
             // TODO: we re-use term now in our merged iterable, but we shouldn't clone, instead copy for this assert
-            LastDeleteTerm = term == null ? null : new Term(term.Field(), BytesRef.DeepCopyOf(term.Bytes_Renamed));
+            LastDeleteTerm = term == null ? null : new Term(term.Field, BytesRef.DeepCopyOf(term.Bytes));
             return true;
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Core/Index/DocValuesUpdate.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/DocValuesUpdate.cs b/src/Lucene.Net.Core/Index/DocValuesUpdate.cs
index 8ce9307..d5929fc 100644
--- a/src/Lucene.Net.Core/Index/DocValuesUpdate.cs
+++ b/src/Lucene.Net.Core/Index/DocValuesUpdate.cs
@@ -61,8 +61,8 @@ namespace Lucene.Net.Index
         internal int SizeInBytes()
         {
             int sizeInBytes = RAW_SIZE_IN_BYTES;
-            sizeInBytes += Term.Field_Renamed.Length * RamUsageEstimator.NUM_BYTES_CHAR;
-            sizeInBytes += Term.Bytes_Renamed.Bytes.Length;
+            sizeInBytes += Term.Field.Length * RamUsageEstimator.NUM_BYTES_CHAR;
+            sizeInBytes += Term.Bytes.Bytes.Length;
             sizeInBytes += Field.Length * RamUsageEstimator.NUM_BYTES_CHAR;
             sizeInBytes += (int)ValueSizeInBytes();
             return sizeInBytes;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Core/Index/FreqProxTermsWriterPerField.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/FreqProxTermsWriterPerField.cs b/src/Lucene.Net.Core/Index/FreqProxTermsWriterPerField.cs
index 42cf537..c86d76e 100644
--- a/src/Lucene.Net.Core/Index/FreqProxTermsWriterPerField.cs
+++ b/src/Lucene.Net.Core/Index/FreqProxTermsWriterPerField.cs
@@ -479,7 +479,7 @@ namespace Lucene.Net.Index
                 int? delDocLimit;
                 if (segDeletes != null)
                 {
-                    protoTerm.Bytes_Renamed = text;
+                    protoTerm.Bytes = text;
                     int? docIDUpto;
                     segDeletes.TryGetValue(protoTerm, out docIDUpto);
                     if (docIDUpto != null)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Core/Index/PrefixCodedTerms.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/PrefixCodedTerms.cs b/src/Lucene.Net.Core/Index/PrefixCodedTerms.cs
index 745a466..1676678 100644
--- a/src/Lucene.Net.Core/Index/PrefixCodedTerms.cs
+++ b/src/Lucene.Net.Core/Index/PrefixCodedTerms.cs
@@ -156,21 +156,21 @@ namespace Lucene.Net.Index
 
                 try
                 {
-                    int prefix = SharedPrefix(LastTerm.Bytes_Renamed, term.Bytes_Renamed);
-                    int suffix = term.Bytes_Renamed.Length - prefix;
-                    if (term.Field_Renamed.Equals(LastTerm.Field_Renamed))
+                    int prefix = SharedPrefix(LastTerm.Bytes, term.Bytes);
+                    int suffix = term.Bytes.Length - prefix;
+                    if (term.Field.Equals(LastTerm.Field))
                     {
                         Output.WriteVInt(prefix << 1);
                     }
                     else
                     {
                         Output.WriteVInt(prefix << 1 | 1);
-                        Output.WriteString(term.Field_Renamed);
+                        Output.WriteString(term.Field);
                     }
                     Output.WriteVInt(suffix);
-                    Output.WriteBytes(term.Bytes_Renamed.Bytes, term.Bytes_Renamed.Offset + prefix, suffix);
-                    LastTerm.Bytes_Renamed.CopyBytes(term.Bytes_Renamed);
-                    LastTerm.Field_Renamed = term.Field_Renamed;
+                    Output.WriteBytes(term.Bytes.Bytes, term.Bytes.Offset + prefix, suffix);
+                    LastTerm.Bytes.CopyBytes(term.Bytes);
+                    LastTerm.Field = term.Field;
                 }
                 catch (IOException e)
                 {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Core/Index/Term.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/Term.cs b/src/Lucene.Net.Core/Index/Term.cs
index cc9b1c5..58b90ee 100644
--- a/src/Lucene.Net.Core/Index/Term.cs
+++ b/src/Lucene.Net.Core/Index/Term.cs
@@ -32,9 +32,6 @@ namespace Lucene.Net.Index
 
     public sealed class Term : IComparable<Term>, IEquatable<Term>
     {
-        internal string Field_Renamed;
-        internal BytesRef Bytes_Renamed;
-
         /// <summary>
         /// Constructs a Term with the given field and bytes.
         /// <p>Note that a null field or null bytes value results in undefined
@@ -47,8 +44,8 @@ namespace Lucene.Net.Index
         /// </summary>
         public Term(string fld, BytesRef bytes)
         {
-            Field_Renamed = fld;
-            this.Bytes_Renamed = bytes;
+            Field = fld;
+            Bytes = bytes;
         }
 
         /// <summary>
@@ -76,10 +73,7 @@ namespace Lucene.Net.Index
         /// Returns the field of this term.   The field indicates
         ///  the part of a document which this term came from.
         /// </summary>
-        public string Field()
-        {
-            return Field_Renamed;
-        }
+        public string Field { get; internal set; }
 
         /// <summary>
         /// Returns the text of this term.  In the case of words, this is simply the
@@ -88,7 +82,7 @@ namespace Lucene.Net.Index
         /// </summary>
         public string Text()
         {
-            return ToString(Bytes_Renamed);
+            return ToString(Bytes);
         }
 
         /// <summary>
@@ -97,6 +91,7 @@ namespace Lucene.Net.Index
         /// </summary>
         public static string ToString(BytesRef termText)
         {
+            // LUCENENET TODO
             /*// the term might not be text, but usually is. so we make a best effort
             CharsetDecoder decoder = StandardCharsets.UTF_8.newDecoder().onMalformedInput(CodingErrorAction.REPORT).onUnmappableCharacter(CodingErrorAction.REPORT);
             try
@@ -119,11 +114,9 @@ namespace Lucene.Net.Index
         }
 
         /// <summary>
-        /// Returns the bytes of this term. </summary>
-        public BytesRef Bytes()
-        {
-            return Bytes_Renamed;
-        }
+        /// Returns the bytes of this term.
+        /// </summary>
+        public BytesRef Bytes { get; internal set; }
 
         public override bool Equals(object obj)
         {
@@ -135,8 +128,8 @@ namespace Lucene.Net.Index
         {
             const int prime = 31;
             int result = 1;
-            result = prime * result + ((Field_Renamed == null) ? 0 : Field_Renamed.GetHashCode());
-            result = prime * result + ((Bytes_Renamed == null) ? 0 : Bytes_Renamed.GetHashCode());
+            result = prime * result + ((Field == null) ? 0 : Field.GetHashCode());
+            result = prime * result + ((Bytes == null) ? 0 : Bytes.GetHashCode());
             return result;
         }
 
@@ -149,10 +142,10 @@ namespace Lucene.Net.Index
         /// </summary>
         public int CompareTo(Term other)
         {
-            int compare = string.Compare(Field_Renamed, other.Field_Renamed, StringComparison.Ordinal);
+            int compare = string.Compare(Field, other.Field, StringComparison.Ordinal);
             if (compare == 0)
             {
-                return Bytes_Renamed.CompareTo(other.Bytes_Renamed);
+                return Bytes.CompareTo(other.Bytes);
             }
             else
             {
@@ -169,8 +162,8 @@ namespace Lucene.Net.Index
         /// </summary>
         public void Set(string fld, BytesRef bytes)
         {
-            Field_Renamed = fld;
-            this.Bytes_Renamed = bytes;
+            Field = fld;
+            this.Bytes = bytes;
         }
 
         public bool Equals(Term other)
@@ -189,19 +182,19 @@ namespace Lucene.Net.Index
                 return false;
             }
 
-            if (string.Compare(this.Field_Renamed, other.Field_Renamed, StringComparison.Ordinal) != 0)
+            if (string.Compare(this.Field, other.Field, StringComparison.Ordinal) != 0)
             {
                 return false;
             }
 
-            if (Bytes_Renamed == null)
+            if (Bytes == null)
             {
-                if (other.Bytes_Renamed != null)
+                if (other.Bytes != null)
                 {
                     return false;
                 }
             }
-            else if (!Bytes_Renamed.Equals(other.Bytes_Renamed))
+            else if (!Bytes.Equals(other.Bytes))
             {
                 return false;
             }
@@ -211,7 +204,7 @@ namespace Lucene.Net.Index
 
         public override string ToString()
         {
-            return Field_Renamed + ":" + Text();
+            return Field + ":" + Text();
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Core/Index/TermContext.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/TermContext.cs b/src/Lucene.Net.Core/Index/TermContext.cs
index bb4b275..36ba770 100644
--- a/src/Lucene.Net.Core/Index/TermContext.cs
+++ b/src/Lucene.Net.Core/Index/TermContext.cs
@@ -90,8 +90,8 @@ namespace Lucene.Net.Index
         public static TermContext Build(IndexReaderContext context, Term term)
         {
             Debug.Assert(context != null && context.IsTopLevel);
-            string field = term.Field();
-            BytesRef bytes = term.Bytes();
+            string field = term.Field;
+            BytesRef bytes = term.Bytes;
             TermContext perReaderTermState = new TermContext(context);
             //if (DEBUG) System.out.println("prts.build term=" + term);
             foreach (AtomicReaderContext ctx in context.Leaves)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Core/Search/AutomatonQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/AutomatonQuery.cs b/src/Lucene.Net.Core/Search/AutomatonQuery.cs
index 415fd2f..d25b214 100644
--- a/src/Lucene.Net.Core/Search/AutomatonQuery.cs
+++ b/src/Lucene.Net.Core/Search/AutomatonQuery.cs
@@ -66,7 +66,7 @@ namespace Lucene.Net.Search
         /// <param name="automaton"> Automaton to run, terms that are accepted are considered a
         ///        match. </param>
         public AutomatonQuery(Term term, Automaton automaton)
-            : base(term.Field())
+            : base(term.Field)
         {
             this.Term = term;
             this.Automaton_Renamed = automaton;
@@ -123,9 +123,9 @@ namespace Lucene.Net.Search
         public override string ToString(string field)
         {
             StringBuilder buffer = new StringBuilder();
-            if (!Term.Field().Equals(field))
+            if (!Term.Field.Equals(field))
             {
-                buffer.Append(Term.Field());
+                buffer.Append(Term.Field);
                 buffer.Append(":");
             }
             buffer.Append(this.GetType().Name);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Core/Search/FuzzyQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/FuzzyQuery.cs b/src/Lucene.Net.Core/Search/FuzzyQuery.cs
index 24e00c4..11dfcff 100644
--- a/src/Lucene.Net.Core/Search/FuzzyQuery.cs
+++ b/src/Lucene.Net.Core/Search/FuzzyQuery.cs
@@ -65,7 +65,7 @@ namespace Lucene.Net.Search
         private readonly int MaxExpansions;
         private readonly bool Transpositions_Renamed;
         private readonly int PrefixLength_Renamed;
-        private readonly Term Term_Renamed;
+        private readonly Term _term;
 
         /// <summary>
         /// Create a new FuzzyQuery that will match terms with an edit distance
@@ -83,7 +83,7 @@ namespace Lucene.Net.Search
         ///        edit operation. If this is false, comparisons will implement the classic
         ///        Levenshtein algorithm. </param>
         public FuzzyQuery(Term term, int maxEdits, int prefixLength, int maxExpansions, bool transpositions)
-            : base(term.Field())
+            : base(term.Field)
         {
             if (maxEdits < 0 || maxEdits > LevenshteinAutomata.MAXIMUM_SUPPORTED_DISTANCE)
             {
@@ -98,7 +98,7 @@ namespace Lucene.Net.Search
                 throw new System.ArgumentException("maxExpansions cannot be negative.");
             }
 
-            this.Term_Renamed = term;
+            this._term = term;
             this.MaxEdits_Renamed = maxEdits;
             this.PrefixLength_Renamed = prefixLength;
             this.Transpositions_Renamed = transpositions;
@@ -167,9 +167,9 @@ namespace Lucene.Net.Search
 
         public override TermsEnum GetTermsEnum(Terms terms, AttributeSource atts)
         {
-            if (MaxEdits_Renamed == 0 || PrefixLength_Renamed >= Term_Renamed.Text().Length) // can only match if it's exact
+            if (MaxEdits_Renamed == 0 || PrefixLength_Renamed >= _term.Text().Length) // can only match if it's exact
             {
-                return new SingleTermsEnum(terms.Iterator(null), Term_Renamed.Bytes());
+                return new SingleTermsEnum(terms.Iterator(null), _term.Bytes);
             }
             return new FuzzyTermsEnum(terms, atts, Term, MaxEdits_Renamed, PrefixLength_Renamed, Transpositions_Renamed);
         }
@@ -181,19 +181,19 @@ namespace Lucene.Net.Search
         {
             get
             {
-                return Term_Renamed;
+                return _term;
             }
         }
 
         public override string ToString(string field)
         {
-            StringBuilder buffer = new StringBuilder();
-            if (!Term_Renamed.Field().Equals(field))
+            var buffer = new StringBuilder();
+            if (!_term.Field.Equals(field))
             {
-                buffer.Append(Term_Renamed.Field());
+                buffer.Append(_term.Field);
                 buffer.Append(":");
             }
-            buffer.Append(Term_Renamed.Text());
+            buffer.Append(_term.Text());
             buffer.Append('~');
             buffer.Append(Convert.ToString(MaxEdits_Renamed));
             buffer.Append(ToStringUtils.Boost(Boost));
@@ -208,7 +208,7 @@ namespace Lucene.Net.Search
             result = prime * result + PrefixLength_Renamed;
             result = prime * result + MaxExpansions;
             result = prime * result + (Transpositions_Renamed ? 0 : 1);
-            result = prime * result + ((Term_Renamed == null) ? 0 : Term_Renamed.GetHashCode());
+            result = prime * result + ((_term == null) ? 0 : _term.GetHashCode());
             return result;
         }
 
@@ -243,14 +243,14 @@ namespace Lucene.Net.Search
             {
                 return false;
             }
-            if (Term_Renamed == null)
+            if (_term == null)
             {
-                if (other.Term_Renamed != null)
+                if (other._term != null)
                 {
                     return false;
                 }
             }
-            else if (!Term_Renamed.Equals(other.Term_Renamed))
+            else if (!_term.Equals(other._term))
             {
                 return false;
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Core/Search/IndexSearcher.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/IndexSearcher.cs b/src/Lucene.Net.Core/Search/IndexSearcher.cs
index 973202b..9bb05a3 100644
--- a/src/Lucene.Net.Core/Search/IndexSearcher.cs
+++ b/src/Lucene.Net.Core/Search/IndexSearcher.cs
@@ -1000,7 +1000,7 @@ namespace Lucene.Net.Search
         /// </summary>
         public virtual TermStatistics TermStatistics(Term term, TermContext context)
         {
-            return new TermStatistics(term.Bytes(), context.DocFreq, context.TotalTermFreq());
+            return new TermStatistics(term.Bytes, context.DocFreq, context.TotalTermFreq());
         }
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Core/Search/MultiPhraseQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/MultiPhraseQuery.cs b/src/Lucene.Net.Core/Search/MultiPhraseQuery.cs
index 9946385..7f470e6 100644
--- a/src/Lucene.Net.Core/Search/MultiPhraseQuery.cs
+++ b/src/Lucene.Net.Core/Search/MultiPhraseQuery.cs
@@ -111,12 +111,12 @@ namespace Lucene.Net.Search
         {
             if (termArrays.Count == 0)
             {
-                Field = terms[0].Field();
+                Field = terms[0].Field;
             }
 
-            for (int i = 0; i < terms.Length; i++)
+            for (var i = 0; i < terms.Length; i++)
             {
-                if (!terms[i].Field().Equals(Field))
+                if (!terms[i].Field.Equals(Field))
                 {
                     throw new System.ArgumentException("All phrase terms must be in the same field (" + Field + "): " + terms[i]);
                 }
@@ -145,7 +145,7 @@ namespace Lucene.Net.Search
         {
             get
             {
-                int[] result = new int[positions.Count];
+                var result = new int[positions.Count];
                 for (int i = 0; i < positions.Count; i++)
                 {
                     result[i] = (int)positions[i];
@@ -170,9 +170,9 @@ namespace Lucene.Net.Search
         {
             private readonly MultiPhraseQuery OuterInstance;
 
-            internal readonly Similarity Similarity;
-            internal readonly Similarity.SimWeight Stats;
-            internal readonly IDictionary<Term, TermContext> TermContexts = new Dictionary<Term, TermContext>();
+            private readonly Similarity Similarity;
+            private readonly Similarity.SimWeight Stats;
+            private readonly IDictionary<Term, TermContext> TermContexts = new Dictionary<Term, TermContext>();
 
             public MultiPhraseWeight(MultiPhraseQuery outerInstance, IndexSearcher searcher)
             {
@@ -181,7 +181,7 @@ namespace Lucene.Net.Search
                 IndexReaderContext context = searcher.TopReaderContext;
 
                 // compute idf
-                List<TermStatistics> allTermStats = new List<TermStatistics>();
+                var allTermStats = new List<TermStatistics>();
                 foreach (Term[] terms in outerInstance.termArrays)
                 {
                     foreach (Term term in terms)
@@ -260,7 +260,7 @@ namespace Lucene.Net.Search
                                 // Term not in reader
                                 continue;
                             }
-                            termsEnum.SeekExact(term.Bytes(), termState);
+                            termsEnum.SeekExact(term.Bytes, termState);
                             docFreq += termsEnum.DocFreq();
                         }
 
@@ -279,14 +279,14 @@ namespace Lucene.Net.Search
                             // Term not in reader
                             return null;
                         }
-                        termsEnum.SeekExact(term.Bytes(), termState);
+                        termsEnum.SeekExact(term.Bytes, termState);
                         postingsEnum = termsEnum.DocsAndPositions(liveDocs, null, DocsEnum.FLAG_NONE);
 
                         if (postingsEnum == null)
                         {
                             // term does exist, but has no positions
                             Debug.Assert(termsEnum.Docs(liveDocs, null, DocsEnum.FLAG_NONE) != null, "termstate found but no term exists in reader");
-                            throw new InvalidOperationException("field \"" + term.Field() + "\" was indexed without position data; cannot run PhraseQuery (term=" + term.Text() + ")");
+                            throw new InvalidOperationException("field \"" + term.Field + "\" was indexed without position data; cannot run PhraseQuery (term=" + term.Text() + ")");
                         }
 
                         docFreq = termsEnum.DocFreq();
@@ -575,9 +575,9 @@ namespace Lucene.Net.Search
                 return (_lastIndex - _index);
             }
 
-            internal void GrowArray()
+            private void GrowArray()
             {
-                int[] newArray = new int[_arraySize * 2];
+                var newArray = new int[_arraySize * 2];
                 Array.Copy(_array, 0, newArray, 0, _arraySize);
                 _array = newArray;
                 _arraySize *= 2;
@@ -586,9 +586,9 @@ namespace Lucene.Net.Search
 
         private int _doc;
         private int _freq;
-        private DocsQueue _queue;
-        private IntQueue _posList;
-        private long Cost_Renamed;
+        private readonly DocsQueue _queue;
+        private readonly IntQueue _posList;
+        private readonly long _cost;
 
         public UnionDocsAndPositionsEnum(Bits liveDocs, AtomicReaderContext context, Term[] terms, IDictionary<Term, TermContext> termContexts, TermsEnum termsEnum)
         {
@@ -602,14 +602,14 @@ namespace Lucene.Net.Search
                     // Term doesn't exist in reader
                     continue;
                 }
-                termsEnum.SeekExact(term.Bytes(), termState);
+                termsEnum.SeekExact(term.Bytes, termState);
                 DocsAndPositionsEnum postings = termsEnum.DocsAndPositions(liveDocs, null, DocsEnum.FLAG_NONE);
                 if (postings == null)
                 {
                     // term does exist, but has no positions
-                    throw new InvalidOperationException("field \"" + term.Field() + "\" was indexed without position data; cannot run PhraseQuery (term=" + term.Text() + ")");
+                    throw new InvalidOperationException("field \"" + term.Field + "\" was indexed without position data; cannot run PhraseQuery (term=" + term.Text() + ")");
                 }
-                Cost_Renamed += postings.Cost();
+                _cost += postings.Cost();
                 docsEnums.Add(postings);
             }
 
@@ -706,7 +706,7 @@ namespace Lucene.Net.Search
 
         public override long Cost()
         {
-            return Cost_Renamed;
+            return _cost;
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Core/Search/Payloads/PayloadTermQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/Payloads/PayloadTermQuery.cs b/src/Lucene.Net.Core/Search/Payloads/PayloadTermQuery.cs
index 8dd443f..2569e97 100644
--- a/src/Lucene.Net.Core/Search/Payloads/PayloadTermQuery.cs
+++ b/src/Lucene.Net.Core/Search/Payloads/PayloadTermQuery.cs
@@ -1,3 +1,5 @@
+using System.IO;
+
 namespace Lucene.Net.Search.Payloads
 {
     using Lucene.Net.Index;
@@ -130,11 +132,11 @@ namespace Lucene.Net.Search.Payloads
                         Payload = postings.Payload;
                         if (Payload != null)
                         {
-                            PayloadScore_Renamed = OuterInstance.OuterInstance.Function.CurrentScore(Doc, OuterInstance.OuterInstance.Term.Field(), Spans.Start(), Spans.End(), PayloadsSeen, PayloadScore_Renamed, DocScorer.ComputePayloadFactor(Doc, Spans.Start(), Spans.End(), Payload));
+                            PayloadScore_Renamed = OuterInstance.OuterInstance.Function.CurrentScore(Doc, OuterInstance.OuterInstance.Term.Field, Spans.Start(), Spans.End(), PayloadsSeen, PayloadScore_Renamed, DocScorer.ComputePayloadFactor(Doc, Spans.Start(), Spans.End(), Payload));
                         }
                         else
                         {
-                            PayloadScore_Renamed = OuterInstance.OuterInstance.Function.CurrentScore(Doc, OuterInstance.OuterInstance.Term.Field(), Spans.Start(), Spans.End(), PayloadsSeen, PayloadScore_Renamed, 1F);
+                            PayloadScore_Renamed = OuterInstance.OuterInstance.Function.CurrentScore(Doc, OuterInstance.OuterInstance.Term.Field, Spans.Start(), Spans.End(), PayloadsSeen, PayloadScore_Renamed, 1F);
                         }
                         PayloadsSeen++;
                     }
@@ -178,7 +180,7 @@ namespace Lucene.Net.Search.Payloads
                 {
                     get
                     {
-                        return OuterInstance.OuterInstance.Function.DocScore(Doc, OuterInstance.OuterInstance.Term.Field(), PayloadsSeen, PayloadScore_Renamed);
+                        return OuterInstance.OuterInstance.Function.DocScore(Doc, OuterInstance.OuterInstance.Term.Field, PayloadsSeen, PayloadScore_Renamed);
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Core/Search/PhraseQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/PhraseQuery.cs b/src/Lucene.Net.Core/Search/PhraseQuery.cs
index de6a1c6..1c97b62 100644
--- a/src/Lucene.Net.Core/Search/PhraseQuery.cs
+++ b/src/Lucene.Net.Core/Search/PhraseQuery.cs
@@ -120,9 +120,9 @@ namespace Lucene.Net.Search
         {
             if (Terms_Renamed.Count == 0)
             {
-                Field = term.Field();
+                Field = term.Field;
             }
-            else if (!term.Field().Equals(Field))
+            else if (!term.Field.Equals(Field))
             {
                 throw new System.ArgumentException("All phrase terms must be in the same field: " + term);
             }
@@ -365,16 +365,16 @@ namespace Lucene.Net.Search
                         Debug.Assert(TermNotInReader(reader, t), "no termstate found but term exists in reader");
                         return null;
                     }
-                    te.SeekExact(t.Bytes(), state);
+                    te.SeekExact(t.Bytes, state);
                     DocsAndPositionsEnum postingsEnum = te.DocsAndPositions(liveDocs, null, DocsEnum.FLAG_NONE);
 
                     // PhraseQuery on a field that did not index
                     // positions.
                     if (postingsEnum == null)
                     {
-                        Debug.Assert(te.SeekExact(t.Bytes()), "termstate found but no term exists in reader");
+                        Debug.Assert(te.SeekExact(t.Bytes), "termstate found but no term exists in reader");
                         // term does exist, but has no positions
-                        throw new InvalidOperationException("field \"" + t.Field() + "\" was indexed without position data; cannot run PhraseQuery (term=" + t.Text() + ")");
+                        throw new InvalidOperationException("field \"" + t.Field + "\" was indexed without position data; cannot run PhraseQuery (term=" + t.Text() + ")");
                     }
                     postingsFreqs[i] = new PostingsAndFreq(postingsEnum, te.DocFreq(), (int)OuterInstance.Positions_Renamed[i], t);
                 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Core/Search/PrefixQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/PrefixQuery.cs b/src/Lucene.Net.Core/Search/PrefixQuery.cs
index 5eb072b..1c00cc8 100644
--- a/src/Lucene.Net.Core/Search/PrefixQuery.cs
+++ b/src/Lucene.Net.Core/Search/PrefixQuery.cs
@@ -36,14 +36,14 @@ namespace Lucene.Net.Search
     /// </summary>
     public class PrefixQuery : MultiTermQuery
     {
-        private Term Prefix_Renamed;
+        private readonly Term _prefix;
 
         /// <summary>
         /// Constructs a query for terms starting with <code>prefix</code>. </summary>
         public PrefixQuery(Term prefix)
-            : base(prefix.Field())
+            : base(prefix.Field)
         {
-            this.Prefix_Renamed = prefix;
+            this._prefix = prefix;
         }
 
         /// <summary>
@@ -52,7 +52,7 @@ namespace Lucene.Net.Search
         {
             get
             {
-                return Prefix_Renamed;
+                return _prefix;
             }
         }
 
@@ -60,12 +60,12 @@ namespace Lucene.Net.Search
         {
             TermsEnum tenum = terms.Iterator(null);
 
-            if (Prefix_Renamed.Bytes().Length == 0)
+            if (_prefix.Bytes.Length == 0)
             {
                 // no prefix -- match all terms for this field:
                 return tenum;
             }
-            return new PrefixTermsEnum(tenum, Prefix_Renamed.Bytes());
+            return new PrefixTermsEnum(tenum, _prefix.Bytes);
         }
 
         /// <summary>
@@ -78,7 +78,7 @@ namespace Lucene.Net.Search
                 buffer.Append(Field);
                 buffer.Append(":");
             }
-            buffer.Append(Prefix_Renamed.Text());
+            buffer.Append(_prefix.Text());
             buffer.Append('*');
             buffer.Append(ToStringUtils.Boost(Boost));
             return buffer.ToString();
@@ -88,7 +88,7 @@ namespace Lucene.Net.Search
         {
             const int prime = 31;
             int result = base.GetHashCode();
-            result = prime * result + ((Prefix_Renamed == null) ? 0 : Prefix_Renamed.GetHashCode());
+            result = prime * result + ((_prefix == null) ? 0 : _prefix.GetHashCode());
             return result;
         }
 
@@ -107,14 +107,14 @@ namespace Lucene.Net.Search
                 return false;
             }
             PrefixQuery other = (PrefixQuery)obj;
-            if (Prefix_Renamed == null)
+            if (_prefix == null)
             {
-                if (other.Prefix_Renamed != null)
+                if (other._prefix != null)
                 {
                     return false;
                 }
             }
-            else if (!Prefix_Renamed.Equals(other.Prefix_Renamed))
+            else if (!_prefix.Equals(other._prefix))
             {
                 return false;
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Core/Search/RegexpQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/RegexpQuery.cs b/src/Lucene.Net.Core/Search/RegexpQuery.cs
index 9051aea..596fdfb 100644
--- a/src/Lucene.Net.Core/Search/RegexpQuery.cs
+++ b/src/Lucene.Net.Core/Search/RegexpQuery.cs
@@ -103,9 +103,9 @@ namespace Lucene.Net.Search
         public override string ToString(string field)
         {
             StringBuilder buffer = new StringBuilder();
-            if (!Term.Field().Equals(field))
+            if (!Term.Field.Equals(field))
             {
-                buffer.Append(Term.Field());
+                buffer.Append(Term.Field);
                 buffer.Append(":");
             }
             buffer.Append('/');

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Core/Search/Spans/SpanTermQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/Spans/SpanTermQuery.cs b/src/Lucene.Net.Core/Search/Spans/SpanTermQuery.cs
index e6e7567..bbd1291 100644
--- a/src/Lucene.Net.Core/Search/Spans/SpanTermQuery.cs
+++ b/src/Lucene.Net.Core/Search/Spans/SpanTermQuery.cs
@@ -60,7 +60,7 @@ namespace Lucene.Net.Search.Spans
         {
             get
             {
-                return term.Field();
+                return term.Field;
             }
         }
 
@@ -72,7 +72,7 @@ namespace Lucene.Net.Search.Spans
         public override string ToString(string field)
         {
             StringBuilder buffer = new StringBuilder();
-            if (term.Field().Equals(field))
+            if (term.Field.Equals(field))
             {
                 buffer.Append(term.Text());
             }
@@ -133,11 +133,11 @@ namespace Lucene.Net.Search.Spans
                 Fields fields = context.AtomicReader.Fields;
                 if (fields != null)
                 {
-                    Terms terms = fields.Terms(term.Field());
+                    Terms terms = fields.Terms(term.Field);
                     if (terms != null)
                     {
                         TermsEnum termsEnum = terms.Iterator(null);
-                        if (termsEnum.SeekExact(term.Bytes()))
+                        if (termsEnum.SeekExact(term.Bytes))
                         {
                             state = termsEnum.TermState();
                         }
@@ -166,8 +166,8 @@ namespace Lucene.Net.Search.Spans
                 return TermSpans.EMPTY_TERM_SPANS;
             }
 
-            TermsEnum termsEnum_ = context.AtomicReader.Terms(term.Field()).Iterator(null);
-            termsEnum_.SeekExact(term.Bytes(), state);
+            TermsEnum termsEnum_ = context.AtomicReader.Terms(term.Field).Iterator(null);
+            termsEnum_.SeekExact(term.Bytes, state);
 
             DocsAndPositionsEnum postings = termsEnum_.DocsAndPositions(acceptDocs, null, DocsAndPositionsEnum.FLAG_PAYLOADS);
 
@@ -178,7 +178,7 @@ namespace Lucene.Net.Search.Spans
             else
             {
                 // term does exist, but has no positions
-                throw new InvalidOperationException("field \"" + term.Field() + "\" was indexed without position data; cannot run SpanTermQuery (term=" + term.Text() + ")");
+                throw new InvalidOperationException("field \"" + term.Field + "\" was indexed without position data; cannot run SpanTermQuery (term=" + term.Text() + ")");
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Core/Search/TermQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/TermQuery.cs b/src/Lucene.Net.Core/Search/TermQuery.cs
index ff3f7fe..54439b2 100644
--- a/src/Lucene.Net.Core/Search/TermQuery.cs
+++ b/src/Lucene.Net.Core/Search/TermQuery.cs
@@ -43,7 +43,7 @@ namespace Lucene.Net.Search
     /// </summary>
     public class TermQuery : Query
     {
-        private readonly Term Term_Renamed;
+        private readonly Term _term;
         private readonly int DocFreq;
         private readonly TermContext PerReaderTermState;
 
@@ -61,7 +61,7 @@ namespace Lucene.Net.Search
                 Debug.Assert(termStates != null, "TermContext must not be null");
                 this.TermStates = termStates;
                 this.Similarity = searcher.Similarity;
-                this.Stats = Similarity.ComputeWeight(outerInstance.Boost, searcher.CollectionStatistics(outerInstance.Term_Renamed.Field()), searcher.TermStatistics(outerInstance.Term_Renamed, termStates));
+                this.Stats = Similarity.ComputeWeight(outerInstance.Boost, searcher.CollectionStatistics(outerInstance._term.Field), searcher.TermStatistics(outerInstance._term, termStates));
             }
 
             public override string ToString()
@@ -112,12 +112,12 @@ namespace Lucene.Net.Search
                 TermState state = TermStates.Get(context.Ord);
                 if (state == null) // term is not present in that reader
                 {
-                    Debug.Assert(TermNotInReader(context.AtomicReader, OuterInstance.Term_Renamed), "no termstate found but term exists in reader term=" + OuterInstance.Term_Renamed);
+                    Debug.Assert(TermNotInReader(context.AtomicReader, OuterInstance._term), "no termstate found but term exists in reader term=" + OuterInstance._term);
                     return null;
                 }
                 //System.out.println("LD=" + reader.getLiveDocs() + " set?=" + (reader.getLiveDocs() != null ? reader.getLiveDocs().get(0) : "null"));
-                TermsEnum termsEnum = context.AtomicReader.Terms(OuterInstance.Term_Renamed.Field()).Iterator(null);
-                termsEnum.SeekExact(OuterInstance.Term_Renamed.Bytes(), state);
+                TermsEnum termsEnum = context.AtomicReader.Terms(OuterInstance._term.Field).Iterator(null);
+                termsEnum.SeekExact(OuterInstance._term.Bytes, state);
                 return termsEnum;
             }
 
@@ -165,7 +165,7 @@ namespace Lucene.Net.Search
         /// </summary>
         public TermQuery(Term t, int docFreq)
         {
-            Term_Renamed = t;
+            _term = t;
             this.DocFreq = docFreq;
             PerReaderTermState = null;
         }
@@ -178,7 +178,7 @@ namespace Lucene.Net.Search
         public TermQuery(Term t, TermContext states)
         {
             Debug.Assert(states != null);
-            Term_Renamed = t;
+            _term = t;
             DocFreq = states.DocFreq;
             PerReaderTermState = states;
         }
@@ -189,7 +189,7 @@ namespace Lucene.Net.Search
         {
             get
             {
-                return Term_Renamed;
+                return _term;
             }
         }
 
@@ -200,7 +200,7 @@ namespace Lucene.Net.Search
             if (PerReaderTermState == null || PerReaderTermState.TopReaderContext != context)
             {
                 // make TermQuery single-pass if we don't have a PRTS or if the context differs!
-                termState = TermContext.Build(context, Term_Renamed);
+                termState = TermContext.Build(context, _term);
             }
             else
             {
@@ -227,12 +227,12 @@ namespace Lucene.Net.Search
         public override string ToString(string field)
         {
             StringBuilder buffer = new StringBuilder();
-            if (!Term_Renamed.Field().Equals(field))
+            if (!_term.Field.Equals(field))
             {
-                buffer.Append(Term_Renamed.Field());
+                buffer.Append(_term.Field);
                 buffer.Append(":");
             }
-            buffer.Append(Term_Renamed.Text());
+            buffer.Append(_term.Text());
             buffer.Append(ToStringUtils.Boost(Boost));
             return buffer.ToString();
         }
@@ -246,14 +246,14 @@ namespace Lucene.Net.Search
                 return false;
             }
             TermQuery other = (TermQuery)o;
-            return (this.Boost == other.Boost) && this.Term_Renamed.Equals(other.Term_Renamed);
+            return (this.Boost == other.Boost) && this._term.Equals(other._term);
         }
 
         /// <summary>
         /// Returns a hash code value for this object. </summary>
         public override int GetHashCode()
         {
-            return Number.FloatToIntBits(Boost) ^ Term_Renamed.GetHashCode();
+            return Number.FloatToIntBits(Boost) ^ _term.GetHashCode();
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Queries/CommonTermsQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/CommonTermsQuery.cs b/src/Lucene.Net.Queries/CommonTermsQuery.cs
index a085276..dae7292 100644
--- a/src/Lucene.Net.Queries/CommonTermsQuery.cs
+++ b/src/Lucene.Net.Queries/CommonTermsQuery.cs
@@ -265,9 +265,7 @@ namespace Lucene.Net.Queries
                 {
                     Term term = queryTerms[i];
                     TermContext termContext = contextArray[i];
-                    //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-                    //ORIGINAL LINE: final org.apache.lucene.index.Terms terms = fields.terms(term.field());
-                    Terms terms = fields.Terms(term.Field());
+                    Terms terms = fields.Terms(term.Field);
                     if (terms == null)
                     {
                         // field does not exist
@@ -280,7 +278,7 @@ namespace Lucene.Net.Queries
                     {
                         continue;
                     }
-                    if (termsEnum.SeekExact(term.Bytes()))
+                    if (termsEnum.SeekExact(term.Bytes))
                     {
                         if (termContext == null)
                         {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Queries/TermFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/TermFilter.cs b/src/Lucene.Net.Queries/TermFilter.cs
index d2580c7..35666cb 100644
--- a/src/Lucene.Net.Queries/TermFilter.cs
+++ b/src/Lucene.Net.Queries/TermFilter.cs
@@ -36,7 +36,7 @@ namespace Lucene.Net.Queries
             {
                 throw new System.ArgumentException("Term must not be null");
             }
-            else if (term.Field() == null)
+            else if (term.Field == null)
             {
                 throw new System.ArgumentException("Field must not be null");
             }
@@ -54,30 +54,27 @@ namespace Lucene.Net.Queries
 
         public override DocIdSet GetDocIdSet(AtomicReaderContext context, Bits acceptDocs)
         {
-            Terms terms = context.AtomicReader.Terms(term.Field());
+            Terms terms = context.AtomicReader.Terms(term.Field);
             if (terms == null)
             {
                 return null;
             }
 
             TermsEnum termsEnum = terms.Iterator(null);
-            if (!termsEnum.SeekExact(term.Bytes()))
+            if (!termsEnum.SeekExact(term.Bytes))
             {
                 return null;
             }
-            return new DocIdSetAnonymousInnerClassHelper(this, acceptDocs, termsEnum);
+            return new DocIdSetAnonymousInnerClassHelper(acceptDocs, termsEnum);
         }
 
         private class DocIdSetAnonymousInnerClassHelper : DocIdSet
         {
-            private readonly TermFilter outerInstance;
+            private readonly Bits acceptDocs;
+            private readonly TermsEnum termsEnum;
 
-            private Bits acceptDocs;
-            private TermsEnum termsEnum;
-
-            public DocIdSetAnonymousInnerClassHelper(TermFilter outerInstance, Bits acceptDocs, TermsEnum termsEnum)
+            public DocIdSetAnonymousInnerClassHelper(Bits acceptDocs, TermsEnum termsEnum)
             {
-                this.outerInstance = outerInstance;
                 this.acceptDocs = acceptDocs;
                 this.termsEnum = termsEnum;
             }
@@ -116,7 +113,7 @@ namespace Lucene.Net.Queries
 
         public override string ToString()
         {
-            return term.Field() + ":" + term.Text();
+            return term.Field + ":" + term.Text();
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Queries/TermsFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/TermsFilter.cs b/src/Lucene.Net.Queries/TermsFilter.cs
index 8355d58..dfe9449 100644
--- a/src/Lucene.Net.Queries/TermsFilter.cs
+++ b/src/Lucene.Net.Queries/TermsFilter.cs
@@ -79,8 +79,8 @@ namespace Lucene.Net.Queries
                 if (iter.MoveNext())
                 {
                     var next = iter.Current;
-                    field = next.Field();
-                    return next.Bytes();
+                    field = next.Field;
+                    return next.Bytes;
                 }
                 return null;
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.TestFramework/Search/ShardSearchingTestBase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Search/ShardSearchingTestBase.cs b/src/Lucene.Net.TestFramework/Search/ShardSearchingTestBase.cs
index b0a306c..a299a2b 100644
--- a/src/Lucene.Net.TestFramework/Search/ShardSearchingTestBase.cs
+++ b/src/Lucene.Net.TestFramework/Search/ShardSearchingTestBase.cs
@@ -343,7 +343,7 @@ namespace Lucene.Net.Search
                         }
                     }
 
-                    return new TermStatistics(term.Bytes(), docFreq, totalTermFreq);
+                    return new TermStatistics(term.Bytes, docFreq, totalTermFreq);
                 }
 
                 public override CollectionStatistics CollectionStatistics(string field)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts2.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts2.cs b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts2.cs
index 865f993..30f9633 100644
--- a/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts2.cs
+++ b/src/Lucene.Net.Tests.Facet/Taxonomy/TestTaxonomyFacetCounts2.cs
@@ -117,7 +117,7 @@ namespace Lucene.Net.Facet.Taxonomy
 
         private static void AddField(Document doc)
         {
-            doc.Add(new StringField(A.Field(), A.Text(), Store.NO));
+            doc.Add(new StringField(A.Field, A.Text(), Store.NO));
         }
 
         private static void AddFacets(Document doc, FacetsConfig config, bool updateTermExpectedCounts)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Tests/core/Codecs/Lucene3x/TestSurrogates.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Codecs/Lucene3x/TestSurrogates.cs b/src/Lucene.Net.Tests/core/Codecs/Lucene3x/TestSurrogates.cs
index 0ac1cb9..f49f846 100644
--- a/src/Lucene.Net.Tests/core/Codecs/Lucene3x/TestSurrogates.cs
+++ b/src/Lucene.Net.Tests/core/Codecs/Lucene3x/TestSurrogates.cs
@@ -73,9 +73,9 @@ namespace Lucene.Net.Codecs.Lucene3x
             return new string(buffer, 0, end);
         }
 
-        private string ToHexString(Term t)
+        private static string ToHexString(Term t)
         {
-            return t.Field() + ":" + UnicodeUtil.ToHexString(t.Text());
+            return t.Field + ":" + UnicodeUtil.ToHexString(t.Text());
         }
 
         private string GetRandomString(Random r)
@@ -99,19 +99,19 @@ namespace Lucene.Net.Codecs.Lucene3x
             return s;
         }
 
-        private class SortTermAsUTF16Comparator : IComparer<Term>
+        private sealed class SortTermAsUTF16Comparator : IComparer<Term>
         {
-            internal static readonly IComparer<BytesRef> LegacyComparator = BytesRef.UTF8SortedAsUTF16Comparer;
+            private static readonly IComparer<BytesRef> LegacyComparator = BytesRef.UTF8SortedAsUTF16Comparer;
 
-            public virtual int Compare(Term term1, Term term2)
+            public int Compare(Term term1, Term term2)
             {
-                if (term1.Field().Equals(term2.Field()))
+                if (term1.Field.Equals(term2.Field))
                 {
-                    return LegacyComparator.Compare(term1.Bytes(), term2.Bytes());
+                    return LegacyComparator.Compare(term1.Bytes, term2.Bytes);
                 }
                 else
                 {
-                    return term1.Field().CompareTo(term2.Field());
+                    return System.String.Compare(term1.Field, term2.Field, System.StringComparison.Ordinal);
                 }
             }
         }
@@ -142,7 +142,7 @@ namespace Lucene.Net.Codecs.Lucene3x
                         if (VERBOSE)
                         {
                             Console.WriteLine("  got term=" + field + ":" + UnicodeUtil.ToHexString(text.Utf8ToString()));
-                            Console.WriteLine("       exp=" + exp.Field() + ":" + UnicodeUtil.ToHexString(exp.Text().ToString()));
+                            Console.WriteLine("       exp=" + exp.Field + ":" + UnicodeUtil.ToHexString(exp.Text()));
                             Console.WriteLine();
                         }
                         if (lastText == null)
@@ -154,8 +154,8 @@ namespace Lucene.Net.Codecs.Lucene3x
                             Assert.IsTrue(lastText.CompareTo(text) < 0);
                             lastText.CopyBytes(text);
                         }
-                        Assert.AreEqual(exp.Field(), field);
-                        Assert.AreEqual(exp.Bytes(), text);
+                        Assert.AreEqual(exp.Field, field);
+                        Assert.AreEqual(exp.Bytes, text);
                         termCount++;
                     }
                     if (VERBOSE)
@@ -185,7 +185,7 @@ namespace Lucene.Net.Codecs.Lucene3x
                 // pick random field+term
                 int spot = r.Next(fieldTerms.Count);
                 Term term = fieldTerms[spot];
-                string field = term.Field();
+                string field = term.Field;
 
                 if (VERBOSE)
                 {
@@ -206,7 +206,7 @@ namespace Lucene.Net.Codecs.Lucene3x
                 }
 
                 // seek should find the term
-                Assert.AreEqual(TermsEnum.SeekStatus.FOUND, te.SeekCeil(term.Bytes()));
+                Assert.AreEqual(TermsEnum.SeekStatus.FOUND, te.SeekCeil(term.Bytes));
 
                 // now .next() this many times:
                 int ct = TestUtil.NextInt(r, 5, 100);
@@ -221,7 +221,7 @@ namespace Lucene.Net.Codecs.Lucene3x
                         break;
                     }
                     term = fieldTerms[1 + spot + i];
-                    if (!term.Field().Equals(field))
+                    if (!term.Field.Equals(field))
                     {
                         Assert.IsNull(te.Next());
                         break;
@@ -236,7 +236,7 @@ namespace Lucene.Net.Codecs.Lucene3x
                             Console.WriteLine("       exp=" + UnicodeUtil.ToHexString(term.Text().ToString()));
                         }
 
-                        Assert.AreEqual(term.Bytes(), t);
+                        Assert.AreEqual(term.Bytes, t);
                     }
                 }
             }
@@ -283,13 +283,13 @@ namespace Lucene.Net.Codecs.Lucene3x
 
                         spot = -spot - 1;
 
-                        if (spot == fieldTerms.Count || !fieldTerms[spot].Field().Equals(field))
+                        if (spot == fieldTerms.Count || !fieldTerms[spot].Field.Equals(field))
                         {
-                            Assert.AreEqual(TermsEnum.SeekStatus.END, te.SeekCeil(tx.Bytes()));
+                            Assert.AreEqual(TermsEnum.SeekStatus.END, te.SeekCeil(tx.Bytes));
                         }
                         else
                         {
-                            Assert.AreEqual(TermsEnum.SeekStatus.NOT_FOUND, te.SeekCeil(tx.Bytes()));
+                            Assert.AreEqual(TermsEnum.SeekStatus.NOT_FOUND, te.SeekCeil(tx.Bytes));
 
                             if (VERBOSE)
                             {
@@ -297,7 +297,7 @@ namespace Lucene.Net.Codecs.Lucene3x
                                 Console.WriteLine("  exp term=" + UnicodeUtil.ToHexString(fieldTerms[spot].Text()));
                             }
 
-                            Assert.AreEqual(fieldTerms[spot].Bytes(), te.Term());
+                            Assert.AreEqual(fieldTerms[spot].Bytes, te.Term());
 
                             // now .next() this many times:
                             int ct = TestUtil.NextInt(r, 5, 100);
@@ -312,7 +312,7 @@ namespace Lucene.Net.Codecs.Lucene3x
                                     break;
                                 }
                                 Term term = fieldTerms[1 + spot + i];
-                                if (!term.Field().Equals(field))
+                                if (!term.Field.Equals(field))
                                 {
                                     Assert.IsNull(te.Next());
                                     break;
@@ -327,7 +327,7 @@ namespace Lucene.Net.Codecs.Lucene3x
                                         Console.WriteLine("       exp=" + UnicodeUtil.ToHexString(term.Text().ToString()));
                                     }
 
-                                    Assert.AreEqual(term.Bytes(), t);
+                                    Assert.AreEqual(term.Bytes, t);
                                 }
                             }
                         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Tests/core/Index/TestAddIndexes.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestAddIndexes.cs b/src/Lucene.Net.Tests/core/Index/TestAddIndexes.cs
index fdc78d7..2ab2f3b 100644
--- a/src/Lucene.Net.Tests/core/Index/TestAddIndexes.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestAddIndexes.cs
@@ -521,7 +521,7 @@ namespace Lucene.Net.Index
         private void VerifyTermDocs(Directory dir, Term term, int numDocs)
         {
             IndexReader reader = DirectoryReader.Open(dir);
-            DocsEnum docsEnum = TestUtil.Docs(Random(), reader, term.Field(), term.Bytes(), null, null, DocsEnum.FLAG_NONE);
+            DocsEnum docsEnum = TestUtil.Docs(Random(), reader, term.Field, term.Bytes, null, null, DocsEnum.FLAG_NONE);
             int count = 0;
             while (docsEnum.NextDoc() != DocIdSetIterator.NO_MORE_DOCS)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Tests/core/Index/TestDirectoryReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestDirectoryReader.cs b/src/Lucene.Net.Tests/core/Index/TestDirectoryReader.cs
index d0d9ef4..a3d0c49 100644
--- a/src/Lucene.Net.Tests/core/Index/TestDirectoryReader.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestDirectoryReader.cs
@@ -349,7 +349,7 @@ namespace Lucene.Net.Index
 
         internal virtual void AssertTermDocsCount(string msg, IndexReader reader, Term term, int expected)
         {
-            DocsEnum tdocs = TestUtil.Docs(Random(), reader, term.Field(), new BytesRef(term.Text()), MultiFields.GetLiveDocs(reader), null, 0);
+            DocsEnum tdocs = TestUtil.Docs(Random(), reader, term.Field, new BytesRef(term.Text()), MultiFields.GetLiveDocs(reader), null, 0);
             int count = 0;
             if (tdocs != null)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Tests/core/Index/TestDocumentsWriterDeleteQueue.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestDocumentsWriterDeleteQueue.cs b/src/Lucene.Net.Tests/core/Index/TestDocumentsWriterDeleteQueue.cs
index cd01bb3..426825b 100644
--- a/src/Lucene.Net.Tests/core/Index/TestDocumentsWriterDeleteQueue.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestDocumentsWriterDeleteQueue.cs
@@ -86,8 +86,8 @@ namespace Lucene.Net.Index
             foreach (Term t in queue.FreezeGlobalBuffer(null).TermsIterable())
             {
                 BytesRef bytesRef = new BytesRef();
-                bytesRef.CopyBytes(t.Bytes());
-                frozenSet.Add(new Term(t.Field(), bytesRef));
+                bytesRef.CopyBytes(t.Bytes);
+                frozenSet.Add(new Term(t.Field, bytesRef));
             }
             assertEquals(uniqueValues, frozenSet);
             Assert.AreEqual(0, queue.NumGlobalTermDeletes(), "num deletes must be 0 after freeze");
@@ -247,8 +247,8 @@ namespace Lucene.Net.Index
             foreach (Term t in queue.FreezeGlobalBuffer(null).TermsIterable())
             {
                 BytesRef bytesRef = new BytesRef();
-                bytesRef.CopyBytes(t.Bytes());
-                frozenSet.Add(new Term(t.Field(), bytesRef));
+                bytesRef.CopyBytes(t.Bytes);
+                frozenSet.Add(new Term(t.Field, bytesRef));
             }
             Assert.AreEqual(0, queue.NumGlobalTermDeletes(), "num deletes must be 0 after freeze");
             Assert.AreEqual(uniqueValues.Count, frozenSet.Count);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Tests/core/Index/TestIndexWriterExceptions.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestIndexWriterExceptions.cs b/src/Lucene.Net.Tests/core/Index/TestIndexWriterExceptions.cs
index ab0e08f..aa8125e 100644
--- a/src/Lucene.Net.Tests/core/Index/TestIndexWriterExceptions.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestIndexWriterExceptions.cs
@@ -623,7 +623,7 @@ namespace Lucene.Net.Index
 
             // Make sure the doc that hit the exception was marked
             // as deleted:
-            DocsEnum tdocs = TestUtil.Docs(Random(), reader, t.Field(), new BytesRef(t.Text()), MultiFields.GetLiveDocs(reader), null, 0);
+            DocsEnum tdocs = TestUtil.Docs(Random(), reader, t.Field, new BytesRef(t.Text()), MultiFields.GetLiveDocs(reader), null, 0);
 
             int count = 0;
             while (tdocs.NextDoc() != DocIdSetIterator.NO_MORE_DOCS)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Tests/core/Index/TestIndexWriterReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestIndexWriterReader.cs b/src/Lucene.Net.Tests/core/Index/TestIndexWriterReader.cs
index 75482a5..3b001e2 100644
--- a/src/Lucene.Net.Tests/core/Index/TestIndexWriterReader.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestIndexWriterReader.cs
@@ -54,7 +54,7 @@ namespace Lucene.Net.Index
         public static int Count(Term t, IndexReader r)
         {
             int count = 0;
-            DocsEnum td = TestUtil.Docs(Random(), r, t.Field(), new BytesRef(t.Text()), MultiFields.GetLiveDocs(r), null, 0);
+            DocsEnum td = TestUtil.Docs(Random(), r, t.Field, new BytesRef(t.Text()), MultiFields.GetLiveDocs(r), null, 0);
 
             if (td != null)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f26f7649/src/Lucene.Net.Tests/core/Index/TestMultiLevelSkipList.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestMultiLevelSkipList.cs b/src/Lucene.Net.Tests/core/Index/TestMultiLevelSkipList.cs
index b02694e..d046e7e 100644
--- a/src/Lucene.Net.Tests/core/Index/TestMultiLevelSkipList.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestMultiLevelSkipList.cs
@@ -84,7 +84,7 @@ namespace Lucene.Net.Index
             for (int i = 0; i < 5000; i++)
             {
                 Document d1 = new Document();
-                d1.Add(NewTextField(term.Field(), term.Text(), Field.Store.NO));
+                d1.Add(NewTextField(term.Field, term.Text(), Field.Store.NO));
                 writer.AddDocument(d1);
             }
             writer.Commit();


Mime
View raw message