lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mhern...@apache.org
Subject [27/50] [abbrv] git commit: IT NOW BUILDS!~!!!
Date Tue, 24 Sep 2013 18:33:03 GMT
IT NOW BUILDS!~!!!


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

Branch: refs/heads/branch_4x
Commit: 733dc181cbbb770d6455c684ce0aabeaef2b1d8f
Parents: 25ec42a
Author: Paul Irwin <paulirwin@gmail.com>
Authored: Tue Aug 6 16:28:33 2013 -0400
Committer: Paul Irwin <paulirwin@gmail.com>
Committed: Tue Aug 6 16:28:33 2013 -0400

----------------------------------------------------------------------
 .../Analysis/Tokenattributes/ITermAttribute.cs  | 104 -----
 .../Analysis/Tokenattributes/TermAttribute.cs   | 268 -------------
 src/core/Codecs/Compressing/CompressionMode.cs  |  10 +-
 src/core/Codecs/StoredFieldsWriter.cs           |   4 +-
 src/core/Index/AtomicReader.cs                  |  10 +
 src/core/Index/MultiFields.cs                   |  10 +-
 src/core/Index/MultiTermsEnum.cs                |   2 +-
 src/core/Index/NormsConsumer.cs                 |   2 +-
 src/core/Index/NumericDocValuesWriter.cs        |   2 +-
 src/core/Index/ReadersAndLiveDocs.cs            |   4 +-
 src/core/Index/SegmentInfoPerCommit.cs          |   2 +-
 src/core/Index/SortedDocValuesWriter.cs         |   2 +-
 src/core/Index/SortedSetDocValuesWriter.cs      |   6 +-
 src/core/Index/StandardDirectoryReader.cs       |  15 +-
 src/core/Index/StoredFieldsProcessor.cs         |   2 +-
 src/core/Index/TermContext.cs                   |   2 +-
 src/core/Index/TermVectorsConsumerPerField.cs   |  28 +-
 src/core/Lucene.Net.csproj                      |   3 +-
 src/core/Search/FieldComparator.cs              |  86 ++--
 src/core/Search/MultiPhraseQuery.cs             |   9 +-
 src/core/Search/MultiTermQueryWrapperFilter.cs  |   2 +-
 src/core/Search/NRTManager.cs                   |  10 +-
 src/core/Search/NumericRangeQuery.cs            |   2 +-
 src/core/Search/Payloads/PayloadNearQuery.cs    |  24 +-
 src/core/Search/Payloads/PayloadSpanUtil.cs     |   5 +-
 src/core/Search/Payloads/PayloadTermQuery.cs    | 392 ++++++++++---------
 src/core/Search/PhraseQuery.cs                  |   4 +-
 src/core/Search/QueryWrapperFilter.cs           |   4 +-
 src/core/Search/ReqExclScorer.cs                |   2 +-
 src/core/Search/ScoreCachingWrappingScorer.cs   |   2 +-
 src/core/Search/ScoringRewrite.cs               |   4 +-
 src/core/Search/Similarities/SimilarityBase.cs  |  10 +-
 src/core/Search/Similarities/TFIDFSimilarity.cs |   6 +-
 src/core/Search/Spans/NearSpansOrdered.cs       |   4 +-
 src/core/Search/Spans/NearSpansUnordered.cs     |   2 +-
 .../Search/Spans/SpanNearPayloadCheckQuery.cs   |  11 +-
 src/core/Search/Spans/SpanNearQuery.cs          |   2 +-
 src/core/Search/Spans/SpanPositionCheckQuery.cs |   2 +-
 src/core/Search/Spans/SpanScorer.cs             |   2 +-
 src/core/Search/Spans/SpanTermQuery.cs          |  16 +-
 src/core/Search/Spans/SpanWeight.cs             |   2 +-
 src/core/Search/Spans/TermSpans.cs              |   4 +-
 src/core/Search/TermQuery.cs                    |   6 +-
 src/core/Search/TermRangeFilter.cs              |   4 +-
 src/core/Search/TermRangeQuery.cs               |  24 +-
 src/core/Search/TopDocs.cs                      |   2 +-
 src/core/Search/TopFieldCollector.cs            |  10 +-
 src/core/Store/NIOFSDirectory.cs                |   2 +-
 src/core/Store/SimpleFSDirectory.cs             |   2 +-
 src/core/Support/Deflater.cs                    |  36 ++
 src/core/Support/Inflater.cs                    |  36 ++
 src/core/Support/StringBuilderExtensions.cs     |  28 ++
 src/core/Util/Fst/ReverseBytesReader.cs         |   4 +-
 53 files changed, 534 insertions(+), 703 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Analysis/Tokenattributes/ITermAttribute.cs
----------------------------------------------------------------------
diff --git a/src/core/Analysis/Tokenattributes/ITermAttribute.cs b/src/core/Analysis/Tokenattributes/ITermAttribute.cs
deleted file mode 100644
index 8f9b030..0000000
--- a/src/core/Analysis/Tokenattributes/ITermAttribute.cs
+++ /dev/null
@@ -1,104 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-using System;
-using Lucene.Net.Util;
-
-namespace Lucene.Net.Analysis.Tokenattributes
-{
-	
-	/// <summary> The term text of a Token.</summary>
-	public interface ITermAttribute:IAttribute
-	{
-	    /// <summary>Returns the Token's term text.
-	    /// 
-	    /// This method has a performance penalty
-	    /// because the text is stored internally in a char[].  If
-	    /// possible, use <see cref="TermBuffer()" /> and <see cref="TermLength()" />
-	    /// directly instead.  If you really need a
-	    /// String, use this method, which is nothing more than
-	    /// a convenience call to <b>new String(token.termBuffer(), 0, token.termLength())</b>
-	    /// </summary>
-	    string Term { get; }
-
-	    /// <summary>Copies the contents of buffer, starting at offset for
-		/// length characters, into the termBuffer array.
-		/// </summary>
-		/// <param name="buffer">the buffer to copy
-		/// </param>
-		/// <param name="offset">the index in the buffer of the first character to copy
-		/// </param>
-		/// <param name="length">the number of characters to copy
-		/// </param>
-		void  SetTermBuffer(char[] buffer, int offset, int length);
-		
-		/// <summary>Copies the contents of buffer into the termBuffer array.</summary>
-		/// <param name="buffer">the buffer to copy
-		/// </param>
-		void  SetTermBuffer(System.String buffer);
-		
-		/// <summary>Copies the contents of buffer, starting at offset and continuing
-		/// for length characters, into the termBuffer array.
-		/// </summary>
-		/// <param name="buffer">the buffer to copy
-		/// </param>
-		/// <param name="offset">the index in the buffer of the first character to copy
-		/// </param>
-		/// <param name="length">the number of characters to copy
-		/// </param>
-		void  SetTermBuffer(System.String buffer, int offset, int length);
-		
-		/// <summary>Returns the internal termBuffer character array which
-		/// you can then directly alter.  If the array is too
-		/// small for your token, use <see cref="ResizeTermBuffer(int)" />
-		/// to increase it.  After
-		/// altering the buffer be sure to call <see cref="SetTermLength" />
-		/// to record the number of valid
-		/// characters that were placed into the termBuffer. 
-		/// </summary>
-		char[] TermBuffer();
-		
-		/// <summary>Grows the termBuffer to at least size newSize, preserving the
-		/// existing content. Note: If the next operation is to change
-		/// the contents of the term buffer use
-		/// <see cref="SetTermBuffer(char[], int, int)" />,
-		/// <see cref="SetTermBuffer(String)" />, or
-		/// <see cref="SetTermBuffer(String, int, int)" />
-		/// to optimally combine the resize with the setting of the termBuffer.
-		/// </summary>
-		/// <param name="newSize">minimum size of the new termBuffer
-		/// </param>
-		/// <returns> newly created termBuffer with length >= newSize
-		/// </returns>
-		char[] ResizeTermBuffer(int newSize);
-		
-		/// <summary>Return number of valid characters (length of the term)
-		/// in the termBuffer array. 
-		/// </summary>
-		int TermLength();
-		
-		/// <summary>Set number of valid characters (length of the term) in
-		/// the termBuffer array. Use this to truncate the termBuffer
-		/// or to synchronize with external manipulation of the termBuffer.
-		/// Note: to grow the size of the array,
-		/// use <see cref="ResizeTermBuffer(int)" /> first.
-		/// </summary>
-		/// <param name="length">the truncated length
-		/// </param>
-		void  SetTermLength(int length);
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Analysis/Tokenattributes/TermAttribute.cs
----------------------------------------------------------------------
diff --git a/src/core/Analysis/Tokenattributes/TermAttribute.cs b/src/core/Analysis/Tokenattributes/TermAttribute.cs
deleted file mode 100644
index f95402c..0000000
--- a/src/core/Analysis/Tokenattributes/TermAttribute.cs
+++ /dev/null
@@ -1,268 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-using System;
-using Lucene.Net.Support;
-using ArrayUtil = Lucene.Net.Util.ArrayUtil;
-using Attribute = Lucene.Net.Util.Attribute;
-
-namespace Lucene.Net.Analysis.Tokenattributes
-{
-	
-	/// <summary> The term text of a Token.</summary>
-	[Serializable]
-	public class TermAttribute:Attribute, ITermAttribute, System.ICloneable
-	{
-		private static int MIN_BUFFER_SIZE = 10;
-		
-		private char[] termBuffer;
-		private int termLength;
-
-	    /// <summary>Returns the Token's term text.
-	    /// 
-	    /// This method has a performance penalty
-	    /// because the text is stored internally in a char[].  If
-	    /// possible, use <see cref="TermBuffer()" /> and 
-	    /// <see cref="TermLength()" /> directly instead.  If you 
-	    /// really need a String, use this method, which is nothing more than
-	    /// a convenience call to <b>new String(token.termBuffer(), 0, token.termLength())</b>
-	    /// </summary>
-	    public virtual string Term
-	    {
-	        get
-	        {
-	            InitTermBuffer();
-	            return new System.String(termBuffer, 0, termLength);
-	        }
-	    }
-
-	    /// <summary>Copies the contents of buffer, starting at offset for
-		/// length characters, into the termBuffer array.
-		/// </summary>
-		/// <param name="buffer">the buffer to copy
-		/// </param>
-		/// <param name="offset">the index in the buffer of the first character to copy
-		/// </param>
-		/// <param name="length">the number of characters to copy
-		/// </param>
-		public virtual void  SetTermBuffer(char[] buffer, int offset, int length)
-		{
-			GrowTermBuffer(length);
-			Array.Copy(buffer, offset, termBuffer, 0, length);
-			termLength = length;
-		}
-		
-		/// <summary>Copies the contents of buffer into the termBuffer array.</summary>
-		/// <param name="buffer">the buffer to copy
-		/// </param>
-		public virtual void  SetTermBuffer(System.String buffer)
-		{
-			int length = buffer.Length;
-			GrowTermBuffer(length);
-			TextSupport.GetCharsFromString(buffer, 0, length, termBuffer, 0);
-			termLength = length;
-		}
-		
-		/// <summary>Copies the contents of buffer, starting at offset and continuing
-		/// for length characters, into the termBuffer array.
-		/// </summary>
-		/// <param name="buffer">the buffer to copy
-		/// </param>
-		/// <param name="offset">the index in the buffer of the first character to copy
-		/// </param>
-		/// <param name="length">the number of characters to copy
-		/// </param>
-		public virtual void  SetTermBuffer(System.String buffer, int offset, int length)
-		{
-			System.Diagnostics.Debug.Assert(offset <= buffer.Length);
-			System.Diagnostics.Debug.Assert(offset + length <= buffer.Length);
-			GrowTermBuffer(length);
-			TextSupport.GetCharsFromString(buffer, offset, offset + length, termBuffer, 0);
-			termLength = length;
-		}
-		
-		/// <summary>Returns the internal termBuffer character array which
-		/// you can then directly alter.  If the array is too
-		/// small for your token, use <see cref="ResizeTermBuffer(int)" />
-		/// to increase it.  After
-		/// altering the buffer be sure to call <see cref="SetTermLength" />
-		/// to record the number of valid
-		/// characters that were placed into the termBuffer. 
-		/// </summary>
-		public virtual char[] TermBuffer()
-		{
-			InitTermBuffer();
-			return termBuffer;
-		}
-		
-		/// <summary>Grows the termBuffer to at least size newSize, preserving the
-		/// existing content. Note: If the next operation is to change
-		/// the contents of the term buffer use
-		/// <see cref="SetTermBuffer(char[], int, int)" />,
-		/// <see cref="SetTermBuffer(String)" />, or
-		/// <see cref="SetTermBuffer(String, int, int)" />
-		/// to optimally combine the resize with the setting of the termBuffer.
-		/// </summary>
-		/// <param name="newSize">minimum size of the new termBuffer
-		/// </param>
-		/// <returns> newly created termBuffer with length >= newSize
-		/// </returns>
-		public virtual char[] ResizeTermBuffer(int newSize)
-		{
-			if (termBuffer == null)
-			{
-				// The buffer is always at least MIN_BUFFER_SIZE
-				termBuffer = new char[ArrayUtil.GetNextSize(newSize < MIN_BUFFER_SIZE?MIN_BUFFER_SIZE:newSize)];
-			}
-			else
-			{
-				if (termBuffer.Length < newSize)
-				{
-					// Not big enough; create a new array with slight
-					// over allocation and preserve content
-					char[] newCharBuffer = new char[ArrayUtil.GetNextSize(newSize)];
-					Array.Copy(termBuffer, 0, newCharBuffer, 0, termBuffer.Length);
-					termBuffer = newCharBuffer;
-				}
-			}
-			return termBuffer;
-		}
-		
-		
-		/// <summary>Allocates a buffer char[] of at least newSize, without preserving the existing content.
-		/// its always used in places that set the content 
-		/// </summary>
-		/// <param name="newSize">minimum size of the buffer
-		/// </param>
-		private void  GrowTermBuffer(int newSize)
-		{
-			if (termBuffer == null)
-			{
-				// The buffer is always at least MIN_BUFFER_SIZE
-				termBuffer = new char[ArrayUtil.GetNextSize(newSize < MIN_BUFFER_SIZE?MIN_BUFFER_SIZE:newSize)];
-			}
-			else
-			{
-				if (termBuffer.Length < newSize)
-				{
-					// Not big enough; create a new array with slight
-					// over allocation:
-					termBuffer = new char[ArrayUtil.GetNextSize(newSize)];
-				}
-			}
-		}
-		
-		private void  InitTermBuffer()
-		{
-			if (termBuffer == null)
-			{
-				termBuffer = new char[ArrayUtil.GetNextSize(MIN_BUFFER_SIZE)];
-				termLength = 0;
-			}
-		}
-		
-		/// <summary>Return number of valid characters (length of the term)
-		/// in the termBuffer array. 
-		/// </summary>
-		public virtual int TermLength()
-		{
-			return termLength;
-		}
-		
-		/// <summary>Set number of valid characters (length of the term) in
-		/// the termBuffer array. Use this to truncate the termBuffer
-		/// or to synchronize with external manipulation of the termBuffer.
-		/// Note: to grow the size of the array,
-		/// use <see cref="ResizeTermBuffer(int)" /> first.
-		/// </summary>
-		/// <param name="length">the truncated length
-		/// </param>
-		public virtual void  SetTermLength(int length)
-		{
-			InitTermBuffer();
-			if (length > termBuffer.Length)
-				throw new System.ArgumentException("length " + length + " exceeds the size of the termBuffer (" + termBuffer.Length + ")");
-			termLength = length;
-		}
-		
-		public override int GetHashCode()
-		{
-			InitTermBuffer();
-			int code = termLength;
-			code = code * 31 + ArrayUtil.HashCode(termBuffer, 0, termLength);
-			return code;
-		}
-		
-		public override void  Clear()
-		{
-			termLength = 0;
-		}
-		
-		public override System.Object Clone()
-		{
-			TermAttribute t = (TermAttribute) base.Clone();
-			// Do a deep clone
-			if (termBuffer != null)
-			{
-				t.termBuffer = new char[termBuffer.Length];
-				termBuffer.CopyTo(t.termBuffer, 0);
-			}
-			return t;
-		}
-		
-		public  override bool Equals(System.Object other)
-		{
-			if (other == this)
-			{
-				return true;
-			}
-			
-			if (other is ITermAttribute)
-			{
-				InitTermBuffer();
-				TermAttribute o = ((TermAttribute) other);
-				o.InitTermBuffer();
-				
-				if (termLength != o.termLength)
-					return false;
-				for (int i = 0; i < termLength; i++)
-				{
-					if (termBuffer[i] != o.termBuffer[i])
-					{
-						return false;
-					}
-				}
-				return true;
-			}
-			
-			return false;
-		}
-		
-		public override System.String ToString()
-		{
-			InitTermBuffer();
-			return "term=" + new System.String(termBuffer, 0, termLength);
-		}
-		
-		public override void  CopyTo(Attribute target)
-		{
-			InitTermBuffer();
-			ITermAttribute t = (ITermAttribute) target;
-			t.SetTermBuffer(termBuffer, 0, termLength);
-		}
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Codecs/Compressing/CompressionMode.cs
----------------------------------------------------------------------
diff --git a/src/core/Codecs/Compressing/CompressionMode.cs b/src/core/Codecs/Compressing/CompressionMode.cs
index 92f5316..4a91d5c 100644
--- a/src/core/Codecs/Compressing/CompressionMode.cs
+++ b/src/core/Codecs/Compressing/CompressionMode.cs
@@ -193,7 +193,7 @@ namespace Lucene.Net.Codecs.Compressing
 
             public DeflateDecompressor()
             {
-                decompressor = new Inflater();
+                decompressor = SharpZipLib.CreateInflater();
                 compressed = new byte[0];
             }
 
@@ -225,7 +225,7 @@ namespace Lucene.Net.Codecs.Compressing
                     try
                     {
                         int remaining = bytes.bytes.Length - bytes.length;
-                        count = decompressor.Inflate(bytes.bytes, bytes.length, remaining);
+                        count = decompressor.Inflate((byte[])(Array)bytes.bytes, bytes.length, remaining);
                     }
                     catch (FormatException e)
                     {
@@ -274,10 +274,10 @@ namespace Lucene.Net.Codecs.Compressing
             public override void Compress(sbyte[] bytes, int off, int len, DataOutput output)
             {
                 compressor.Reset();
-                compressor.SetInput(bytes, off, len);
+                compressor.SetInput((byte[])(Array)bytes, off, len);
                 compressor.Finish();
 
-                if (compressor.NeedsInput)
+                if (compressor.IsNeedingInput)
                 {
                     // no output
                     output.WriteVInt(0);
@@ -287,7 +287,7 @@ namespace Lucene.Net.Codecs.Compressing
                 int totalCount = 0;
                 for (; ; )
                 {
-                    int count = compressor.Deflate(compressed, totalCount, compressed.Length - totalCount);
+                    int count = compressor.Deflate((byte[])(Array)compressed, totalCount, compressed.Length - totalCount);
                     totalCount += count;
                     if (compressor.IsFinished)
                     {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Codecs/StoredFieldsWriter.cs
----------------------------------------------------------------------
diff --git a/src/core/Codecs/StoredFieldsWriter.cs b/src/core/Codecs/StoredFieldsWriter.cs
index 536d386..86e58ed 100644
--- a/src/core/Codecs/StoredFieldsWriter.cs
+++ b/src/core/Codecs/StoredFieldsWriter.cs
@@ -62,7 +62,7 @@ namespace Lucene.Net.Codecs
             int storedCount = 0;
             foreach (IIndexableField field in doc)
             {
-                if (field.FieldType.Stored)
+                if (field.FieldTypeValue.Stored)
                 {
                     storedCount++;
                 }
@@ -72,7 +72,7 @@ namespace Lucene.Net.Codecs
 
             foreach (IIndexableField field in doc)
             {
-                if (field.FieldType.Stored)
+                if (field.FieldTypeValue.Stored)
                 {
                     WriteField(fieldInfos.FieldInfo(field.Name), field);
                 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Index/AtomicReader.cs
----------------------------------------------------------------------
diff --git a/src/core/Index/AtomicReader.cs b/src/core/Index/AtomicReader.cs
index 5981765..b0dc1b6 100644
--- a/src/core/Index/AtomicReader.cs
+++ b/src/core/Index/AtomicReader.cs
@@ -27,6 +27,16 @@ namespace Lucene.Net.Index
             }
         }
 
+        // .NET Port: This is needed since Context can't change return type on override
+        public AtomicReaderContext AtomicContext
+        {
+            get
+            {
+                EnsureOpen();
+                return readerContext;
+            }
+        }
+
         [Obsolete]
         public bool HasNorms(string field)
         {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Index/MultiFields.cs
----------------------------------------------------------------------
diff --git a/src/core/Index/MultiFields.cs b/src/core/Index/MultiFields.cs
index 8f2a961..3ed64aa 100644
--- a/src/core/Index/MultiFields.cs
+++ b/src/core/Index/MultiFields.cs
@@ -23,13 +23,13 @@ namespace Lucene.Net.Index
                     return null;
                 case 1:
                     // already an atomic reader / reader with one leave
-                    return leaves[0].Reader.Fields;
+                    return leaves[0].AtomicReader.Fields;
                 default:
                     IList<Fields> fields = new List<Fields>();
                     IList<ReaderSlice> slices = new List<ReaderSlice>();
                     foreach (AtomicReaderContext ctx in leaves)
                     {
-                        AtomicReader r = ctx.Reader;
+                        AtomicReader r = ctx.AtomicReader;
                         Fields f = r.Fields;
                         if (f != null)
                         {
@@ -61,7 +61,7 @@ namespace Lucene.Net.Index
                 //assert size > 0 : "A reader with deletions must have at least one leave";
                 if (size == 1)
                 {
-                    return leaves[0].Reader.LiveDocs;
+                    return leaves[0].AtomicReader.LiveDocs;
                 }
                 IBits[] liveDocs = new IBits[size];
                 int[] starts = new int[size + 1];
@@ -69,7 +69,7 @@ namespace Lucene.Net.Index
                 {
                     // record all liveDocs, even if they are null
                     AtomicReaderContext ctx = leaves[i];
-                    liveDocs[i] = ctx.Reader.LiveDocs;
+                    liveDocs[i] = ctx.AtomicReader.LiveDocs;
                     starts[i] = ctx.docBase;
                 }
                 starts[size] = reader.MaxDoc;
@@ -199,7 +199,7 @@ namespace Lucene.Net.Index
             FieldInfos.Builder builder = new FieldInfos.Builder();
             foreach (AtomicReaderContext ctx in reader.Leaves)
             {
-                builder.Add(ctx.Reader.FieldInfos);
+                builder.Add(ctx.AtomicReader.FieldInfos);
             }
             return builder.Finish();
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Index/MultiTermsEnum.cs
----------------------------------------------------------------------
diff --git a/src/core/Index/MultiTermsEnum.cs b/src/core/Index/MultiTermsEnum.cs
index 164b33b..2a9dd35 100644
--- a/src/core/Index/MultiTermsEnum.cs
+++ b/src/core/Index/MultiTermsEnum.cs
@@ -119,7 +119,7 @@ namespace Lucene.Net.Index
                 }
             }
 
-            if (queue.Size() == 0)
+            if (queue.Size == 0)
             {
                 return TermsEnum.EMPTY;
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Index/NormsConsumer.cs
----------------------------------------------------------------------
diff --git a/src/core/Index/NormsConsumer.cs b/src/core/Index/NormsConsumer.cs
index b166975..afd7fd5 100644
--- a/src/core/Index/NormsConsumer.cs
+++ b/src/core/Index/NormsConsumer.cs
@@ -21,7 +21,7 @@ namespace Lucene.Net.Index
             {
                 if (state.fieldInfos.HasNorms)
                 {
-                    NormsFormat normsFormat = state.segmentInfo.Codec.NormsFormat();
+                    NormsFormat normsFormat = state.segmentInfo.Codec.NormsFormat;
                     //assert normsFormat != null;
                     normsConsumer = normsFormat.NormsConsumer(state);
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Index/NumericDocValuesWriter.cs
----------------------------------------------------------------------
diff --git a/src/core/Index/NumericDocValuesWriter.cs b/src/core/Index/NumericDocValuesWriter.cs
index 35542cd..9de0e54 100644
--- a/src/core/Index/NumericDocValuesWriter.cs
+++ b/src/core/Index/NumericDocValuesWriter.cs
@@ -70,7 +70,7 @@ namespace Lucene.Net.Index
         {
             // .NET Port: using yield return instead of custom iterator type. Much less code.
 
-            AppendingLongBuffer.Iterator iter = pending.GetIterator();
+            AbstractAppendingLongBuffer.Iterator iter = pending.GetIterator();
             int size = (int)pending.Size;
             int upto = 0;
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Index/ReadersAndLiveDocs.cs
----------------------------------------------------------------------
diff --git a/src/core/Index/ReadersAndLiveDocs.cs b/src/core/Index/ReadersAndLiveDocs.cs
index 0fb3aa2..28ae366 100644
--- a/src/core/Index/ReadersAndLiveDocs.cs
+++ b/src/core/Index/ReadersAndLiveDocs.cs
@@ -302,7 +302,7 @@ namespace Lucene.Net.Index
                     // SegmentReader sharing the current liveDocs
                     // instance; must now make a private clone so we can
                     // change it:
-                    LiveDocsFormat liveDocsFormat = info.info.Codec.LiveDocsFormat();
+                    LiveDocsFormat liveDocsFormat = info.info.Codec.LiveDocsFormat;
                     if (liveDocs == null)
                     {
                         //System.out.println("create BV seg=" + info);
@@ -388,7 +388,7 @@ namespace Lucene.Net.Index
                 bool success = false;
                 try
                 {
-                    info.info.Codec.LiveDocsFormat().WriteLiveDocs((IMutableBits)liveDocs, trackingDir, info, pendingDeleteCount, IOContext.DEFAULT);
+                    info.info.Codec.LiveDocsFormat.WriteLiveDocs((IMutableBits)liveDocs, trackingDir, info, pendingDeleteCount, IOContext.DEFAULT);
                     success = true;
                 }
                 finally

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Index/SegmentInfoPerCommit.cs
----------------------------------------------------------------------
diff --git a/src/core/Index/SegmentInfoPerCommit.cs b/src/core/Index/SegmentInfoPerCommit.cs
index 9434936..603446b 100644
--- a/src/core/Index/SegmentInfoPerCommit.cs
+++ b/src/core/Index/SegmentInfoPerCommit.cs
@@ -72,7 +72,7 @@ namespace Lucene.Net.Index
                 ICollection<String> files = new HashSet<String>(info.Files);
 
                 // Must separately add any live docs files:
-                info.Codec.LiveDocsFormat().Files(this, files);
+                info.Codec.LiveDocsFormat.Files(this, files);
 
                 return files;
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Index/SortedDocValuesWriter.cs
----------------------------------------------------------------------
diff --git a/src/core/Index/SortedDocValuesWriter.cs b/src/core/Index/SortedDocValuesWriter.cs
index f25c457..cc6a23c 100644
--- a/src/core/Index/SortedDocValuesWriter.cs
+++ b/src/core/Index/SortedDocValuesWriter.cs
@@ -135,7 +135,7 @@ namespace Lucene.Net.Index
         {
             // .NET Port: using yield return instead of custom iterator type. Much less code.
 
-            AppendingLongBuffer.Iterator iter = pending.GetIterator();
+            AbstractAppendingLongBuffer.Iterator iter = pending.GetIterator();
             int docUpto = 0;
 
             while (docUpto < maxDoc)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Index/SortedSetDocValuesWriter.cs
----------------------------------------------------------------------
diff --git a/src/core/Index/SortedSetDocValuesWriter.cs b/src/core/Index/SortedSetDocValuesWriter.cs
index 23998e4..9cddcef 100644
--- a/src/core/Index/SortedSetDocValuesWriter.cs
+++ b/src/core/Index/SortedSetDocValuesWriter.cs
@@ -178,8 +178,8 @@ namespace Lucene.Net.Index
         {
             // .NET Port: using yield return instead of custom iterator type. Much less code.
 
-            AppendingLongBuffer.Iterator iter = pending.GetIterator();
-            AppendingLongBuffer.Iterator counts = pendingCounts.GetIterator();
+            AbstractAppendingLongBuffer.Iterator iter = pending.GetIterator();
+            AbstractAppendingLongBuffer.Iterator counts = pendingCounts.GetIterator();
             long numOrds = pending.Size;
             long ordUpto = 0L;
 
@@ -212,7 +212,7 @@ namespace Lucene.Net.Index
         {
             // .NET Port: using yield return instead of custom iterator type. Much less code.
 
-            AppendingLongBuffer.Iterator iter = pendingCounts.GetIterator();
+            AbstractAppendingLongBuffer.Iterator iter = pendingCounts.GetIterator();
             int docUpto = 0;
 
             while (docUpto < maxDoc)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Index/StandardDirectoryReader.cs
----------------------------------------------------------------------
diff --git a/src/core/Index/StandardDirectoryReader.cs b/src/core/Index/StandardDirectoryReader.cs
index 4ec5e91..55d222e 100644
--- a/src/core/Index/StandardDirectoryReader.cs
+++ b/src/core/Index/StandardDirectoryReader.cs
@@ -28,9 +28,12 @@ namespace Lucene.Net.Index
 
         private sealed class AnonymousOpenFindSegmentsFile : SegmentInfos.FindSegmentsFile
         {
-            public AnonymousOpenFindSegmentsFile(Directory dir)
+            private readonly int termInfosIndexDivisor;
+
+            public AnonymousOpenFindSegmentsFile(Directory dir, int termInfosIndexDivisor)
                 : base(dir)
             {
+                this.termInfosIndexDivisor = termInfosIndexDivisor;
             }
 
             protected override object DoBody(string segmentFileName)
@@ -63,7 +66,7 @@ namespace Lucene.Net.Index
 
         internal static DirectoryReader Open(Directory directory, IndexCommit commit, int termInfosIndexDivisor)
         {
-            return (DirectoryReader)new AnonymousOpenFindSegmentsFile(directory).Run(commit);
+            return (DirectoryReader)new AnonymousOpenFindSegmentsFile(directory, termInfosIndexDivisor).Run(commit);
         }
 
         internal static DirectoryReader Open(IndexWriter writer, SegmentInfos infos, bool applyAllDeletes)
@@ -94,7 +97,7 @@ namespace Lucene.Net.Index
                     try
                     {
                         SegmentReader reader = rld.GetReadOnlyClone(IOContext.READ);
-                        if (reader.NumDocs > 0 || writer.KeepFullyDeletedSegments)
+                        if (reader.NumDocs > 0 || writer.GetKeepFullyDeletedSegments())
                         {
                             // Steal the ref:
                             readers.Add(reader);
@@ -103,7 +106,7 @@ namespace Lucene.Net.Index
                         else
                         {
                             reader.Dispose();
-                            segmentInfos.Remove(infosUpto);
+                            segmentInfos.RemoveAt(infosUpto);
                         }
                     }
                     finally
@@ -155,7 +158,7 @@ namespace Lucene.Net.Index
             for (int i = infos.Count - 1; i >= 0; i--)
             {
                 // find SegmentReader for this segment
-                int oldReaderIndex = segmentReaders[infos.Info(i).info.Name];
+                int oldReaderIndex = segmentReaders[infos.Info(i).info.name];
                 if (oldReaderIndex == null)
                 {
                     // this is a new segment, no old SegmentReader can be reused
@@ -395,7 +398,7 @@ namespace Lucene.Net.Index
             get
             {
                 EnsureOpen();
-                if (writer == null || writer.IsClosed())
+                if (writer == null || writer.IsClosed)
                 {
                     // Fully read the segments file: this ensures that it's
                     // completely written so that if

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Index/StoredFieldsProcessor.cs
----------------------------------------------------------------------
diff --git a/src/core/Index/StoredFieldsProcessor.cs b/src/core/Index/StoredFieldsProcessor.cs
index 0f119ac..351a24e 100644
--- a/src/core/Index/StoredFieldsProcessor.cs
+++ b/src/core/Index/StoredFieldsProcessor.cs
@@ -132,7 +132,7 @@ namespace Lucene.Net.Index
 
         public override void AddField(int docID, IIndexableField field, FieldInfo fieldInfo)
         {
-            if (field.FieldType.Stored)
+            if (field.FieldTypeValue.Stored)
             {
                 if (numStoredFields == storedFields.Length)
                 {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Index/TermContext.cs
----------------------------------------------------------------------
diff --git a/src/core/Index/TermContext.cs b/src/core/Index/TermContext.cs
index 1d1410a..932d295 100644
--- a/src/core/Index/TermContext.cs
+++ b/src/core/Index/TermContext.cs
@@ -47,7 +47,7 @@ namespace Lucene.Net.Index
             foreach (AtomicReaderContext ctx in context.Leaves)
             {
                 //if (DEBUG) System.out.println("  r=" + leaves[i].reader);
-                Fields fields = ctx.Reader.Fields;
+                Fields fields = ctx.AtomicReader.Fields;
                 if (fields != null)
                 {
                     Terms terms = fields.Terms(field);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Index/TermVectorsConsumerPerField.cs
----------------------------------------------------------------------
diff --git a/src/core/Index/TermVectorsConsumerPerField.cs b/src/core/Index/TermVectorsConsumerPerField.cs
index adda8ec..1c0a1fd 100644
--- a/src/core/Index/TermVectorsConsumerPerField.cs
+++ b/src/core/Index/TermVectorsConsumerPerField.cs
@@ -70,37 +70,37 @@ namespace Lucene.Net.Index
                     }
                     else
                     {
-                        if (field.FieldType.StoreTermVectorOffsets)
+                        if (field.FieldTypeValue.StoreTermVectorOffsets)
                         {
-                            throw new ArgumentException("cannot index term vector offsets when term vectors are not indexed (field=\"" + field.name());
+                            throw new ArgumentException("cannot index term vector offsets when term vectors are not indexed (field=\"" + field.Name);
                         }
-                        if (field.FieldType.StoreTermVectorPositions)
+                        if (field.FieldTypeValue.StoreTermVectorPositions)
                         {
-                            throw new ArgumentException("cannot index term vector positions when term vectors are not indexed (field=\"" + field.name());
+                            throw new ArgumentException("cannot index term vector positions when term vectors are not indexed (field=\"" + field.Name);
                         }
-                        if (field.FieldType.StoreTermVectorPayloads)
+                        if (field.FieldTypeValue.StoreTermVectorPayloads)
                         {
-                            throw new ArgumentException("cannot index term vector payloads when term vectors are not indexed (field=\"" + field.name());
+                            throw new ArgumentException("cannot index term vector payloads when term vectors are not indexed (field=\"" + field.Name);
                         }
                     }
                 }
                 else
                 {
-                    if (field.FieldType.StoreTermVectors)
+                    if (field.FieldTypeValue.StoreTermVectors)
                     {
-                        throw new ArgumentException("cannot index term vectors when field is not indexed (field=\"" + field.name());
+                        throw new ArgumentException("cannot index term vectors when field is not indexed (field=\"" + field.Name);
                     }
-                    if (field.FieldType.StoreTermVectorOffsets)
+                    if (field.FieldTypeValue.StoreTermVectorOffsets)
                     {
-                        throw new ArgumentException("cannot index term vector offsets when field is not indexed (field=\"" + field.name());
+                        throw new ArgumentException("cannot index term vector offsets when field is not indexed (field=\"" + field.Name);
                     }
-                    if (field.FieldType.StoreTermVectorPositions)
+                    if (field.FieldTypeValue.StoreTermVectorPositions)
                     {
-                        throw new ArgumentException("cannot index term vector positions when field is not indexed (field=\"" + field.name());
+                        throw new ArgumentException("cannot index term vector positions when field is not indexed (field=\"" + field.Name);
                     }
-                    if (field.FieldType.StoreTermVectorPayloads)
+                    if (field.FieldTypeValue.StoreTermVectorPayloads)
                     {
-                        throw new ArgumentException("cannot index term vector payloads when field is not indexed (field=\"" + field.name());
+                        throw new ArgumentException("cannot index term vector payloads when field is not indexed (field=\"" + field.Name);
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Lucene.Net.csproj
----------------------------------------------------------------------
diff --git a/src/core/Lucene.Net.csproj b/src/core/Lucene.Net.csproj
index 4b17cab..a6f3de8 100644
--- a/src/core/Lucene.Net.csproj
+++ b/src/core/Lucene.Net.csproj
@@ -163,9 +163,7 @@
     <Compile Include="Analysis\Tokenattributes\PayloadAttribute.cs" />
     <Compile Include="Analysis\Tokenattributes\IPositionIncrementAttribute.cs" />
     <Compile Include="Analysis\Tokenattributes\PositionIncrementAttribute.cs" />
-    <Compile Include="Analysis\Tokenattributes\ITermAttribute.cs" />
     <Compile Include="Analysis\Tokenattributes\PositionLengthAttribute.cs" />
-    <Compile Include="Analysis\Tokenattributes\TermAttribute.cs" />
     <Compile Include="Analysis\Tokenattributes\ITypeAttribute.cs" />
     <Compile Include="Analysis\Tokenattributes\TypeAttribute.cs" />
     <Compile Include="Analysis\TokenFilter.cs">
@@ -920,6 +918,7 @@
     <Compile Include="Support\IChecksum.cs">
       <SubType>Code</SubType>
     </Compile>
+    <Compile Include="Support\StringBuilderExtensions.cs" />
     <Compile Include="Support\StringTokenizer.cs" />
     <Compile Include="Support\TaskSchedulerCompletionService.cs" />
     <Compile Include="Support\ThreadFactory.cs" />

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Search/FieldComparator.cs
----------------------------------------------------------------------
diff --git a/src/core/Search/FieldComparator.cs b/src/core/Search/FieldComparator.cs
index 7caead2..6f5083d 100644
--- a/src/core/Search/FieldComparator.cs
+++ b/src/core/Search/FieldComparator.cs
@@ -79,17 +79,6 @@ namespace Lucene.Net.Search
     {
         // .NET Port: this class doesn't line-by-line match up with java due to use of non-generic casting.
         // see FieldComparator below.
-
-        /// <summary> Set a new Reader. All doc correspond to the current Reader.
-        /// 
-        /// </summary>
-        /// <param name="reader">current reader
-        /// </param>
-        /// <param name="docBase">docBase of this reader 
-        /// </param>
-        /// <throws>  IOException </throws>
-        /// <throws>  IOException </throws>
-        public abstract FieldComparator<T> SetNextReader(AtomicReaderContext context);
         
         /// <summary> Return the actual value in the slot.
         /// 
@@ -129,7 +118,21 @@ namespace Lucene.Net.Search
         }
 
         public abstract int CompareDocToValue(int doc, T value);
+        
+        public abstract override int Compare(int slot1, int slot2);
+
+        public abstract override void SetBottom(int slot);
+
+        public abstract override int CompareBottom(int doc);
 
+        public abstract override void Copy(int slot, int doc);
+
+        public abstract override FieldComparator SetNextReader(AtomicReaderContext context);
+
+        public override int CompareDocToObjectValue(int doc, object value)
+        {
+            return CompareDocToValue(doc, (T)value);
+        }
     }
 
     // .NET Port: Using a non-generic class here so that we avoid having to use the 
@@ -190,6 +193,17 @@ namespace Lucene.Net.Search
         /// <param name="doc">docID relative to current reader
         /// </param>
         public abstract void Copy(int slot, int doc);
+        
+        /// <summary> Set a new Reader. All doc correspond to the current Reader.
+        /// 
+        /// </summary>
+        /// <param name="reader">current reader
+        /// </param>
+        /// <param name="docBase">docBase of this reader 
+        /// </param>
+        /// <throws>  IOException </throws>
+        /// <throws>  IOException </throws>
+        public abstract FieldComparator SetNextReader(AtomicReaderContext context);
 
         /// <summary>Sets the Scorer to use in case a document's score is
         /// needed.
@@ -206,6 +220,32 @@ namespace Lucene.Net.Search
 
         public abstract object Value(int slot);
 
+        public int CompareValues(object first, object second)
+        {
+            if (first == null)
+            {
+                if (second == null)
+                {
+                    return 0;
+                }
+                else
+                {
+                    return -1;
+                }
+            }
+            else if (second == null)
+            {
+                return 1;
+            }
+            else
+            {
+                return ((IComparable<object>)first).CompareTo(second);
+            }
+        }
+
+        // .NET Port: a non-generic version of this method
+        public abstract int CompareDocToObjectValue(int doc, object value);
+
         public abstract class NumericComparator<T> : FieldComparator<T>
             where T : struct
         {
@@ -219,7 +259,7 @@ namespace Lucene.Net.Search
                 this.missingValue = missingValue;
             }
 
-            public override FieldComparator<T> SetNextReader(AtomicReaderContext context)
+            public override FieldComparator SetNextReader(AtomicReaderContext context)
             {
                 if (missingValue != null)
                 {
@@ -285,7 +325,7 @@ namespace Lucene.Net.Search
                 values[slot] = v2;
             }
 
-            public override FieldComparator<sbyte> SetNextReader(AtomicReaderContext context)
+            public override FieldComparator SetNextReader(AtomicReaderContext context)
             {
                 // NOTE: must do this before calling super otherwise
                 // we compute the docsWithField Bits twice!
@@ -365,7 +405,7 @@ namespace Lucene.Net.Search
                 values[slot] = v2;
             }
 
-            public override FieldComparator<double> SetNextReader(AtomicReaderContext context)
+            public override FieldComparator SetNextReader(AtomicReaderContext context)
             {
                 // NOTE: must do this before calling super otherwise
                 // we compute the docsWithField Bits twice!
@@ -446,7 +486,7 @@ namespace Lucene.Net.Search
                 values[slot] = v2;
             }
 
-            public override FieldComparator<float> SetNextReader(AtomicReaderContext context)
+            public override FieldComparator SetNextReader(AtomicReaderContext context)
             {
                 // NOTE: must do this before calling super otherwise
                 // we compute the docsWithField Bits twice!
@@ -526,7 +566,7 @@ namespace Lucene.Net.Search
                 values[slot] = v2;
             }
 
-            public override FieldComparator<short> SetNextReader(AtomicReaderContext context)
+            public override FieldComparator SetNextReader(AtomicReaderContext context)
             {
                 // NOTE: must do this before calling super otherwise
                 // we compute the docsWithField Bits twice!
@@ -638,7 +678,7 @@ namespace Lucene.Net.Search
                 values[slot] = v2;
             }
 
-            public override FieldComparator<int> SetNextReader(AtomicReaderContext context)
+            public override FieldComparator SetNextReader(AtomicReaderContext context)
             {
                 // NOTE: must do this before calling super otherwise
                 // we compute the docsWithField Bits twice!
@@ -757,7 +797,7 @@ namespace Lucene.Net.Search
                 values[slot] = v2;
             }
 
-            public override FieldComparator<long> SetNextReader(AtomicReaderContext context)
+            public override FieldComparator SetNextReader(AtomicReaderContext context)
             {
                 // NOTE: must do this before calling super otherwise
                 // we compute the docsWithField Bits twice!
@@ -836,7 +876,7 @@ namespace Lucene.Net.Search
                 //assert !Float.isNaN(scores[slot]);
             }
 
-            public override FieldComparator<float> SetNextReader(AtomicReaderContext context)
+            public override FieldComparator SetNextReader(AtomicReaderContext context)
             {
                 return this;
             }
@@ -911,7 +951,7 @@ namespace Lucene.Net.Search
                 docIDs[slot] = docBase + doc;
             }
 
-            public override FieldComparator<int> SetNextReader(AtomicReaderContext context)
+            public override FieldComparator SetNextReader(AtomicReaderContext context)
             {
                 // TODO: can we "map" our docIDs to the current
                 // reader? saves having to then subtract on every
@@ -1033,7 +1073,7 @@ namespace Lucene.Net.Search
                     this.parent = parent;
                 }
 
-                public override FieldComparator<BytesRef> SetNextReader(AtomicReaderContext context)
+                public override FieldComparator SetNextReader(AtomicReaderContext context)
                 {
                     return parent.SetNextReader(context);
                 }
@@ -1131,7 +1171,7 @@ namespace Lucene.Net.Search
                 }
             }
 
-            public override FieldComparator<BytesRef> SetNextReader(AtomicReaderContext context)
+            public override FieldComparator SetNextReader(AtomicReaderContext context)
             {
                 int docBase = context.docBase;
                 termsIndex = FieldCache.DEFAULT.GetTermsIndex(context.AtomicReader, field);
@@ -1252,7 +1292,7 @@ namespace Lucene.Net.Search
                 docTerms.Get(doc, values[slot]);
             }
 
-            public override FieldComparator<BytesRef> SetNextReader(AtomicReaderContext context)
+            public override FieldComparator SetNextReader(AtomicReaderContext context)
             {
                 docTerms = FieldCache.DEFAULT.GetTerms(context.AtomicReader, field);
                 return this;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Search/MultiPhraseQuery.cs
----------------------------------------------------------------------
diff --git a/src/core/Search/MultiPhraseQuery.cs b/src/core/Search/MultiPhraseQuery.cs
index c525784..57cfe09 100644
--- a/src/core/Search/MultiPhraseQuery.cs
+++ b/src/core/Search/MultiPhraseQuery.cs
@@ -142,6 +142,7 @@ namespace Lucene.Net.Search
             {
                 this.parent = parent;
                 this.similarity = searcher.Similarity;
+                IndexReaderContext context = searcher.TopReaderContext;
 
                 // compute idf
                 var allTermStats = new List<TermStatistics>();
@@ -182,7 +183,7 @@ namespace Lucene.Net.Search
                                           IBits acceptDocs)
             {
                 //assert !termArrays.isEmpty();
-                var reader = context.Reader;
+                var reader = context.AtomicReader;
                 var liveDocs = acceptDocs;
 
                 var postingsFreqs = new PhraseQuery.PostingsAndFreq[parent.termArrays.Count];
@@ -284,7 +285,7 @@ namespace Lucene.Net.Search
 
             public override Explanation Explain(AtomicReaderContext context, int doc)
             {
-                var scorer = Scorer(context, true, false, context.Reader.LiveDocs);
+                var scorer = Scorer(context, true, false, context.AtomicReader.LiveDocs);
                 if (scorer != null)
                 {
                     var newDoc = scorer.Advance(doc);
@@ -316,7 +317,7 @@ namespace Lucene.Net.Search
             if (!termArrays.Any())
             {
                 var bq = new BooleanQuery();
-                bq.Boost = Boost);
+                bq.Boost = Boost;
                 return bq;
             }
             else if (termArrays.Count == 1)
@@ -325,7 +326,7 @@ namespace Lucene.Net.Search
                 var boq = new BooleanQuery(true);
                 foreach (var t in terms)
                 {
-                    boq.Add(new TermQuery(t), BooleanClause.Occur.SHOULD);
+                    boq.Add(new TermQuery(t), Occur.SHOULD);
                 }
                 boq.Boost = Boost;
                 return boq;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Search/MultiTermQueryWrapperFilter.cs
----------------------------------------------------------------------
diff --git a/src/core/Search/MultiTermQueryWrapperFilter.cs b/src/core/Search/MultiTermQueryWrapperFilter.cs
index d657e58..38b933b 100644
--- a/src/core/Search/MultiTermQueryWrapperFilter.cs
+++ b/src/core/Search/MultiTermQueryWrapperFilter.cs
@@ -79,7 +79,7 @@ namespace Lucene.Net.Search
 
         public override DocIdSet GetDocIdSet(AtomicReaderContext context, IBits acceptDocs)
         {
-            var reader = context.Reader;
+            var reader = context.AtomicReader;
             var fields = reader.Fields;
             if (fields == null)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Search/NRTManager.cs
----------------------------------------------------------------------
diff --git a/src/core/Search/NRTManager.cs b/src/core/Search/NRTManager.cs
index 7eaa5bb..b6f4b27 100644
--- a/src/core/Search/NRTManager.cs
+++ b/src/core/Search/NRTManager.cs
@@ -29,7 +29,7 @@ namespace Lucene.Net.Search
                 searcherFactory = new SearcherFactory();
             }
             this.searcherFactory = searcherFactory;
-            Current = SearcherManager.GetSearcher(searcherFactory, DirectoryReader.Open(writer.IndexWriter, applyAllDeletes));
+            current = SearcherManager.GetSearcher(searcherFactory, DirectoryReader.Open(writer.IndexWriter, applyAllDeletes));
         }
 
         protected override void DecRef(IndexSearcher reference)
@@ -67,25 +67,25 @@ namespace Lucene.Net.Search
                 this.writer = writer;
             }
 
-            public virtual long UpdateDocument(Term t, IIndexableField d, Analyzer a)
+            public virtual long UpdateDocument(Term t, IEnumerable<IIndexableField> d, Analyzer a)
             {
                 writer.UpdateDocument(t, d, a);
                 return Interlocked.Read(ref indexingGen);
             }
 
-            public virtual long UpdateDocument(Term t, IIndexableField d)
+            public virtual long UpdateDocument(Term t, IEnumerable<IIndexableField> d)
             {
                 writer.UpdateDocument(t, d);
                 return Interlocked.Read(ref indexingGen);
             }
 
-            public virtual long UpdateDocuments(Term t, IEnumerable<IIndexableField> docs, Analyzer a)
+            public virtual long UpdateDocuments(Term t, IEnumerable<IEnumerable<IIndexableField>> docs, Analyzer a)
             {
                 writer.UpdateDocuments(t, docs, a);
                 return Interlocked.Read(ref indexingGen);
             }
 
-            public virtual long UpdateDocuments(Term t, IEnumerable<IIndexableField> docs)
+            public virtual long UpdateDocuments(Term t, IEnumerable<IEnumerable<IIndexableField>> docs)
             {
                 writer.UpdateDocuments(t, docs);
                 return Interlocked.Read(ref indexingGen);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Search/NumericRangeQuery.cs
----------------------------------------------------------------------
diff --git a/src/core/Search/NumericRangeQuery.cs b/src/core/Search/NumericRangeQuery.cs
index 1b4e90c..c1a2acb 100644
--- a/src/core/Search/NumericRangeQuery.cs
+++ b/src/core/Search/NumericRangeQuery.cs
@@ -177,7 +177,7 @@ namespace Lucene.Net.Search
             {
                 return TermsEnum.EMPTY;
             }
-            return new NumericRangeTermsEnum(terms.Iterator(null));
+            return new NumericRangeTermsEnum(this, terms.Iterator(null));
         }
 
 	    /// <summary>Returns the field name for this query </summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Search/Payloads/PayloadNearQuery.cs
----------------------------------------------------------------------
diff --git a/src/core/Search/Payloads/PayloadNearQuery.cs b/src/core/Search/Payloads/PayloadNearQuery.cs
index ddef9cb..6159fad 100644
--- a/src/core/Search/Payloads/PayloadNearQuery.cs
+++ b/src/core/Search/Payloads/PayloadNearQuery.cs
@@ -112,15 +112,18 @@ namespace Lucene.Net.Search.Payloads
 
         public class PayloadNearSpanScorer : SpanScorer
         {
+            private readonly PayloadNearQuery parent;
+
             private readonly BytesRef scratch = new BytesRef();
-            protected float payloadScore;
+            protected internal float payloadScore;
             internal int payloadsSeen;
             private SpansBase spans;
 
-            protected PayloadNearSpanScorer(SpansBase spans, Weight weight,
+            public PayloadNearSpanScorer(PayloadNearQuery parent, SpansBase spans, Weight weight,
                                             Similarity similarity, Similarity.SloppySimScorer docScorer)
                 : base(spans, weight, docScorer)
             {
+                this.parent = parent;
                 this.spans = spans;
             }
 
@@ -159,7 +162,7 @@ namespace Lucene.Net.Search.Payloads
                     scratch.bytes = thePayload;
                     scratch.offset = 0;
                     scratch.length = thePayload.Length;
-                    payloadScore = function.CurrentScore(doc, fieldName, start, end,
+                    payloadScore = parent.function.CurrentScore(doc, parent.fieldName, start, end,
                                                          payloadsSeen, payloadScore, docScorer.ComputePayloadFactor(doc, spans.Start, spans.End, scratch));
                     ++payloadsSeen;
                 }
@@ -179,7 +182,7 @@ namespace Lucene.Net.Search.Payloads
                 {
                     int matchLength = spans.End - spans.Start;
                     freq += docScorer.ComputeSlopFactor(matchLength);
-                    var spansArr = new Spans[1];
+                    var spansArr = new SpansBase[1];
                     spansArr[0] = spans;
                     GetPayloads(spansArr);
                     more = spans.Next();
@@ -190,21 +193,24 @@ namespace Lucene.Net.Search.Payloads
             public float Score()
             {
                 return base.Score()
-                       * function.DocScore(doc, fieldName, payloadsSeen, payloadScore);
+                       * parent.function.DocScore(doc, parent.fieldName, payloadsSeen, payloadScore);
             }
         }
 
         public class PayloadNearSpanWeight : SpanWeight
         {
-            public PayloadNearSpanWeight(SpanQuery query, IndexSearcher searcher)
+            private readonly PayloadNearQuery parent;
+
+            public PayloadNearSpanWeight(PayloadNearQuery query, IndexSearcher searcher)
                 : base(query, searcher)
             {
+                this.parent = query;
             }
-
+            
             public override Scorer Scorer(AtomicReaderContext context, bool scoreDocsInOrder,
                                           bool topScorer, IBits acceptDocs)
             {
-                return new PayloadNearSpanScorer(query.GetSpans(context, acceptDocs, termContexts), this,
+                return new PayloadNearSpanScorer(parent, query.GetSpans(context, acceptDocs, termContexts), this,
                                                  similarity, similarity.GetSloppySimScorer(stats, context));
             }
 
@@ -226,7 +232,7 @@ namespace Lucene.Net.Search.Payloads
                         expl.Value = scoreExplanation.Value;
                         String field = ((SpanQuery)Query).Field;
                         // now the payloads part
-                        Explanation payloadExpl = function.Explain(doc, field, scorer.payloadsSeen, scorer.payloadScore);
+                        Explanation payloadExpl = parent.function.Explain(doc, field, scorer.payloadsSeen, scorer.payloadScore);
                         // combined
                         var result = new ComplexExplanation();
                         result.AddDetail(expl);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Search/Payloads/PayloadSpanUtil.cs
----------------------------------------------------------------------
diff --git a/src/core/Search/Payloads/PayloadSpanUtil.cs b/src/core/Search/Payloads/PayloadSpanUtil.cs
index 11f5249..3834e60 100644
--- a/src/core/Search/Payloads/PayloadSpanUtil.cs
+++ b/src/core/Search/Payloads/PayloadSpanUtil.cs
@@ -1,4 +1,5 @@
 using System.Collections.Generic;
+using System.Linq;
 using Lucene.Net.Index;
 using Lucene.Net.Search;
 using Lucene.Net.Search.Spans;
@@ -115,7 +116,7 @@ public class PayloadSpanUtil
                     IList<Query> disjuncts = disjunctLists[i];
                     if (disjuncts != null)
                     {
-                        clauses[position++] = new SpanOrQuery(disjuncts.ToArray(new SpanQuery[disjuncts.Count]));
+                        clauses[position++] = new SpanOrQuery(disjuncts.OfType<SpanQuery>().ToArray());
                     }
                     else
                     {
@@ -145,7 +146,7 @@ public class PayloadSpanUtil
         }
         foreach (AtomicReaderContext atomicReaderContext in context.Leaves)
         {
-            SpansBase spans = query.GetSpans(atomicReaderContext, atomicReaderContext.Reader.LiveDocs, termContexts);
+            SpansBase spans = query.GetSpans(atomicReaderContext, atomicReaderContext.AtomicReader.LiveDocs, termContexts);
             while (spans.Next())
             {
                 if (spans.IsPayloadAvailable())

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Search/Payloads/PayloadTermQuery.cs
----------------------------------------------------------------------
diff --git a/src/core/Search/Payloads/PayloadTermQuery.cs b/src/core/Search/Payloads/PayloadTermQuery.cs
index 3426bac..6b9db10 100644
--- a/src/core/Search/Payloads/PayloadTermQuery.cs
+++ b/src/core/Search/Payloads/PayloadTermQuery.cs
@@ -6,185 +6,227 @@ using Lucene.Net.Search.Similarities;
 using Lucene.Net.Search.Spans;
 using Lucene.Net.Util;
 
-public class PayloadTermQuery : SpanTermQuery {
-  protected PayloadFunction function;
-  private bool includeSpanScore;
-
-    public PayloadTermQuery(Term term, PayloadFunction function) : this(term, function, true) {}
-
-    public PayloadTermQuery(Term term, PayloadFunction function,
-      bool includeSpanScore) : base(term) {
-    this.function = function;
-    this.includeSpanScore = includeSpanScore;
-  }
-
-  public override Weight CreateWeight(IndexSearcher searcher)  {
-    return new PayloadTermWeight(this, searcher);
-  }
-
-  protected class PayloadTermWeight : SpanWeight {
-
-    public PayloadTermWeight(PayloadTermQuery query, IndexSearcher searcher) : base(query, searcher) {
-    }
-
-    public override Scorer Scorer(AtomicReaderContext context, bool scoreDocsInOrder,
-        bool topScorer, IBits acceptDocs)  {
-      return new PayloadTermSpanScorer((TermSpans) query.GetSpans(context, acceptDocs, termContexts),
-          this, similarity.GetSloppySimScorer(stats, context));
-    }
-
-    protected class PayloadTermSpanScorer : SpanScorer {
-      protected BytesRef payload;
-      protected float payloadScore;
-      protected int payloadsSeen;
-      private readonly TermSpans termSpans;
-
-      public PayloadTermSpanScorer(TermSpans spans, Weight weight, Similarity.SloppySimScorer docScorer) :base(spans, weight, docScorer) {
-        termSpans = spans;
-      }
+namespace Lucene.Net.Search.Payloads
+{
+    public class PayloadTermQuery : SpanTermQuery
+    {
+        protected PayloadFunction function;
+        private bool includeSpanScore;
+
+        public PayloadTermQuery(Term term, PayloadFunction function) : this(term, function, true) { }
+
+        public PayloadTermQuery(Term term, PayloadFunction function,
+          bool includeSpanScore)
+            : base(term)
+        {
+            this.function = function;
+            this.includeSpanScore = includeSpanScore;
+        }
 
-      protected override bool SetFreqCurrentDoc()  {
-        if (!more) {
-          return false;
+        public override Weight CreateWeight(IndexSearcher searcher)
+        {
+            return new PayloadTermWeight(this, searcher);
         }
-        doc = spans.Doc;
-        freq = 0.0f;
-        numMatches = 0;
-        payloadScore = 0;
-        payloadsSeen = 0;
-        while (more && doc == spans.Doc) {
-          int matchLength = spans.End - spans.Start;
-
-          freq += docScorer.ComputeSlopFactor(matchLength);
-          numMatches++;
-          ProcessPayload(similarity);
-
-          more = spans.Next();// this moves positions to the next match in this
-                              // document
+
+        protected class PayloadTermWeight : SpanWeight
+        {
+            protected readonly PayloadTermQuery parent;
+            
+            public PayloadTermWeight(PayloadTermQuery query, IndexSearcher searcher)
+                : base(query, searcher)
+            {
+                this.parent = query;
+            }
+
+            public override Scorer Scorer(AtomicReaderContext context, bool scoreDocsInOrder,
+                bool topScorer, IBits acceptDocs)
+            {
+                return new PayloadTermSpanScorer(this, (TermSpans)query.GetSpans(context, acceptDocs, termContexts),
+                    this, similarity.GetSloppySimScorer(stats, context));
+            }
+
+            protected class PayloadTermSpanScorer : SpanScorer
+            {
+                private readonly PayloadTermWeight parent;
+
+                protected BytesRef payload;
+                protected internal float payloadScore;
+                protected internal int payloadsSeen;
+                private readonly TermSpans termSpans;
+
+                public PayloadTermSpanScorer(PayloadTermWeight parent, TermSpans spans, Weight weight, Similarity.SloppySimScorer docScorer)
+                    : base(spans, weight, docScorer)
+                {
+                    this.parent = parent;
+                    termSpans = spans;
+                }
+
+                protected override bool SetFreqCurrentDoc()
+                {
+                    if (!more)
+                    {
+                        return false;
+                    }
+                    doc = spans.Doc;
+                    freq = 0.0f;
+                    numMatches = 0;
+                    payloadScore = 0;
+                    payloadsSeen = 0;
+                    while (more && doc == spans.Doc)
+                    {
+                        int matchLength = spans.End - spans.Start;
+
+                        freq += docScorer.ComputeSlopFactor(matchLength);
+                        numMatches++;
+                        ProcessPayload(parent.similarity);
+
+                        more = spans.Next();// this moves positions to the next match in this
+                        // document
+                    }
+                    return more || (freq != 0);
+                }
+
+                protected void ProcessPayload(Similarity similarity)
+                {
+                    if (termSpans.IsPayloadAvailable())
+                    {
+                        DocsAndPositionsEnum postings = termSpans.Postings;
+                        payload = postings.Payload;
+                        if (payload != null)
+                        {
+                            payloadScore = parent.parent.function.CurrentScore(doc, parent.parent.term.Field,
+                                                                 spans.Start, spans.End, payloadsSeen, payloadScore,
+                                                                 docScorer.ComputePayloadFactor(doc, spans.Start, spans.End, payload));
+                        }
+                        else
+                        {
+                            payloadScore = parent.parent.function.CurrentScore(doc, parent.parent.term.Field,
+                                                                 spans.Start, spans.End, payloadsSeen, payloadScore, 1F);
+                        }
+                        payloadsSeen++;
+
+                    }
+                    else
+                    {
+                        // zero out the payload?
+                    }
+                }
+
+                /**
+                 * 
+                 * @return {@link #getSpanScore()} * {@link #getPayloadScore()}
+                 * @throws IOException if there is a low-level I/O error
+                 */
+                public override float Score()
+                {
+
+                    return parent.parent.includeSpanScore ? GetSpanScore() * GetPayloadScore()
+                        : GetPayloadScore();
+                }
+
+                /**
+                 * Returns the SpanScorer score only.
+                 * <p/>
+                 * Should not be overridden without good cause!
+                 * 
+                 * @return the score for just the Span part w/o the payload
+                 * @throws IOException if there is a low-level I/O error
+                 * 
+                 * @see #score()
+                 */
+                protected float GetSpanScore()
+                {
+                    return base.Score();
+                }
+
+                /**
+                 * The score for the payload
+                 * 
+                 * @return The score, as calculated by
+                 *         {@link PayloadFunction#docScore(int, String, int, float)}
+                 */
+                protected internal float GetPayloadScore()
+                {
+                    return parent.parent.function.DocScore(doc, parent.parent.term.Field, payloadsSeen, payloadScore);
+                }
+            }
+
+            public override Explanation Explain(AtomicReaderContext context, int doc)
+            {
+                PayloadTermSpanScorer scorer = (PayloadTermSpanScorer)Scorer(context, true, false, context.AtomicReader.LiveDocs);
+                if (scorer != null)
+                {
+                    int newDoc = scorer.Advance(doc);
+                    if (newDoc == doc)
+                    {
+                        float freq = scorer.SloppyFreq();
+                        Similarity.SloppySimScorer docScorer = similarity.GetSloppySimScorer(stats, context);
+                        Explanation expl = new Explanation();
+                        expl.Description = "weight(" + Query + " in " + doc + ") [" + similarity.GetType().Name + "], result of:";
+                        Explanation scoreExplanation = docScorer.Explain(doc, new Explanation(freq, "phraseFreq=" + freq));
+                        expl.AddDetail(scoreExplanation);
+                        expl.Value = scoreExplanation.Value;
+                        // now the payloads part
+                        // QUESTION: Is there a way to avoid this skipTo call? We need to know
+                        // whether to load the payload or not
+                        // GSI: I suppose we could toString the payload, but I don't think that
+                        // would be a good idea
+                        string field = ((SpanQuery)Query).Field;
+                        Explanation payloadExpl = parent.function.Explain(doc, field, scorer.payloadsSeen, scorer.payloadScore);
+                        payloadExpl.Value = scorer.GetPayloadScore();
+                        // combined
+                        ComplexExplanation result = new ComplexExplanation();
+                        if (parent.includeSpanScore)
+                        {
+                            result.AddDetail(expl);
+                            result.AddDetail(payloadExpl);
+                            result.Value = expl.Value * payloadExpl.Value;
+                            result.Description = "btq, product of:";
+                        }
+                        else
+                        {
+                            result.AddDetail(payloadExpl);
+                            result.Value = payloadExpl.Value;
+                            result.Description = "btq(includeSpanScore=false), result of:";
+                        }
+                        result.Match = true; // LUCENE-1303
+                        return result;
+                    }
+                }
+
+                return new ComplexExplanation(false, 0.0f, "no matching term");
+            }
         }
-        return more || (freq != 0);
-      }
-
-      protected void ProcessPayload(Similarity similarity)  {
-        if (termSpans.IsPayloadAvailable()) {
-          DocsAndPositionsEnum postings = termSpans.Postings;
-          payload = postings.Payload;
-          if (payload != null) {
-            payloadScore = function.CurrentScore(doc, term.field(),
-                                                 spans.Start, spans.End, payloadsSeen, payloadScore,
-                                                 docScorer.ComputePayloadFactor(doc, spans.Start, spans.End, payload));
-          } else {
-            payloadScore = function.CurrentScore(doc, term.field(),
-                                                 spans.Start, spans.End, payloadsSeen, payloadScore, 1F);
-          }
-          payloadsSeen++;
-
-        } else {
-          // zero out the payload?
+
+        public override int GetHashCode()
+        {
+            int prime = 31;
+            int result = base.GetHashCode();
+            result = prime * result + ((function == null) ? 0 : function.GetHashCode());
+            result = prime * result + (includeSpanScore ? 1231 : 1237);
+            return result;
         }
-      }
-
-      /**
-       * 
-       * @return {@link #getSpanScore()} * {@link #getPayloadScore()}
-       * @throws IOException if there is a low-level I/O error
-       */
-      public override float Score()  {
-
-        return includeSpanScore ? GetSpanScore() * GetPayloadScore()
-            : GetPayloadScore();
-      }
-
-      /**
-       * Returns the SpanScorer score only.
-       * <p/>
-       * Should not be overridden without good cause!
-       * 
-       * @return the score for just the Span part w/o the payload
-       * @throws IOException if there is a low-level I/O error
-       * 
-       * @see #score()
-       */
-      protected float GetSpanScore()  {
-        return base.Score();
-      }
-
-      /**
-       * The score for the payload
-       * 
-       * @return The score, as calculated by
-       *         {@link PayloadFunction#docScore(int, String, int, float)}
-       */
-      protected float GetPayloadScore() {
-        return function.DocScore(doc, term.field(), payloadsSeen, payloadScore);
-      }
-    }
-    
-    public override Explanation Explain(AtomicReaderContext context, int doc)  {
-      PayloadTermSpanScorer scorer = (PayloadTermSpanScorer) Scorer(context, true, false, context.Reader.LiveDocs);
-      if (scorer != null) {
-        int newDoc = scorer.Advance(doc);
-        if (newDoc == doc) {
-          float freq = scorer.SloppyFreq();
-          Similarity.SloppySimScorer docScorer = Similarity.SloppySimScorer(stats, context);
-          Explanation expl = new Explanation();
-          expl.Description = "weight("+Query+" in "+doc+") [" + similarity.GetType().Name + "], result of:";
-          Explanation scoreExplanation = docScorer.Explain(doc, new Explanation(freq, "phraseFreq=" + freq));
-          expl.AddDetail(scoreExplanation);
-          expl.Value = scoreExplanation.Value;
-          // now the payloads part
-          // QUESTION: Is there a way to avoid this skipTo call? We need to know
-          // whether to load the payload or not
-          // GSI: I suppose we could toString the payload, but I don't think that
-          // would be a good idea
-          string field = ((SpanQuery)Query).Field;
-          Explanation payloadExpl = function.Explain(doc, field, scorer.payloadsSeen, scorer.payloadScore);
-          payloadExpl.Value = scorer.GetPayloadScore();
-          // combined
-          ComplexExplanation result = new ComplexExplanation();
-          if (includeSpanScore) {
-            result.AddDetail(expl);
-            result.AddDetail(payloadExpl);
-            result.Value = expl.Value * payloadExpl.Value;
-            result.Description = "btq, product of:";
-          } else {
-            result.AddDetail(payloadExpl);
-            result.Value = payloadExpl.Value;
-            result.Description ="btq(includeSpanScore=false), result of:";
-          }
-          result.Match = true; // LUCENE-1303
-          return result;
+
+        public override bool Equals(Object obj)
+        {
+            if (this == obj)
+                return true;
+            if (!base.Equals(obj))
+                return false;
+            if (GetType() != obj.GetType())
+                return false;
+            PayloadTermQuery other = (PayloadTermQuery)obj;
+            if (function == null)
+            {
+                if (other.function != null)
+                    return false;
+            }
+            else if (!function.Equals(other.function))
+                return false;
+            if (includeSpanScore != other.includeSpanScore)
+                return false;
+            return true;
         }
-      }
-      
-      return new ComplexExplanation(false, 0.0f, "no matching term");
-    }
-  }
-
-  public override int GetHashCode() {
-    int prime = 31;
-    int result = base.GetHashCode();
-    result = prime * result + ((function == null) ? 0 : function.GetHashCode());
-    result = prime * result + (includeSpanScore ? 1231 : 1237);
-    return result;
-  }
-
-  public override bool Equals(Object obj) {
-    if (this == obj)
-      return true;
-    if (!base.Equals(obj))
-      return false;
-    if (GetType() != obj.GetType())
-      return false;
-    PayloadTermQuery other = (PayloadTermQuery) obj;
-    if (function == null) {
-      if (other.function != null)
-        return false;
-    } else if (!function.Equals(other.function))
-      return false;
-    if (includeSpanScore != other.includeSpanScore)
-      return false;
-    return true;
-  }
 
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Search/PhraseQuery.cs
----------------------------------------------------------------------
diff --git a/src/core/Search/PhraseQuery.cs b/src/core/Search/PhraseQuery.cs
index 5e1340f..cc3a63c 100644
--- a/src/core/Search/PhraseQuery.cs
+++ b/src/core/Search/PhraseQuery.cs
@@ -277,7 +277,7 @@ namespace Lucene.Net.Search
             {
                 // assert !terms.isEmpty()
 
-                var reader = context.Reader;
+                var reader = context.AtomicReader;
                 var liveDocs = acceptDocs;
                 var postingsFreqs = new PostingsAndFreq[parent.terms.Count];
 
@@ -318,7 +318,7 @@ namespace Lucene.Net.Search
                 if (parent.slop == 0)
                 {
                     var s = new ExactPhraseScorer(this, postingsFreqs, similarity.GetExactSimScorer(stats, context));
-                    if (s.NoDocs)
+                    if (s.noDocs)
                     {
                         return null;
                     }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Search/QueryWrapperFilter.cs
----------------------------------------------------------------------
diff --git a/src/core/Search/QueryWrapperFilter.cs b/src/core/Search/QueryWrapperFilter.cs
index 2eb1a94..3dc72f8 100644
--- a/src/core/Search/QueryWrapperFilter.cs
+++ b/src/core/Search/QueryWrapperFilter.cs
@@ -73,9 +73,9 @@ namespace Lucene.Net.Search
 		
 		public override DocIdSet GetDocIdSet(AtomicReaderContext context, IBits acceptDocs)
 		{
-		    var privateContext = context.Reader.Context;
+		    var privateContext = context.AtomicReader.AtomicContext;
 		    var weight = new IndexSearcher(privateContext).CreateNormalizedWeight(query);
-            return new AnonymousClassDocIdSet(this);
+            return new AnonymousClassDocIdSet(weight, privateContext, acceptDocs);
 		}
 		
 		public override string ToString()

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Search/ReqExclScorer.cs
----------------------------------------------------------------------
diff --git a/src/core/Search/ReqExclScorer.cs b/src/core/Search/ReqExclScorer.cs
index 4c8fe5e..d910514 100644
--- a/src/core/Search/ReqExclScorer.cs
+++ b/src/core/Search/ReqExclScorer.cs
@@ -124,7 +124,7 @@ namespace Lucene.Net.Search
         {
             get
             {
-                return reqScorer.Freq();
+                return reqScorer.Freq;
             }
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Search/ScoreCachingWrappingScorer.cs
----------------------------------------------------------------------
diff --git a/src/core/Search/ScoreCachingWrappingScorer.cs b/src/core/Search/ScoreCachingWrappingScorer.cs
index aecfa92..55898b7 100644
--- a/src/core/Search/ScoreCachingWrappingScorer.cs
+++ b/src/core/Search/ScoreCachingWrappingScorer.cs
@@ -65,7 +65,7 @@ namespace Lucene.Net.Search
         {
             get
             {
-                return scorer.Freq();
+                return scorer.Freq;
             }
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Search/ScoringRewrite.cs
----------------------------------------------------------------------
diff --git a/src/core/Search/ScoringRewrite.cs b/src/core/Search/ScoringRewrite.cs
index a4d2d6b..8ae3ac3 100644
--- a/src/core/Search/ScoringRewrite.cs
+++ b/src/core/Search/ScoringRewrite.cs
@@ -40,9 +40,9 @@ namespace Lucene.Net.Search
         {
             public override Query Rewrite(IndexReader reader, MultiTermQuery query) 
             {
-              var bq = SCORING_BOOLEAN_QUERY_REWRITE.Rewrite(reader, query);
+              var bq = (BooleanQuery)SCORING_BOOLEAN_QUERY_REWRITE.Rewrite(reader, query);
               // TODO: if empty boolean query return NullQuery?
-              if (!bq.Clauses.Any())
+              if (bq.Clauses.Length == 0)
                 return bq;
               // strip the scores off
               var result = new ConstantScoreQuery(bq) {Boost = query.Boost};

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Search/Similarities/SimilarityBase.cs
----------------------------------------------------------------------
diff --git a/src/core/Search/Similarities/SimilarityBase.cs b/src/core/Search/Similarities/SimilarityBase.cs
index 7acd358..4166a7b 100644
--- a/src/core/Search/Similarities/SimilarityBase.cs
+++ b/src/core/Search/Similarities/SimilarityBase.cs
@@ -41,7 +41,7 @@ namespace Lucene.Net.Search.Similarities
                                               TermStatistics termStats)
         {
             // assert collectionStats.sumTotalTermFreq() == -1 || collectionStats.sumTotalTermFreq() >= termStats.totalTermFreq();
-            var numberOfDocuments = collectionStats.MaxDocs;
+            var numberOfDocuments = collectionStats.MaxDoc;
 
             var docFreq = termStats.DocFreq;
             var totalTermFreq = termStats.TotalTermFreq;
@@ -104,7 +104,7 @@ namespace Lucene.Net.Search.Similarities
                 for (int i = 0; i < subScorers.Length; i++)
                 {
                     var basicstats = (BasicStats) subStats[i];
-                    subScorers[i] = new BasicExactDocScorer(basicstats, context.Reader.GetNormValues(basicstats.Field),
+                    subScorers[i] = new BasicExactDocScorer(basicstats, context.AtomicReader.GetNormValues(basicstats.Field),
                                                             this);
                 }
                 return new MultiSimilarity.MultiExactDocScorer(subScorers);
@@ -112,7 +112,7 @@ namespace Lucene.Net.Search.Similarities
             else
             {
                 var basicstats = (BasicStats) stats;
-                return new BasicExactDocScorer(basicstats, context.Reader.GetNormValues(basicstats.Field), this);
+                return new BasicExactDocScorer(basicstats, context.AtomicReader.GetNormValues(basicstats.Field), this);
             }
         }
 
@@ -126,7 +126,7 @@ namespace Lucene.Net.Search.Similarities
                 for (int i = 0; i < subScorers.Length; i++)
                 {
                     var basicstats = (BasicStats) subStats[i];
-                    subScorers[i] = new BasicSloppyDocScorer(basicstats, context.Reader.GetNormValues(basicstats.Field),
+                    subScorers[i] = new BasicSloppyDocScorer(basicstats, context.AtomicReader.GetNormValues(basicstats.Field),
                                                              this);
                 }
                 return new MultiSimilarity.MultiSloppyDocScorer(subScorers);
@@ -134,7 +134,7 @@ namespace Lucene.Net.Search.Similarities
             else
             {
                 var basicstats = (BasicStats) stats;
-                return new BasicSloppyDocScorer(basicstats, context.Reader.GetNormValues(basicstats.Field), this);
+                return new BasicSloppyDocScorer(basicstats, context.AtomicReader.GetNormValues(basicstats.Field), this);
             }
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Search/Similarities/TFIDFSimilarity.cs
----------------------------------------------------------------------
diff --git a/src/core/Search/Similarities/TFIDFSimilarity.cs b/src/core/Search/Similarities/TFIDFSimilarity.cs
index 232742a..e20dbfc 100644
--- a/src/core/Search/Similarities/TFIDFSimilarity.cs
+++ b/src/core/Search/Similarities/TFIDFSimilarity.cs
@@ -12,7 +12,7 @@ namespace Lucene.Net.Search.Similarities
         {
             for (int i = 0; i < 256; i++)
             {
-                NORM_TABLE[i] = SmallFloat.Byte315ToFloat((byte) i);
+                NORM_TABLE[i] = SmallFloat.Byte315ToFloat((sbyte) i);
             }
         }
 
@@ -87,13 +87,13 @@ namespace Lucene.Net.Search.Similarities
         public override sealed ExactSimScorer GetExactSimScorer(SimWeight stats, AtomicReaderContext context)
         {
             var idfstats = (IDFStats) stats;
-            return new ExactTFIDFDocScorer(idfstats, context.Reader.GetNormValues(idfstats.Field), this);
+            return new ExactTFIDFDocScorer(idfstats, context.AtomicReader.GetNormValues(idfstats.Field), this);
         }
 
         public override sealed SloppySimScorer GetSloppySimScorer(SimWeight stats, AtomicReaderContext context)
         {
             var idfstats = (IDFStats) stats;
-            return new SloppyTFIDFDocScorer(idfstats, context.Reader.GetNormValues(idfstats.Field), this);
+            return new SloppyTFIDFDocScorer(idfstats, context.AtomicReader.GetNormValues(idfstats.Field), this);
         }
 
         private Explanation ExplainScore(int doc, Explanation freq, IDFStats stats, NumericDocValues norms)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Search/Spans/NearSpansOrdered.cs
----------------------------------------------------------------------
diff --git a/src/core/Search/Spans/NearSpansOrdered.cs b/src/core/Search/Spans/NearSpansOrdered.cs
index a22ff84..43c711d 100644
--- a/src/core/Search/Spans/NearSpansOrdered.cs
+++ b/src/core/Search/Spans/NearSpansOrdered.cs
@@ -181,7 +181,7 @@ namespace Lucene.Net.Search.Spans
             if (firstTime)
             {
                 firstTime = false;
-                foreach (Spans t in subSpans)
+                foreach (SpansBase t in subSpans)
                 {
                     if (!t.Next())
                     {
@@ -356,7 +356,7 @@ namespace Lucene.Net.Search.Spans
             int lastEnd = matchEnd;
             for (int i = subSpans.Length - 2; i >= 0; i--)
             {
-                Spans prevSpans = subSpans[i];
+                SpansBase prevSpans = subSpans[i];
                 if (collectPayloads && prevSpans.IsPayloadAvailable())
                 {
                     ICollection<sbyte[]> payload = prevSpans.GetPayload();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/733dc181/src/core/Search/Spans/NearSpansUnordered.cs
----------------------------------------------------------------------
diff --git a/src/core/Search/Spans/NearSpansUnordered.cs b/src/core/Search/Spans/NearSpansUnordered.cs
index d472b87..f16c25e 100644
--- a/src/core/Search/Spans/NearSpansUnordered.cs
+++ b/src/core/Search/Spans/NearSpansUnordered.cs
@@ -183,7 +183,7 @@ namespace Lucene.Net.Search.Spans
 
             SpanQuery[] clauses = query.GetClauses();
             queue = new CellQueue(this, clauses.Length);
-            subSpans = new Spans[clauses.Length];
+            subSpans = new SpansBase[clauses.Length];
             for (int i = 0; i < clauses.Length; i++)
             {
                 SpansCell cell = new SpansCell(this, clauses[i].GetSpans(context, acceptDocs, termContexts), i);


Mime
View raw message