lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ccurr...@apache.org
Subject [Lucene.Net] svn commit: r1203041 [1/2] - in /incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk: src/core/ src/core/Analysis/Tokenattributes/ src/core/Index/ src/core/Search/ src/core/Store/ src/core/Support/ src/core/Util/ test/core/ test/core/Index/ test/core/...
Date Thu, 17 Nov 2011 03:49:34 GMT
Author: ccurrens
Date: Thu Nov 17 03:49:32 2011
New Revision: 1203041

URL: http://svn.apache.org/viewvc?rev=1203041&view=rev
Log:
updated tests and fixed core/test porting errors

Modified:
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/Tokenattributes/PayloadAttributeImpl.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/AssemblyInfo.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/FileDiffs.txt
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/BufferedDeletes.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/IndexWriter.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/ParallelReader.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/SegmentInfos.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/Term.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FieldValueHitQueue.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/Searchable.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/Searcher.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/SortField.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/IndexInput.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/SimpleFSLockFactory.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Support/FileSupport.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/CloseableThreadLocal.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriter.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestParallelReader.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Search/TestCustomSearcherSort.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Search/TestSetNorm.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Search/TestTermRangeQuery.cs
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/UpdatedTests.txt
    incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Util/_TestUtil.cs

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/Tokenattributes/PayloadAttributeImpl.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/Tokenattributes/PayloadAttributeImpl.cs?rev=1203041&r1=1203040&r2=1203041&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/Tokenattributes/PayloadAttributeImpl.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Analysis/Tokenattributes/PayloadAttributeImpl.cs Thu Nov 17 03:49:32 2011
@@ -59,9 +59,16 @@ namespace Lucene.Net.Analysis.Tokenattri
 		
 		public override System.Object Clone()
 		{
-            PayloadAttributeImpl impl = new PayloadAttributeImpl();
-            impl.payload = new Payload(this.payload.data, this.payload.offset, this.payload.length);
-            return impl;
+		    var clone = (PayloadAttributeImpl) base.Clone();
+            if (payload != null)
+            {
+                clone.payload = (Payload) payload.Clone();
+            }
+		    return clone;
+            // TODO: This code use to be as below.  Any reason why?  the if(payload!=null) was missing...
+		    //PayloadAttributeImpl impl = new PayloadAttributeImpl();
+		    //impl.payload = new Payload(this.payload.data, this.payload.offset, this.payload.length);
+		    //return impl;
 		}
 		
 		public  override bool Equals(System.Object other)

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/AssemblyInfo.cs?rev=1203041&r1=1203040&r2=1203041&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/AssemblyInfo.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/AssemblyInfo.cs Thu Nov 17 03:49:32 2011
@@ -36,7 +36,7 @@ using System.Runtime.CompilerServices;
 
 [assembly: CLSCompliant(true)]
 
-[assembly: AssemblyInformationalVersionAttribute("2.9.4")]
+[assembly: AssemblyInformationalVersionAttribute("3.0.3")]
 
 // for testing
 [assembly: InternalsVisibleTo("Lucene.Net.Test, PublicKey=002400000480000094000000060200000024000052534131000400000100010075a07ce602f88e" +

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/FileDiffs.txt
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/FileDiffs.txt?rev=1203041&r1=1203040&r2=1203041&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/FileDiffs.txt (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/FileDiffs.txt Thu Nov 17 03:49:32 2011
@@ -162,7 +162,7 @@ index\
 	index\NormsWriterPerField.java - Text files are different
 	index\NormsWriterPerThread.java - Text files are different
 	index\package.html - IDENTICAL
-	index\ParallelReader.java - Text files are different
+	index\ParallelReader.java - DONE
 	index\Payload.java - Text files are different
 	index\PositionBasedTermVectorMapper.java - Text files are different
 	index\RawPostingList.java - IDENTICAL
@@ -352,8 +352,8 @@ search
 	ScoreDoc.java - Text files are different
 	ScoreDocComparator.java - Removed in 3.x
 	Scorer.java - Text files are different
-	Searchable.java - Text files are different
-	Searcher.java - Text files are different
+	Searchable.java - DONE
+	Searcher.java - DONE
 	Similarity.java - PORTED
 	SimilarityDelegator.java - PORTED
 	SingleTermEnum.java - PORTED

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/BufferedDeletes.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/BufferedDeletes.cs?rev=1203041&r1=1203040&r2=1203041&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/BufferedDeletes.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/BufferedDeletes.cs Thu Nov 17 03:49:32 2011
@@ -97,12 +97,12 @@ namespace Lucene.Net.Index
 			numTerms += in_Renamed.numTerms;
 			bytesUsed += in_Renamed.bytesUsed;
 		    foreach (KeyValuePair<Term, Num> term in in_Renamed.terms)
-		    {
-		        terms.Add(term);
+            {
+                terms[term.Key] = term.Value;
 		    }
             foreach (KeyValuePair<Query, int> term in in_Renamed.queries)
             {
-                queries.Add(term);
+                queries[term.Key] = term.Value;
             }
 
 			docIDs.AddRange(in_Renamed.docIDs);
@@ -134,7 +134,6 @@ namespace Lucene.Net.Index
 		{
 			lock (this)
 			{
-				
 				IDictionary<Term, Num> newDeleteTerms;
 				
 				// Remap delete-by-term
@@ -179,7 +178,7 @@ namespace Lucene.Net.Index
                     newDeleteQueries = new HashMap<Query, int>(queries.Count);
 					foreach(var entry in queries)
 					{
-						int num = (int)entry.Value;
+						int num = entry.Value;
 						newDeleteQueries[entry.Key] = mapper.Remap(num);
 					}
 				}

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/IndexWriter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/IndexWriter.cs?rev=1203041&r1=1203040&r2=1203041&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/IndexWriter.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/IndexWriter.cs Thu Nov 17 03:49:32 2011
@@ -4170,7 +4170,6 @@ namespace Lucene.Net.Index
 		{
 			lock (this)
 			{
-				
 				if (hitOOM)
 				{
 					throw new System.SystemException("this writer hit an OutOfMemoryError; cannot flush");

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/ParallelReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/ParallelReader.cs?rev=1203041&r1=1203040&r2=1203041&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/ParallelReader.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/ParallelReader.cs Thu Nov 17 03:49:32 2011
@@ -16,7 +16,9 @@
  */
 
 using System;
-
+using System.Collections.Generic;
+using System.Linq;
+using Lucene.Net.Support;
 using Document = Lucene.Net.Documents.Document;
 using FieldSelector = Lucene.Net.Documents.FieldSelector;
 using FieldSelectorResult = Lucene.Net.Documents.FieldSelectorResult;
@@ -43,12 +45,12 @@ namespace Lucene.Net.Index
 	/// </summary>
 	public class ParallelReader:IndexReader, System.ICloneable
 	{
-		private System.Collections.ArrayList readers = new System.Collections.ArrayList();
-		private System.Collections.IList decrefOnClose = new System.Collections.ArrayList(); // remember which subreaders to decRef on close
+        private List<IndexReader> readers = new List<IndexReader>();
+        private List<bool> decrefOnClose = new List<bool>(); // remember which subreaders to decRef on close
 		internal bool incRefReaders = false;
-		private System.Collections.SortedList fieldToReader = new System.Collections.SortedList();
-		private System.Collections.IDictionary readerToFields = new System.Collections.Hashtable();
-		private System.Collections.IList storedFieldReaders = new System.Collections.ArrayList();
+		private SortedDictionary<string, IndexReader> fieldToReader = new SortedDictionary<string, IndexReader>();
+		private IDictionary<IndexReader, ICollection<string>> readerToFields = new HashMap<IndexReader, ICollection<string>>();
+        private List<IndexReader> storedFieldReaders = new List<IndexReader>();
 		
 		private int maxDoc;
 		private int numDocs;
@@ -107,14 +109,13 @@ namespace Lucene.Net.Index
 			if (reader.NumDocs() != numDocs)
 				throw new System.ArgumentException("All readers must have same numDocs: " + numDocs + "!=" + reader.NumDocs());
 			
-			System.Collections.Generic.ICollection<string> fields = reader.GetFieldNames(IndexReader.FieldOption.ALL);
+			ICollection<string> fields = reader.GetFieldNames(IndexReader.FieldOption.ALL);
 			readerToFields[reader] = fields;
-			System.Collections.IEnumerator i = fields.GetEnumerator();
-			while (i.MoveNext())
+			foreach(var field in fields)
 			{
 				// update fieldToReader map
-				System.String field = (System.String) i.Current;
-				if (fieldToReader[field] == null)
+                // Do a containskey firt to mimic java behavior
+				if (!fieldToReader.ContainsKey(field) || fieldToReader[field] == null)
 					fieldToReader[field] = reader;
 			}
 			
@@ -172,15 +173,14 @@ namespace Lucene.Net.Index
 			EnsureOpen();
 			
 			bool reopened = false;
-			System.Collections.IList newReaders = new System.Collections.ArrayList();
+            IList<IndexReader> newReaders = new List<IndexReader>();
 			
 			bool success = false;
 			
 			try
 			{
-				for (int i = 0; i < readers.Count; i++)
+				foreach(var oldReader in readers)
 				{
-					IndexReader oldReader = (IndexReader) readers[i];
 					IndexReader newReader = null;
 					if (doClone)
 					{
@@ -206,7 +206,7 @@ namespace Lucene.Net.Index
 				{
 					for (int i = 0; i < newReaders.Count; i++)
 					{
-						IndexReader r = (IndexReader) newReaders[i];
+						IndexReader r = newReaders[i];
 						if (r != readers[i])
 						{
 							try
@@ -224,12 +224,12 @@ namespace Lucene.Net.Index
 			
 			if (reopened)
 			{
-				System.Collections.IList newDecrefOnClose = new System.Collections.ArrayList();
+                List<bool> newDecrefOnClose = new List<bool>();
 				ParallelReader pr = new ParallelReader();
 				for (int i = 0; i < readers.Count; i++)
 				{
-					IndexReader oldReader = (IndexReader) readers[i];
-					IndexReader newReader = (IndexReader) newReaders[i];
+					IndexReader oldReader = readers[i];
+					IndexReader newReader = newReaders[i];
 					if (newReader == oldReader)
 					{
 						newDecrefOnClose.Add(true);
@@ -278,16 +278,16 @@ namespace Lucene.Net.Index
 		{
 			// Don't call ensureOpen() here (it could affect performance)
 			if (readers.Count > 0)
-				return ((IndexReader) readers[0]).IsDeleted(n);
+				return readers[0].IsDeleted(n);
 			return false;
 		}
 		
 		// delete in all readers
 		protected internal override void  DoDelete(int n)
 		{
-			for (int i = 0; i < readers.Count; i++)
+			foreach(var reader in readers)
 			{
-				((IndexReader) readers[i]).DeleteDocument(n);
+				reader.DeleteDocument(n);
 			}
 			hasDeletions = true;
 		}
@@ -295,9 +295,9 @@ namespace Lucene.Net.Index
 		// undeleteAll in all readers
 		protected internal override void  DoUndeleteAll()
 		{
-			for (int i = 0; i < readers.Count; i++)
+			foreach(var reader in readers)
 			{
-				((IndexReader) readers[i]).UndeleteAll();
+				reader.UndeleteAll();
 			}
 			hasDeletions = false;
 		}
@@ -307,17 +307,15 @@ namespace Lucene.Net.Index
 		{
 			EnsureOpen();
 			Document result = new Document();
-			for (int i = 0; i < storedFieldReaders.Count; i++)
+			foreach(IndexReader reader in storedFieldReaders)
 			{
-				IndexReader reader = (IndexReader) storedFieldReaders[i];
-				
 				bool include = (fieldSelector == null);
 				if (!include)
 				{
-					System.Collections.IEnumerator it = ((System.Collections.ICollection) readerToFields[reader]).GetEnumerator();
-					while (it.MoveNext())
+				    var fields = readerToFields[reader];
+					foreach(var field in fields)
 					{
-						if (fieldSelector.Accept((System.String) it.Current) != FieldSelectorResult.NO_LOAD)
+                        if (fieldSelector.Accept(field) != FieldSelectorResult.NO_LOAD)
 						{
 							include = true;
 							break;
@@ -326,10 +324,10 @@ namespace Lucene.Net.Index
 				}
 				if (include)
 				{
-					System.Collections.IEnumerator fieldIterator = reader.Document(n, fieldSelector).GetFields().GetEnumerator();
-					while (fieldIterator.MoveNext())
+				    var fields = reader.Document(n, fieldSelector).GetFields();
+					foreach(var field in fields)
 					{
-						result.Add((Fieldable) fieldIterator.Current);
+                        result.Add(field);
 					}
 				}
 			}
@@ -340,24 +338,23 @@ namespace Lucene.Net.Index
 		public override TermFreqVector[] GetTermFreqVectors(int n)
 		{
 			EnsureOpen();
-			System.Collections.ArrayList results = new System.Collections.ArrayList();
-            System.Collections.IEnumerator i = new System.Collections.Hashtable(fieldToReader).GetEnumerator();
-			while (i.MoveNext())
-			{
-				System.Collections.DictionaryEntry e = (System.Collections.DictionaryEntry) i.Current;
-				System.String field = (System.String) e.Key;
-				IndexReader reader = (IndexReader) e.Value;
+			IList<TermFreqVector> results = new List<TermFreqVector>();
+            foreach(var e in fieldToReader)
+			{
+				System.String field = e.Key;
+				IndexReader reader = e.Value;
+
 				TermFreqVector vector = reader.GetTermFreqVector(n, field);
 				if (vector != null)
 					results.Add(vector);
 			}
-			return (TermFreqVector[]) results.ToArray(typeof(TermFreqVector));
+			return results.ToArray();
 		}
 		
 		public override TermFreqVector GetTermFreqVector(int n, System.String field)
 		{
 			EnsureOpen();
-			IndexReader reader = ((IndexReader) fieldToReader[field]);
+			IndexReader reader = (fieldToReader[field]);
 			return reader == null?null:reader.GetTermFreqVector(n, field);
 		}
 		
@@ -365,7 +362,7 @@ namespace Lucene.Net.Index
 		public override void  GetTermFreqVector(int docNumber, System.String field, TermVectorMapper mapper)
 		{
 			EnsureOpen();
-			IndexReader reader = ((IndexReader) fieldToReader[field]);
+			IndexReader reader = (fieldToReader[field]);
 			if (reader != null)
 			{
 				reader.GetTermFreqVector(docNumber, field, mapper);
@@ -376,12 +373,10 @@ namespace Lucene.Net.Index
 		{
 			EnsureOpen();
 
-            System.Collections.IEnumerator i = new System.Collections.Hashtable(fieldToReader).GetEnumerator();
-			while (i.MoveNext())
+            foreach(var e in fieldToReader)
 			{
-				System.Collections.DictionaryEntry e = (System.Collections.DictionaryEntry) i.Current;
-				System.String field = (System.String) e.Key;
-				IndexReader reader = (IndexReader) e.Value;
+				System.String field = e.Key;
+				IndexReader reader = e.Value;
 				reader.GetTermFreqVector(docNumber, field, mapper);
 			}
 		}
@@ -389,28 +384,28 @@ namespace Lucene.Net.Index
 		public override bool HasNorms(System.String field)
 		{
 			EnsureOpen();
-			IndexReader reader = ((IndexReader) fieldToReader[field]);
-			return reader == null?false:reader.HasNorms(field);
+			IndexReader reader = fieldToReader[field];
+		    return reader != null && reader.HasNorms(field);
 		}
 		
 		public override byte[] Norms(System.String field)
 		{
 			EnsureOpen();
-			IndexReader reader = ((IndexReader) fieldToReader[field]);
+			IndexReader reader = fieldToReader[field];
 			return reader == null?null:reader.Norms(field);
 		}
 		
 		public override void  Norms(System.String field, byte[] result, int offset)
 		{
 			EnsureOpen();
-			IndexReader reader = ((IndexReader) fieldToReader[field]);
+			IndexReader reader = fieldToReader[field];
 			if (reader != null)
 				reader.Norms(field, result, offset);
 		}
 		
 		protected internal override void  DoSetNorm(int n, System.String field, byte value_Renamed)
 		{
-			IndexReader reader = ((IndexReader) fieldToReader[field]);
+			IndexReader reader = fieldToReader[field];
 			if (reader != null)
 				reader.DoSetNorm(n, field, value_Renamed);
 		}
@@ -430,7 +425,7 @@ namespace Lucene.Net.Index
 		public override int DocFreq(Term term)
 		{
 			EnsureOpen();
-			IndexReader reader = ((IndexReader) fieldToReader[term.Field()]);
+			IndexReader reader = fieldToReader[term.Field()];
 			return reader == null?0:reader.DocFreq(term);
 		}
 		
@@ -461,9 +456,9 @@ namespace Lucene.Net.Index
 		/// <summary> Checks recursively if all subreaders are up to date. </summary>
 		public override bool IsCurrent()
 		{
-			for (int i = 0; i < readers.Count; i++)
-			{
-				if (!((IndexReader) readers[i]).IsCurrent())
+			foreach(var reader in readers)
+            {
+				if (!reader.IsCurrent())
 				{
 					return false;
 				}
@@ -476,16 +471,16 @@ namespace Lucene.Net.Index
 		/// <summary> Checks recursively if all subindexes are optimized </summary>
 		public override bool IsOptimized()
 		{
-			for (int i = 0; i < readers.Count; i++)
-			{
-				if (!((IndexReader) readers[i]).IsOptimized())
-				{
-					return false;
-				}
-			}
-			
-			// all subindexes are optimized
-			return true;
+            foreach (var reader in readers)
+            {
+                if (!reader.IsOptimized())
+                {
+                    return false;
+                }
+            }
+
+            // all subindexes are optimized
+            return true;
 		}
 		
 		
@@ -499,13 +494,13 @@ namespace Lucene.Net.Index
 		// for testing
 		public /*internal*/ virtual IndexReader[] GetSubReaders()
 		{
-			return (IndexReader[]) readers.ToArray(typeof(IndexReader));
+			return readers.ToArray();
 		}
 
-        protected internal override void DoCommit(System.Collections.Generic.IDictionary<string, string> commitUserData)
+        protected internal override void DoCommit(IDictionary<string, string> commitUserData)
 		{
-			for (int i = 0; i < readers.Count; i++)
-				((IndexReader) readers[i]).Commit(commitUserData);
+			foreach(var reader in readers)
+				reader.Commit(commitUserData);
 		}
 		
 		protected internal override void  DoClose()
@@ -514,13 +509,13 @@ namespace Lucene.Net.Index
 			{
 				for (int i = 0; i < readers.Count; i++)
 				{
-					if (((System.Boolean) decrefOnClose[i]))
+					if (decrefOnClose[i])
 					{
-						((IndexReader) readers[i]).DecRef();
+						readers[i].DecRef();
 					}
 					else
 					{
-						((IndexReader) readers[i]).Close();
+						readers[i].Close();
 					}
 				}
 			}
@@ -531,12 +526,11 @@ namespace Lucene.Net.Index
         public override System.Collections.Generic.ICollection<string> GetFieldNames(IndexReader.FieldOption fieldNames)
 		{
 			EnsureOpen();
-            System.Collections.Generic.List<string> fieldSet = new System.Collections.Generic.List<string>();
-			for (int i = 0; i < readers.Count; i++)
+            ISet<string> fieldSet = new HashSet<string>();
+			foreach(var reader in readers)
 			{
-				IndexReader reader = ((IndexReader) readers[i]);
-				System.Collections.Generic.ICollection<string> names = reader.GetFieldNames(fieldNames);
-                fieldSet.AddRange(names);
+				ICollection<string> names = reader.GetFieldNames(fieldNames);
+                fieldSet.UnionWith(names);
 			}
 			return fieldSet;
 		}
@@ -557,7 +551,7 @@ namespace Lucene.Net.Index
 				
 			}
 			private System.String field;
-			private System.Collections.IEnumerator fieldIterator;
+			private IEnumerator<string> fieldIterator;
 			private TermEnum termEnum;
 			
 			public ParallelTermEnum(ParallelReader enclosingInstance)
@@ -565,7 +559,7 @@ namespace Lucene.Net.Index
 				InitBlock(enclosingInstance);
 				try
 				{
-					field = ((System.String) Enclosing_Instance.fieldToReader.GetKey(0));
+					field = Enclosing_Instance.fieldToReader.Keys.First();
 				}
 				catch (ArgumentOutOfRangeException e)
 				{
@@ -573,14 +567,14 @@ namespace Lucene.Net.Index
 					return;
 				}
 				if (field != null)
-					termEnum = ((IndexReader) Enclosing_Instance.fieldToReader[field]).Terms();
+					termEnum = Enclosing_Instance.fieldToReader[field].Terms();
 			}
 			
 			public ParallelTermEnum(ParallelReader enclosingInstance, Term term)
 			{
 				InitBlock(enclosingInstance);
 				field = term.Field();
-				IndexReader reader = ((IndexReader) Enclosing_Instance.fieldToReader[field]);
+				IndexReader reader = Enclosing_Instance.fieldToReader[field];
 				if (reader != null)
 					termEnum = reader.Terms(term);
 			}
@@ -599,30 +593,20 @@ namespace Lucene.Net.Index
 				// find the next field with terms, if any
 				if (fieldIterator == null)
 				{
-                    System.Collections.Comparer comparer = System.Collections.Comparer.Default;
-                    System.Collections.SortedList newList = new System.Collections.SortedList();
-                    if (Enclosing_Instance.fieldToReader != null)
+                    var newList = new List<string>();  
+                    if (Enclosing_Instance.fieldToReader != null && Enclosing_Instance.fieldToReader.Count > 0)
                     {
-                        if (Enclosing_Instance.fieldToReader.Count > 0)
-                        {
-                            int index = 0;
-                            while (comparer.Compare(Enclosing_Instance.fieldToReader.GetKey(index), field) < 0)
-                                index++;
-                            for (; index < Enclosing_Instance.fieldToReader.Count; index++)
-                            {
-                                newList.Add(Enclosing_Instance.fieldToReader.GetKey(index), Enclosing_Instance.fieldToReader[Enclosing_Instance.fieldToReader.GetKey(index)]);
-                            }
-                        }
+                        var comparer = Enclosing_Instance.fieldToReader.Comparer;
+                        foreach(var entry in Enclosing_Instance.fieldToReader.Keys.Where(x => comparer.Compare(x, field) >= 0))
+                            newList.Add(entry);
                     }
 
-                    fieldIterator = newList.Keys.GetEnumerator();
-                    fieldIterator.MoveNext();
-					System.Object generatedAux = fieldIterator.Current; // Skip field to get next one
+                    fieldIterator = newList.Skip(1).GetEnumerator(); // Skip field to get next one
 				}
 				while (fieldIterator.MoveNext())
 				{
-					field = ((System.String) fieldIterator.Current);
-					termEnum = ((IndexReader) Enclosing_Instance.fieldToReader[field]).Terms(new Term(field));
+					field = fieldIterator.Current;
+					termEnum = Enclosing_Instance.fieldToReader[field].Terms(new Term(field));
 					Term term = termEnum.Term();
 					if (term != null && (System.Object) term.Field() == (System.Object) field)
 						return true;
@@ -681,10 +665,12 @@ namespace Lucene.Net.Index
 			public ParallelTermDocs(ParallelReader enclosingInstance, Term term)
 			{
 				InitBlock(enclosingInstance);
-				if (term == null)
-					termDocs = (Enclosing_Instance.readers.Count == 0)?null:((IndexReader) Enclosing_Instance.readers[0]).TermDocs(null);
-				else
-					Seek(term);
+                if (term == null)
+                    termDocs = (Enclosing_Instance.readers.Count == 0)
+                                   ? null
+                                   : Enclosing_Instance.readers[0].TermDocs(null);
+                else
+                    Seek(term);
 			}
 			
 			public virtual int Doc()
@@ -698,7 +684,7 @@ namespace Lucene.Net.Index
 			
 			public virtual void  Seek(Term term)
 			{
-				IndexReader reader = ((IndexReader) Enclosing_Instance.fieldToReader[term.Field()]);
+				IndexReader reader = Enclosing_Instance.fieldToReader[term.Field()];
 				termDocs = reader != null?reader.TermDocs(term):null;
 			}
 			
@@ -766,7 +752,7 @@ namespace Lucene.Net.Index
 			
 			public override void  Seek(Term term)
 			{
-				IndexReader reader = ((IndexReader) Enclosing_Instance.fieldToReader[term.Field()]);
+				IndexReader reader = Enclosing_Instance.fieldToReader[term.Field()];
 				termDocs = reader != null?reader.TermPositions(term):null;
 			}
 			

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/SegmentInfos.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/SegmentInfos.cs?rev=1203041&r1=1203040&r2=1203041&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/SegmentInfos.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/SegmentInfos.cs Thu Nov 17 03:49:32 2011
@@ -127,7 +127,7 @@ namespace Lucene.Net.Index
 		// or wrote; this is normally the same as generation except if
 		// there was an IOException that had interrupted a commit
 
-        private System.Collections.Generic.IDictionary<string, string> userData = new System.Collections.Generic.Dictionary<string, string>(); // Opaque Map<String, String> that user can specify during IndexWriter.commit
+        private IDictionary<string, string> userData = new HashMap<string, string>(); // Opaque Map<String, String> that user can specify during IndexWriter.commit
 		
 		/// <summary> If non-null, information about loading segments_N files</summary>
 		/// <seealso cref="SetInfoStream">
@@ -315,20 +315,20 @@ namespace Lucene.Net.Index
 					}
 					else if (0 != input.ReadByte())
 					{
-                        // TODO: In java, this is a read-only dictionary, probably for a reason, though
-                        //       I can't see immediately why.  We'd have to roll our own, I can't find
-                        //       and equivelant in the BCL
-                        userData = new System.Collections.Generic.Dictionary<string,string>();
+                        // TODO: Should be read-only map
+                        userData = new HashMap<string,string>();
 						userData.Add("userData", input.ReadString());
 					}
 					else
 					{
-                        userData = new System.Collections.Generic.Dictionary<string, string>();
+                        // TODO: Should be empty read-only map
+                        userData = new HashMap<string, string>();
 					}
 				}
 				else
 				{
-                    userData = new System.Collections.Generic.Dictionary<string, string>();
+                    // TODO: Should be empty read-only map
+                    userData = new HashMap<string, string>();
 				}
 				
 				if (format <= FORMAT_CHECKSUM)
@@ -1037,7 +1037,7 @@ namespace Lucene.Net.Index
 		{
 			if (data == null)
 			{
-				userData = new System.Collections.Generic.Dictionary<string,string>();
+			    userData = new HashMap<string, string>();
 			}
 			else
 			{

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/Term.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/Term.cs?rev=1203041&r1=1203040&r2=1203041&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/Term.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Index/Term.cs Thu Nov 17 03:49:32 2011
@@ -30,7 +30,7 @@ namespace Lucene.Net.Index
 	/// </summary>
 	
 	[Serializable]
-    public sealed class Term : System.IComparable
+    public sealed class Term : System.IComparable<Term>
 	{
 		internal System.String field;
 		internal System.String text;

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FieldValueHitQueue.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FieldValueHitQueue.cs?rev=1203041&r1=1203040&r2=1203041&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FieldValueHitQueue.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/FieldValueHitQueue.cs Thu Nov 17 03:49:32 2011
@@ -29,14 +29,8 @@ namespace Lucene.Net.Search
 	/// incompatible ways in the next release.
 	/// 
 	/// </summary>
-	/// <since> 2.9
-	/// </since>
-	/// <version>  $Id:
-	/// </version>
-	/// <seealso cref="Searcher.Search(Query,Filter,int,Sort)">
-	/// </seealso>
-	/// <seealso cref="FieldCache">
-	/// </seealso>
+	/// <seealso cref="Searcher.Search(Query,Filter,int,Sort)"></seealso>
+	/// <seealso cref="FieldCache"></seealso>
 	public abstract class FieldValueHitQueue : PriorityQueue<FieldValueHitQueue.Entry>
 	{
         // had to change from internal to public, due to public accessability of FieldValueHitQueue
@@ -120,9 +114,6 @@ namespace Lucene.Net.Search
 				{
 					SortField field = fields[i];
 					
-					// AUTO is resolved before we are called
-					System.Diagnostics.Debug.Assert(field.GetType() != SortField.AUTO);
-					
 					reverseMul[i] = field.reverse?- 1:1;
 					comparators[i] = field.GetComparator(size, i);
 				}

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/Searchable.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/Searchable.cs?rev=1203041&r1=1203040&r2=1203041&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/Searchable.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/Searchable.cs Thu Nov 17 03:49:32 2011
@@ -43,31 +43,6 @@ namespace Lucene.Net.Search
 	/// </summary>
 	public interface Searchable
 	{
-		
-		/// <summary>Lower-level search API.
-		/// 
-		/// <p/><see cref="HitCollector.Collect(int,float)" /> is called for every non-zero
-		/// scoring document.
-		/// <br/>HitCollector-based access to remote indexes is discouraged.
-		/// 
-		/// <p/>Applications should only use this if they need <i>all</i> of the
-		/// matching documents.  The high-level search API (<see cref="Searcher.Search(Query)" />)
-		/// is usually more efficient, as it skips
-		/// non-high-scoring hits.
-		/// 
-		/// </summary>
-		/// <param name="weight">to match documents
-		/// </param>
-		/// <param name="filter">if non-null, used to permit documents to be collected.
-		/// </param>
-		/// <param name="results">to receive hits
-		/// </param>
-		/// <throws>  BooleanQuery.TooManyClauses </throws>
-		/// <deprecated> use <see cref="Search(Weight, Filter, Collector)" /> instead.
-		/// </deprecated>
-        [Obsolete("use Search(Weight, Filter, Collector) instead.")]
-		void  Search(Weight weight, Filter filter, HitCollector results);
-		
 		/// <summary> Lower-level search API.
 		/// 
 		/// <p/>
@@ -76,7 +51,7 @@ namespace Lucene.Net.Search
 		/// 
 		/// <p/>
 		/// Applications should only use this if they need <i>all</i> of the matching
-		/// documents. The high-level search API (<see cref="Searcher.Search(Query)" />) is
+		/// documents. The high-level search API (<see cref="Searcher.Search(Query,int)" />) is
 		/// usually more efficient, as it skips non-high-scoring hits.
 		/// 
 		/// </summary>
@@ -91,7 +66,7 @@ namespace Lucene.Net.Search
 		
 		/// <summary>Frees resources associated with this Searcher.
 		/// Be careful not to call this method while you are still using objects
-		/// like <see cref="Hits" />.
+		/// that reference this searchable
 		/// </summary>
 		void  Close();
 		
@@ -120,8 +95,8 @@ namespace Lucene.Net.Search
 		/// 
 		/// <p/>Called by <see cref="Hits" />.
 		/// 
-		/// <p/>Applications should usually call <see cref="Searcher.Search(Query)" /> or
-		/// <see cref="Searcher.Search(Query,Filter)" /> instead.
+		/// <p/>Applications should usually call <see cref="Searcher.Search(Query, int)" /> or
+		/// <see cref="Searcher.Search(Query,Filter,int)" /> instead.
 		/// </summary>
 		/// <throws>  BooleanQuery.TooManyClauses </throws>
 		TopDocs Search(Weight weight, Filter filter, int n);

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/Searcher.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/Searcher.cs?rev=1203041&r1=1203040&r2=1203041&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/Searcher.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/Searcher.cs Thu Nov 17 03:49:32 2011
@@ -16,7 +16,7 @@
  */
 
 using System;
-
+using Lucene.Net.Documents;
 using Document = Lucene.Net.Documents.Document;
 using CorruptIndexException = Lucene.Net.Index.CorruptIndexException;
 using Term = Lucene.Net.Index.Term;
@@ -42,56 +42,6 @@ namespace Lucene.Net.Search
 			similarity = Similarity.GetDefault();
 		}
 		
-		/// <summary>Returns the documents matching <c>query</c>. </summary>
-		/// <throws>  BooleanQuery.TooManyClauses </throws>
-		/// <deprecated> Hits will be removed in Lucene 3.0. Use
-		/// <see cref="Search(Query, Filter, int)" /> instead.
-		/// </deprecated>
-        [Obsolete("Hits will be removed in Lucene 3.0. Use Search(Query, Filter, int) instead")]
-		public Hits Search(Query query)
-		{
-			return Search(query, (Filter) null);
-		}
-		
-		/// <summary>Returns the documents matching <c>query</c> and
-		/// <c>filter</c>.
-		/// </summary>
-		/// <throws>  BooleanQuery.TooManyClauses </throws>
-		/// <deprecated> Hits will be removed in Lucene 3.0. Use
-		/// <see cref="Search(Query, Filter, int)" /> instead.
-		/// </deprecated>
-        [Obsolete("Hits will be removed in Lucene 3.0. Use Search(Query, Filter, int) instead")]
-		public virtual Hits Search(Query query, Filter filter)
-		{
-			return new Hits(this, query, filter);
-		}
-		
-		/// <summary>Returns documents matching <c>query</c> sorted by
-		/// <c>sort</c>.
-		/// </summary>
-		/// <throws>  BooleanQuery.TooManyClauses </throws>
-		/// <deprecated> Hits will be removed in Lucene 3.0. Use 
-		/// <see cref="Search(Query, Filter, int, Sort)" /> instead.
-		/// </deprecated>
-        [Obsolete("Hits will be removed in Lucene 3.0. Use Search(Query, Filter, int, Sort) instead")]
-		public virtual Hits Search(Query query, Sort sort)
-		{
-			return new Hits(this, query, null, sort);
-		}
-		
-		/// <summary>Returns documents matching <c>query</c> and <c>filter</c>,
-		/// sorted by <c>sort</c>.
-		/// </summary>
-		/// <throws>  BooleanQuery.TooManyClauses </throws>
-		/// <deprecated> Hits will be removed in Lucene 3.0. Use 
-		/// <see cref="Search(Query, Filter, int, Sort)" /> instead.
-		/// </deprecated>
-        [Obsolete("Hits will be removed in Lucene 3.0. Use Search(Query, Filter, int, Sort) instead")]
-		public virtual Hits Search(Query query, Filter filter, Sort sort)
-		{
-			return new Hits(this, query, filter, sort);
-		}
-		
 		/// <summary>Search implementation with arbitrary sorting.  Finds
 		/// the top <c>n</c> hits for <c>query</c>, applying
 		/// <c>filter</c> if non-null, and sorting the hits by the criteria in
@@ -109,28 +59,6 @@ namespace Lucene.Net.Search
 		
 		/// <summary>Lower-level search API.
 		/// 
-		/// <p/><see cref="HitCollector.Collect(int,float)" /> is called for every matching
-		/// document.
-		/// 
-		/// <p/>Applications should only use this if they need <i>all</i> of the
-		/// matching documents.  The high-level search API (<see cref="Searcher.Search(Query)" />)
-		/// is usually more efficient, as it skips
-		/// non-high-scoring hits.
-		/// <p/>Note: The <c>score</c> passed to this method is a raw score.
-		/// In other words, the score will not necessarily be a float whose value is
-		/// between 0 and 1.
-		/// </summary>
-		/// <throws>  BooleanQuery.TooManyClauses </throws>
-		/// <deprecated> use <see cref="Search(Query, Collector)" /> instead.
-		/// </deprecated>
-        [Obsolete("use Search(Query, Collector) instead.")]
-		public virtual void  Search(Query query, HitCollector results)
-		{
-			Search(CreateWeight(query), null, new HitCollectorWrapper(results));
-		}
-		
-		/// <summary>Lower-level search API.
-		/// 
 		/// <p/><see cref="Collector.Collect(int)" /> is called for every matching document.
 		/// 
 		/// <p/>Applications should only use this if they need <i>all</i> of the matching
@@ -148,33 +76,6 @@ namespace Lucene.Net.Search
 		
 		/// <summary>Lower-level search API.
 		/// 
-		/// <p/><see cref="HitCollector.Collect(int,float)" /> is called for every matching
-		/// document.
-		/// <br/>HitCollector-based access to remote indexes is discouraged.
-		/// 
-		/// <p/>Applications should only use this if they need <i>all</i> of the
-		/// matching documents.  The high-level search API (<see cref="Searcher.Search(Query, Filter, int)" />)
-		/// is usually more efficient, as it skips
-		/// non-high-scoring hits.
-		/// 
-		/// </summary>
-		/// <param name="query">to match documents
-		/// </param>
-		/// <param name="filter">if non-null, used to permit documents to be collected.
-		/// </param>
-		/// <param name="results">to receive hits
-		/// </param>
-		/// <throws>  BooleanQuery.TooManyClauses </throws>
-		/// <deprecated> use <see cref="Search(Query, Filter, Collector)" /> instead.
-		/// </deprecated>
-        [Obsolete("use Search(Query, Filter, Collector) instead.")]
-		public virtual void  Search(Query query, Filter filter, HitCollector results)
-		{
-			Search(CreateWeight(query), filter, new HitCollectorWrapper(results));
-		}
-		
-		/// <summary>Lower-level search API.
-		/// 
 		/// <p/><see cref="Collector.Collect(int)" /> is called for every matching
 		/// document.
 		/// <br/>Collector-based access to remote indexes is discouraged.
@@ -270,28 +171,18 @@ namespace Lucene.Net.Search
 			}
 			return result;
 		}
-		
-		/* The following abstract methods were added as a workaround for GCJ bug #15411.
-		* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15411
-		*/
-		/// <deprecated> use <see cref="Search(Weight, Filter, Collector)" /> instead.
-		/// </deprecated>
-        [Obsolete("use Search(Weight, Filter, Collector) instead.")]
-		public virtual void  Search(Weight weight, Filter filter, HitCollector results)
-		{
-			Search(weight, filter, new HitCollectorWrapper(results));
-		}
-		abstract public void  Search(Weight weight, Filter filter, Collector results);
-		abstract public void  Close();
-        abstract public void Dispose();
-		abstract public int DocFreq(Term term);
-		abstract public int MaxDoc();
-		abstract public TopDocs Search(Weight weight, Filter filter, int n);
-		abstract public Document Doc(int i);
-		abstract public Query Rewrite(Query query);
-		abstract public Explanation Explain(Weight weight, int doc);
-		abstract public TopFieldDocs Search(Weight weight, Filter filter, int n, Sort sort);
+
+		public abstract void  Search(Weight weight, Filter filter, Collector results);
+		public abstract void  Close();
+        public abstract void Dispose();
+		public abstract int DocFreq(Term term);
+		public abstract int MaxDoc();
+		public abstract TopDocs Search(Weight weight, Filter filter, int n);
+		public abstract Document Doc(int i);
+	    public abstract Document Doc(int docid, FieldSelector fieldSelector);
+		public abstract Query Rewrite(Query query);
+		public abstract Explanation Explain(Weight weight, int doc);
+		public abstract TopFieldDocs Search(Weight weight, Filter filter, int n, Sort sort);
 		/* End patch for GCJ bug #15411. */
-		public abstract Lucene.Net.Documents.Document Doc(int param1, Lucene.Net.Documents.FieldSelector param2);
 	}
 }
\ No newline at end of file

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/SortField.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/SortField.cs?rev=1203041&r1=1203040&r2=1203041&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/SortField.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Search/SortField.cs Thu Nov 17 03:49:32 2011
@@ -42,7 +42,6 @@ namespace Lucene.Net.Search
 	[Serializable]
 	public class SortField
 	{
-		
 		/// <summary>Sort by document score (relevancy).  Sort values are Float and higher
 		/// values are at the front. 
 		/// </summary>
@@ -53,17 +52,7 @@ namespace Lucene.Net.Search
 		/// </summary>
 		public const int DOC = 1;
 		
-		/// <summary>Guess type of sort based on field contents.  A regular expression is used
-		/// to look at the first term indexed for the field and determine if it
-		/// represents an integer number, a floating point number, or just arbitrary
-		/// string characters.
-		/// </summary>
-		/// <deprecated> Please specify the exact type, instead.
-		/// Especially, guessing does <b>not</b> work with the new
-		/// <see cref="NumericField" /> type.
-		/// </deprecated>
-        [Obsolete("Please specify the exact type, instead. Especially, guessing does not work with the new NumericField type.")]
-		public const int AUTO = 2;
+		// reserved, in Lucene 2.9, there was a constant: AUTO = 2
 		
 		/// <summary>Sort using term values as Strings.  Sort values are String and lower
 		/// values are at the front. 
@@ -123,47 +112,14 @@ namespace Lucene.Net.Search
 		public static readonly SortField FIELD_DOC = new SortField(null, DOC);
 		
 		private System.String field;
-		private int type = AUTO; // defaults to determining type dynamically
+		private int type; // defaults to determining type dynamically
 		private System.Globalization.CultureInfo locale; // defaults to "natural order" (no Locale)
 		internal bool reverse = false; // defaults to natural order
-		private SortComparatorSource factory;
 		private Lucene.Net.Search.Parser parser;
 		
 		// Used for CUSTOM sort
 		private FieldComparatorSource comparatorSource;
 		
-		private bool useLegacy = false; // remove in Lucene 3.0
-		
-		/// <summary>Creates a sort by terms in the given field where the type of term value
-		/// is determined dynamically (<see cref="AUTO" />).
-		/// </summary>
-		/// <param name="field">Name of field to sort by, cannot be
-		/// <c>null</c>.
-		/// </param>
-		/// <deprecated> Please specify the exact type instead.
-		/// </deprecated>
-        [Obsolete("Please specify the exact type instead.")]
-		public SortField(System.String field)
-		{
-			InitFieldType(field, AUTO);
-		}
-		
-		/// <summary>Creates a sort, possibly in reverse, by terms in the given field where
-		/// the type of term value is determined dynamically (<see cref="AUTO" />).
-		/// </summary>
-		/// <param name="field">Name of field to sort by, cannot be <c>null</c>.
-		/// </param>
-		/// <param name="reverse">True if natural order should be reversed.
-		/// </param>
-		/// <deprecated> Please specify the exact type instead.
-		/// </deprecated>
-        [Obsolete("Please specify the exact type instead.")]
-		public SortField(System.String field, bool reverse)
-		{
-			InitFieldType(field, AUTO);
-			this.reverse = reverse;
-		}
-		
 		/// <summary>Creates a sort by terms in the given field with the type of term
 		/// values explicitly given.
 		/// </summary>
@@ -280,21 +236,6 @@ namespace Lucene.Net.Search
 		/// </param>
 		/// <param name="comparator">Returns a comparator for sorting hits.
 		/// </param>
-		/// <deprecated> use SortField (String field, FieldComparatorSource comparator)
-		/// </deprecated>
-        [Obsolete("use SortField (String field, FieldComparatorSource comparator)")]
-		public SortField(System.String field, SortComparatorSource comparator)
-		{
-			InitFieldType(field, CUSTOM);
-			SetUseLegacySearch(true);
-			this.factory = comparator;
-		}
-		
-		/// <summary>Creates a sort with a custom comparison function.</summary>
-		/// <param name="field">Name of field to sort by; cannot be <c>null</c>.
-		/// </param>
-		/// <param name="comparator">Returns a comparator for sorting hits.
-		/// </param>
 		public SortField(System.String field, FieldComparatorSource comparator)
 		{
 			InitFieldType(field, CUSTOM);
@@ -308,24 +249,6 @@ namespace Lucene.Net.Search
 		/// </param>
 		/// <param name="reverse">True if natural order should be reversed.
 		/// </param>
-		/// <deprecated> use SortField (String field, FieldComparatorSource comparator, boolean reverse)
-		/// </deprecated>
-        [Obsolete("use SortField(String field, FieldComparatorSource comparator, boolean reverse)")]
-		public SortField(System.String field, SortComparatorSource comparator, bool reverse)
-		{
-			InitFieldType(field, CUSTOM);
-			SetUseLegacySearch(true);
-			this.reverse = reverse;
-			this.factory = comparator;
-		}
-		
-		/// <summary>Creates a sort, possibly in reverse, with a custom comparison function.</summary>
-		/// <param name="field">Name of field to sort by; cannot be <c>null</c>.
-		/// </param>
-		/// <param name="comparator">Returns a comparator for sorting hits.
-		/// </param>
-		/// <param name="reverse">True if natural order should be reversed.
-		/// </param>
 		public SortField(System.String field, FieldComparatorSource comparator, bool reverse)
 		{
 			InitFieldType(field, CUSTOM);
@@ -360,7 +283,7 @@ namespace Lucene.Net.Search
 		}
 		
 		/// <summary>Returns the type of contents in the field.</summary>
-		/// <returns> One of the constants SCORE, DOC, AUTO, STRING, INT or FLOAT.
+		/// <returns> One of the constants SCORE, DOC, STRING, INT or FLOAT.
 		/// </returns>
 		public new virtual int GetType()
 		{
@@ -395,44 +318,15 @@ namespace Lucene.Net.Search
 			return reverse;
 		}
 		
-		/// <deprecated> use <see cref="GetComparatorSource()" />
-		/// </deprecated>
-        [Obsolete("use GetComparatorSource()")]
-		public virtual SortComparatorSource GetFactory()
-		{
-			return factory;
-		}
-		
+		/// <summary>
+		/// Returns the <see cref="FieldComparatorSource"/> used for
+		/// custom sorting
+		/// </summary>
 		public virtual FieldComparatorSource GetComparatorSource()
 		{
 			return comparatorSource;
 		}
 		
-		/// <summary> Use legacy IndexSearch implementation: search with a DirectoryReader rather
-		/// than passing a single hit collector to multiple SegmentReaders.
-		/// 
-		/// </summary>
-		/// <param name="legacy">true for legacy behavior
-		/// </param>
-		/// <deprecated> will be removed in Lucene 3.0.
-		/// </deprecated>
-        [Obsolete("will be removed in Lucene 3.0.")]
-		public virtual void  SetUseLegacySearch(bool legacy)
-		{
-			this.useLegacy = legacy;
-		}
-		
-		/// <returns> if true, IndexSearch will use legacy sorting search implementation.
-		/// eg. multiple Priority Queues.
-		/// </returns>
-		/// <deprecated> will be removed in Lucene 3.0.
-		/// </deprecated>
-        [Obsolete("will be removed in Lucene 3.0.")]
-		public virtual bool GetUseLegacySearch()
-		{
-			return this.useLegacy;
-		}
-		
 		public override System.String ToString()
 		{
 			System.Text.StringBuilder buffer = new System.Text.StringBuilder();
@@ -443,62 +337,46 @@ namespace Lucene.Net.Search
 					buffer.Append("<score>");
 					break;
 				
-				
 				case DOC: 
 					buffer.Append("<doc>");
 					break;
 				
-				
-				case AUTO: 
-					buffer.Append("<auto: \"").Append(field).Append("\">");
-					break;
-				
-				
 				case STRING: 
 					buffer.Append("<string: \"").Append(field).Append("\">");
 					break;
 				
-				
 				case STRING_VAL: 
 					buffer.Append("<string_val: \"").Append(field).Append("\">");
 					break;
 				
-				
 				case BYTE: 
 					buffer.Append("<byte: \"").Append(field).Append("\">");
 					break;
 				
-				
 				case SHORT: 
 					buffer.Append("<short: \"").Append(field).Append("\">");
 					break;
 				
-				
 				case INT: 
 					buffer.Append("<int: \"").Append(field).Append("\">");
 					break;
 				
-				
 				case LONG: 
 					buffer.Append("<long: \"").Append(field).Append("\">");
 					break;
 				
-				
 				case FLOAT: 
 					buffer.Append("<float: \"").Append(field).Append("\">");
 					break;
 				
-				
 				case DOUBLE: 
 					buffer.Append("<double: \"").Append(field).Append("\">");
 					break;
 				
-				
 				case CUSTOM: 
-					buffer.Append("<custom:\"").Append(field).Append("\": ").Append(factory).Append('>');
+					buffer.Append("<custom:\"").Append(field).Append("\": ").Append(comparatorSource).Append('>');
 					break;
 				
-				
 				default: 
 					buffer.Append("<???: \"").Append(field).Append("\">");
 					break;
@@ -516,7 +394,7 @@ namespace Lucene.Net.Search
 		}
 		
 		/// <summary>Returns true if <c>o</c> is equal to this.  If a
-		/// <see cref="SortComparatorSource" /> (deprecated) or <see cref="Parser" />
+		/// <see cref="FieldComparatorSource" />  or <see cref="Parser" />
 		/// was provided, it must properly
 		/// implement equals (unless a singleton is always used). 
 		/// </summary>
@@ -527,11 +405,17 @@ namespace Lucene.Net.Search
 			if (!(o is SortField))
 				return false;
 			SortField other = (SortField) o;
-			return ((System.Object) other.field == (System.Object) this.field && other.type == this.type && other.reverse == this.reverse && (other.locale == null?this.locale == null:other.locale.Equals(this.locale)) && (other.factory == null?this.factory == null:other.factory.Equals(this.factory)) && (other.comparatorSource == null?this.comparatorSource == null:other.comparatorSource.Equals(this.comparatorSource)) && (other.parser == null?this.parser == null:other.parser.Equals(this.parser)));
+		    return ((System.Object) other.field == (System.Object) this.field && other.type == this.type &&
+		            other.reverse == this.reverse &&
+		            (other.locale == null ? this.locale == null : other.locale.Equals(this.locale)) &&
+		            (other.comparatorSource == null
+		                 ? this.comparatorSource == null
+		                 : other.comparatorSource.Equals(this.comparatorSource)) &&
+		            (other.parser == null ? this.parser == null : other.parser.Equals(this.parser)));
 		}
 		
 		/// <summary>Returns true if <c>o</c> is equal to this.  If a
-		/// <see cref="SortComparatorSource" /> (deprecated) or <see cref="Parser" />
+		/// <see cref="FieldComparatorSource" /> (deprecated) or <see cref="Parser" />
 		/// was provided, it must properly
 		/// implement hashCode (unless a singleton is always
 		/// used). 
@@ -545,8 +429,6 @@ namespace Lucene.Net.Search
 			{
 				hash += (locale.GetHashCode() ^ 0x08150815);
 			}
-			if (factory != null)
-				hash += (factory.GetHashCode() ^ 0x34987555);
 			if (comparatorSource != null)
 				hash += comparatorSource.GetHashCode();
 			if (parser != null)
@@ -597,94 +479,44 @@ namespace Lucene.Net.Search
 			
 			switch (type)
 			{
-				
 				case SortField.SCORE: 
 					return new FieldComparator.RelevanceComparator(numHits);
 				
-				
 				case SortField.DOC: 
 					return new FieldComparator.DocComparator(numHits);
 				
-				
 				case SortField.INT: 
 					return new FieldComparator.IntComparator(numHits, field, parser);
 				
-				
 				case SortField.FLOAT: 
 					return new FieldComparator.FloatComparator(numHits, field, parser);
 				
-				
 				case SortField.LONG: 
 					return new FieldComparator.LongComparator(numHits, field, parser);
 				
-				
 				case SortField.DOUBLE: 
 					return new FieldComparator.DoubleComparator(numHits, field, parser);
 				
-				
 				case SortField.BYTE: 
 					return new FieldComparator.ByteComparator(numHits, field, parser);
 				
-				
 				case SortField.SHORT: 
 					return new FieldComparator.ShortComparator(numHits, field, parser);
 				
-				
 				case SortField.CUSTOM: 
-					System.Diagnostics.Debug.Assert(factory == null && comparatorSource != null);
+					System.Diagnostics.Debug.Assert(comparatorSource != null);
 					return comparatorSource.NewComparator(field, numHits, sortPos, reverse);
 				
-				
 				case SortField.STRING: 
 					return new FieldComparator.StringOrdValComparator(numHits, field, sortPos, reverse);
 				
-				
 				case SortField.STRING_VAL: 
 					return new FieldComparator.StringValComparator(numHits, field);
 				
-				
 				default: 
 					throw new System.SystemException("Illegal sort type: " + type);
 				
 			}
 		}
-		
-		/// <summary> Attempts to detect the given field type for an IndexReader.</summary>
-		/// <deprecated>
-		/// </deprecated>
-        [Obsolete]
-		internal static int DetectFieldType(IndexReader reader, System.String fieldKey)
-		{
-			System.String field = StringHelper.Intern(fieldKey);
-			TermEnum enumerator = reader.Terms(new Term(field));
-			try
-			{
-				Term term = enumerator.Term();
-				if (term == null)
-				{
-					throw new System.SystemException("no terms in field " + field + " - cannot determine sort type");
-				}
-				int ret = 0;
-				if ((System.Object) term.Field() == (System.Object) field)
-				{
-					System.String termtext = term.Text().Trim();
-                    
-                    int tmpI32; long tmpI64; float tmpF;
-                    if      (System.Int32.TryParse(termtext, out tmpI32))       ret = SortField.INT;
-                    else if (System.Int64.TryParse(termtext, out tmpI64))       ret = SortField.LONG;
-                    else if (Single.TryParse(termtext, out tmpF))  ret = SortField.FLOAT;
-                    else ret = SortField.STRING;
-				}
-				else
-				{
-					throw new System.SystemException("field \"" + field + "\" does not appear to be indexed");
-				}
-				return ret;
-			}
-			finally
-			{
-				enumerator.Close();
-			}
-		}
 	}
 }
\ No newline at end of file

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/IndexInput.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/IndexInput.cs?rev=1203041&r1=1203040&r2=1203041&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/IndexInput.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/IndexInput.cs Thu Nov 17 03:49:32 2011
@@ -16,6 +16,7 @@
  */
 
 using System;
+using Lucene.Net.Support;
 
 namespace Lucene.Net.Store
 {
@@ -262,7 +263,7 @@ namespace Lucene.Net.Store
 		// returns Map<String, String>
 		public virtual System.Collections.Generic.IDictionary<string,string> ReadStringStringMap()
 		{
-            System.Collections.Generic.Dictionary<string, string> map = new System.Collections.Generic.Dictionary<string, string>();
+            var map = new HashMap<string, string>();
 			int count = ReadInt();
 			for (int i = 0; i < count; i++)
 			{

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/SimpleFSLockFactory.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/SimpleFSLockFactory.cs?rev=1203041&r1=1203040&r2=1203041&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/SimpleFSLockFactory.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Store/SimpleFSLockFactory.cs Thu Nov 17 03:49:32 2011
@@ -75,9 +75,8 @@ namespace Lucene.Net.Store
 		/// <param name="lockDirName">where lock files should be created.
 		/// </param>
 		public SimpleFSLockFactory(System.String lockDirName)
+            : this(new System.IO.DirectoryInfo(lockDirName))
 		{
-			lockDir = new System.IO.DirectoryInfo(lockDirName);
-			SetLockDir(lockDir);
 		}
 		
 		public override Lock MakeLock(System.String lockName)

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Support/FileSupport.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Support/FileSupport.cs?rev=1203041&r1=1203040&r2=1203041&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Support/FileSupport.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Support/FileSupport.cs Thu Nov 17 03:49:32 2011
@@ -26,10 +26,12 @@ namespace Lucene.Net.Support
             else
                 return null;
         }
-
+        
+        // TODO: This filesupport thing is silly.  Same goes with _TestUtil's RMDir.
+        //       If we're removing a directory
         public static System.IO.FileInfo[] GetFiles(System.IO.DirectoryInfo path)
         {
-            return path.GetFiles();
+            return GetFiles(new FileInfo(path.FullName));
         }
 
         /// <summary>

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/CloseableThreadLocal.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/CloseableThreadLocal.cs?rev=1203041&r1=1203040&r2=1203041&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/CloseableThreadLocal.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/src/core/Util/CloseableThreadLocal.cs Thu Nov 17 03:49:32 2011
@@ -17,6 +17,7 @@
 
 using System;
 using System.Collections.Generic;
+using System.Linq;
 using System.Threading;
 using Lucene.Net.Support;
 
@@ -96,14 +97,14 @@ namespace Lucene.Net.Util
             {
                 //hardRefs[Thread.CurrentThread] = @object;
                 hardRefs.Add(Thread.CurrentThread, @object);
-
+                
+                // Java's iterator can remove, .NET's cannot
+                var threadsToRemove = hardRefs.Keys.Where(thread => !thread.IsAlive).ToList();
                 // Purge dead threads
-                foreach (var thread in hardRefs.Keys)
+                foreach (var thread in threadsToRemove)
                 {
-                    if (!thread.IsAlive)
-                        hardRefs.Remove(thread);
+                    hardRefs.Remove(thread);
                 }
-
             }
         }
 

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriter.cs?rev=1203041&r1=1203040&r2=1203041&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriter.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestIndexWriter.cs Thu Nov 17 03:49:32 2011
@@ -2812,14 +2812,14 @@ namespace Lucene.Net.Index
                         if (ioe.Message.StartsWith("fake disk full at") || ioe.Message.Equals("now failing on purpose"))
                         {
                             diskFull = true;
-                            try
-                            {
+                            //try
+                            //{
                                 System.Threading.Thread.Sleep(new System.TimeSpan((System.Int64)10000 * 1));
-                            }
-                            catch (System.Threading.ThreadInterruptedException ie)
-                            {
-                                throw;
-                            }
+                            //}
+                            //catch (System.Threading.ThreadInterruptedException ie)
+                            //{
+                            //    throw;
+                            //}
                             if (fullCount++ >= 5)
                                 break;
                         }
@@ -3627,7 +3627,7 @@ namespace Lucene.Net.Index
                 writer.AddDocument(document);
             writer.Close();
 
-            IndexReader ir = IndexReader.Open(dir, true);
+            IndexReader ir = IndexReader.Open(dir, false);
             Assert.AreEqual(10, ir.MaxDoc());
             Assert.AreEqual(10, ir.NumDocs());
             ir.DeleteDocument(0);
@@ -3641,7 +3641,7 @@ namespace Lucene.Net.Index
             writer.ExpungeDeletes();
             Assert.AreEqual(8, writer.NumDocs());
             writer.Close();
-            ir = IndexReader.Open(dir);
+            ir = IndexReader.Open(dir, true);
             Assert.AreEqual(8, ir.MaxDoc());
             Assert.AreEqual(8, ir.NumDocs());
             ir.Close();
@@ -3669,7 +3669,7 @@ namespace Lucene.Net.Index
                 writer.AddDocument(document);
             writer.Close();
 
-            IndexReader ir = IndexReader.Open(dir, true);
+            IndexReader ir = IndexReader.Open(dir, false);
             Assert.AreEqual(98, ir.MaxDoc());
             Assert.AreEqual(98, ir.NumDocs());
             for (int i = 0; i < 98; i += 2)
@@ -5782,7 +5782,7 @@ namespace Lucene.Net.Index
             w.AddDocument(doc);
 
             // commit to "first"
-            Dictionary<string, string> commitData = new Dictionary<string, string>();
+            IDictionary<string, string> commitData = new HashMap<string, string>();
             commitData["tag"]="first";
             w.Commit(commitData);
 
@@ -5796,7 +5796,9 @@ namespace Lucene.Net.Index
             IndexCommit commit = null;
             foreach(var c in IndexReader.ListCommits(dir))
             {
-                string tag = c.GetUserData()["tag"];
+                //string tag = c.GetUserData()["tag"];
+                var thing = c.GetUserData();
+                string tag = thing["tag"];
                 if ("first".Equals(tag))
                 {
                     commit = c;

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestParallelReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestParallelReader.cs?rev=1203041&r1=1203040&r2=1203041&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestParallelReader.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Index/TestParallelReader.cs Thu Nov 17 03:49:32 2011
@@ -77,8 +77,8 @@ namespace Lucene.Net.Index
 			Directory dir1 = GetDir1();
 			Directory dir2 = GetDir2();
 			ParallelReader pr = new ParallelReader();
-			pr.Add(IndexReader.Open(dir1));
-			pr.Add(IndexReader.Open(dir2));
+            pr.Add(IndexReader.Open(dir1, false));
+            pr.Add(IndexReader.Open(dir2, false));
             System.Collections.Generic.ICollection<string> fieldNames = pr.GetFieldNames(IndexReader.FieldOption.ALL);
 			Assert.AreEqual(4, fieldNames.Count);
 			Assert.IsTrue(CollectionsHelper.Contains(fieldNames, "f1"));
@@ -93,8 +93,8 @@ namespace Lucene.Net.Index
 			Directory dir1 = GetDir1();
 			Directory dir2 = GetDir2();
 			ParallelReader pr = new ParallelReader();
-			pr.Add(IndexReader.Open(dir1));
-			pr.Add(IndexReader.Open(dir2));
+            pr.Add(IndexReader.Open(dir1, false));
+            pr.Add(IndexReader.Open(dir2, false));
 			
 			Document doc11 = pr.Document(0, new MapFieldSelector(new System.String[]{"f1"}));
 			Document doc24 = pr.Document(1, new MapFieldSelector(new System.Collections.ArrayList(new System.String[]{"f4"})));
@@ -125,10 +125,10 @@ namespace Lucene.Net.Index
 			w2.Close();
 			
 			ParallelReader pr = new ParallelReader();
-			pr.Add(IndexReader.Open(dir1));
+            pr.Add(IndexReader.Open(dir1, false));
 			try
 			{
-				pr.Add(IndexReader.Open(dir2));
+                pr.Add(IndexReader.Open(dir2, false));
 				Assert.Fail("didn't get exptected exception: indexes don't have same number of documents");
 			}
 			catch (System.ArgumentException e)
@@ -143,19 +143,19 @@ namespace Lucene.Net.Index
 			Directory dir1 = GetDir1();
 			Directory dir2 = GetDir2();
 			ParallelReader pr = new ParallelReader();
-			pr.Add(IndexReader.Open(dir1));
-			pr.Add(IndexReader.Open(dir2));
+			pr.Add(IndexReader.Open(dir1, false));
+            pr.Add(IndexReader.Open(dir2, false));
 			
 			Assert.IsTrue(pr.IsCurrent());
-			IndexReader modifier = IndexReader.Open(dir1);
+            IndexReader modifier = IndexReader.Open(dir1, false);
 			modifier.SetNorm(0, "f1", 100);
 			modifier.Close();
 			
 			// one of the two IndexReaders which ParallelReader is using
 			// is not current anymore
 			Assert.IsFalse(pr.IsCurrent());
-			
-			modifier = IndexReader.Open(dir2);
+
+            modifier = IndexReader.Open(dir2, false);
 			modifier.SetNorm(0, "f3", 100);
 			modifier.Close();
 			
@@ -184,8 +184,8 @@ namespace Lucene.Net.Index
 			
 			
 			ParallelReader pr = new ParallelReader();
-			pr.Add(IndexReader.Open(dir1));
-			pr.Add(IndexReader.Open(dir2));
+            pr.Add(IndexReader.Open(dir1, false));
+            pr.Add(IndexReader.Open(dir2, false));
 			Assert.IsFalse(pr.IsOptimized());
 			pr.Close();
 			
@@ -194,8 +194,8 @@ namespace Lucene.Net.Index
 			modifier.Close();
 			
 			pr = new ParallelReader();
-			pr.Add(IndexReader.Open(dir1));
-			pr.Add(IndexReader.Open(dir2));
+            pr.Add(IndexReader.Open(dir1, false));
+            pr.Add(IndexReader.Open(dir2, false));
 			// just one of the two indexes are optimized
 			Assert.IsFalse(pr.IsOptimized());
 			pr.Close();
@@ -206,8 +206,8 @@ namespace Lucene.Net.Index
 			modifier.Close();
 			
 			pr = new ParallelReader();
-			pr.Add(IndexReader.Open(dir1));
-			pr.Add(IndexReader.Open(dir2));
+            pr.Add(IndexReader.Open(dir1, false));
+            pr.Add(IndexReader.Open(dir2, false));
 			// now both indexes are optimized
 			Assert.IsTrue(pr.IsOptimized());
 			pr.Close();
@@ -219,8 +219,8 @@ namespace Lucene.Net.Index
 			Directory dir1 = GetDir1();
 			Directory dir2 = GetDir2();
 			ParallelReader pr = new ParallelReader();
-			pr.Add(IndexReader.Open(dir1));
-			pr.Add(IndexReader.Open(dir2));
+            pr.Add(IndexReader.Open(dir1, false));
+            pr.Add(IndexReader.Open(dir2, false));
 			int NUM_DOCS = 2;
 			TermDocs td = pr.TermDocs(null);
 			for (int i = 0; i < NUM_DOCS; i++)
@@ -271,8 +271,8 @@ namespace Lucene.Net.Index
 			d2.Add(new Field("f4", "v2", Field.Store.YES, Field.Index.ANALYZED));
 			w.AddDocument(d2);
 			w.Close();
-			
-			return new IndexSearcher(dir);
+
+            return new IndexSearcher(dir, false);
 		}
 		
 		// Fields 1 & 2 in one index, 3 & 4 in other, with ParallelReader:
@@ -281,8 +281,8 @@ namespace Lucene.Net.Index
 			Directory dir1 = GetDir1();
 			Directory dir2 = GetDir2();
 			ParallelReader pr = new ParallelReader();
-			pr.Add(IndexReader.Open(dir1));
-			pr.Add(IndexReader.Open(dir2));
+            pr.Add(IndexReader.Open(dir1, false));
+            pr.Add(IndexReader.Open(dir2, false));
 			return new IndexSearcher(pr);
 		}
 		

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Search/TestCustomSearcherSort.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Search/TestCustomSearcherSort.cs?rev=1203041&r1=1203040&r2=1203041&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Search/TestCustomSearcherSort.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Search/TestCustomSearcherSort.cs Thu Nov 17 03:49:32 2011
@@ -118,7 +118,7 @@ namespace Lucene.Net.Search
 		{
 			// log("Run testFieldSortSingleSearcher");
 			// define the sort criteria
-			Sort custSort = new Sort(new SortField("publicationDate_"), SortField.FIELD_SCORE);
+			Sort custSort = new Sort(new SortField("publicationDate_", SortField.STRING), SortField.FIELD_SCORE);
 			Searcher searcher = new MultiSearcher(new Searcher[]{new CustomSearcher(this, index, 2)});
 			// search and check hits
 			MatchHits(searcher, custSort);
@@ -129,7 +129,7 @@ namespace Lucene.Net.Search
 		{
 			// log("Run testFieldSortMultiCustomSearcher");
 			// define the sort criteria
-			Sort custSort = new Sort(new SortField("publicationDate_"), SortField.FIELD_SCORE);
+            Sort custSort = new Sort(new SortField("publicationDate_", SortField.STRING), SortField.FIELD_SCORE);
 			Searcher searcher = new MultiSearcher(new Searchable[]{new CustomSearcher(this, index, 0), new CustomSearcher(this, index, 2)});
 			// search and check hits
 			MatchHits(searcher, custSort);
@@ -231,10 +231,12 @@ namespace Lucene.Net.Search
 				
 			}
 			private int switcher;
-			/// <param name="directory">
-			/// </param>
-			/// <throws>  IOException </throws>
-			public CustomSearcher(TestCustomSearcherSort enclosingInstance, Directory directory, int switcher):base(directory)
+
+		    /// <param name="directory">
+		    /// </param>
+		    /// <throws>  IOException </throws>
+		    public CustomSearcher(TestCustomSearcherSort enclosingInstance, Directory directory, int switcher)
+		        : base(directory, true)
 			{
 				InitBlock(enclosingInstance);
 				this.switcher = switcher;

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Search/TestSetNorm.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Search/TestSetNorm.cs?rev=1203041&r1=1203040&r2=1203041&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Search/TestSetNorm.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Search/TestSetNorm.cs Thu Nov 17 03:49:32 2011
@@ -97,7 +97,7 @@ namespace Lucene.Net.Search
 			writer.Close();
 			
 			// reset the boost of each instance of this document
-			IndexReader reader = IndexReader.Open(store);
+			IndexReader reader = IndexReader.Open(store, false);
 			reader.SetNorm(0, "field", 1.0f);
 			reader.SetNorm(1, "field", 2.0f);
 			reader.SetNorm(2, "field", 4.0f);
@@ -107,7 +107,7 @@ namespace Lucene.Net.Search
 			// check that searches are ordered by this boost
 			float[] scores = new float[4];
 			
-			new IndexSearcher(store).Search(new TermQuery(new Term("field", "word")), new AnonymousClassCollector(scores, this));
+			new IndexSearcher(store, true).Search(new TermQuery(new Term("field", "word")), new AnonymousClassCollector(scores, this));
 			
 			float lastScore = 0.0f;
 			

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Search/TestTermRangeQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Search/TestTermRangeQuery.cs?rev=1203041&r1=1203040&r2=1203041&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Search/TestTermRangeQuery.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/Search/TestTermRangeQuery.cs Thu Nov 17 03:49:32 2011
@@ -33,12 +33,9 @@ using LuceneTestCase = Lucene.Net.Util.L
 
 namespace Lucene.Net.Search
 {
-	
-	
     [TestFixture]
 	public class TestTermRangeQuery:LuceneTestCase
 	{
-		
 		private int docCount = 0;
 		private RAMDirectory dir;
 		
@@ -54,62 +51,43 @@ namespace Lucene.Net.Search
 		{
 			Query query = new TermRangeQuery("content", "A", "C", false, false);
 			InitializeIndex(new System.String[]{"A", "B", "C", "D"});
-			IndexSearcher searcher = new IndexSearcher(dir);
+			IndexSearcher searcher = new IndexSearcher(dir, true);
 			ScoreDoc[] hits = searcher.Search(query, null, 1000).ScoreDocs;
 			Assert.AreEqual(1, hits.Length, "A,B,C,D, only B in range");
 			searcher.Close();
 			
 			InitializeIndex(new System.String[]{"A", "B", "D"});
-			searcher = new IndexSearcher(dir);
+			searcher = new IndexSearcher(dir, true);
 			hits = searcher.Search(query, null, 1000).ScoreDocs;
 			Assert.AreEqual(1, hits.Length, "A,B,D, only B in range");
 			searcher.Close();
 			
 			AddDoc("C");
-			searcher = new IndexSearcher(dir);
+			searcher = new IndexSearcher(dir, true);
 			hits = searcher.Search(query, null, 1000).ScoreDocs;
 			Assert.AreEqual(1, hits.Length, "C added, still only B in range");
 			searcher.Close();
 		}
 		
-		//TODO: remove in Lucene 3.0
-        [Test]
-		public virtual void  TestDeprecatedCstrctors()
-		{
-			Query query = new RangeQuery(null, new Term("content", "C"), false);
-			InitializeIndex(new System.String[]{"A", "B", "C", "D"});
-			IndexSearcher searcher = new IndexSearcher(dir);
-			ScoreDoc[] hits = searcher.Search(query, null, 1000).ScoreDocs;
-			Assert.AreEqual(2, hits.Length, "A,B,C,D, only B in range");
-			searcher.Close();
-			
-			query = new RangeQuery(new Term("content", "C"), null, false);
-			InitializeIndex(new System.String[]{"A", "B", "C", "D"});
-			searcher = new IndexSearcher(dir);
-			hits = searcher.Search(query, null, 1000).ScoreDocs;
-			Assert.AreEqual(1, hits.Length, "A,B,C,D, only B in range");
-			searcher.Close();
-		}
-		
         [Test]
 		public virtual void  TestInclusive()
 		{
 			Query query = new TermRangeQuery("content", "A", "C", true, true);
 			
 			InitializeIndex(new System.String[]{"A", "B", "C", "D"});
-			IndexSearcher searcher = new IndexSearcher(dir);
+			IndexSearcher searcher = new IndexSearcher(dir, true);
 			ScoreDoc[] hits = searcher.Search(query, null, 1000).ScoreDocs;
 			Assert.AreEqual(3, hits.Length, "A,B,C,D - A,B,C in range");
 			searcher.Close();
 			
 			InitializeIndex(new System.String[]{"A", "B", "D"});
-			searcher = new IndexSearcher(dir);
+			searcher = new IndexSearcher(dir, true);
 			hits = searcher.Search(query, null, 1000).ScoreDocs;
 			Assert.AreEqual(2, hits.Length, "A,B,D - A and B in range");
 			searcher.Close();
 			
 			AddDoc("C");
-			searcher = new IndexSearcher(dir);
+			searcher = new IndexSearcher(dir, true);
 			hits = searcher.Search(query, null, 1000).ScoreDocs;
 			Assert.AreEqual(3, hits.Length, "C added - A, B, C in range");
 			searcher.Close();
@@ -168,19 +146,19 @@ namespace Lucene.Net.Search
 		{
 			Query query = new TermRangeQuery("content", "A", "C", false, false, new System.Globalization.CultureInfo("en").CompareInfo);
 			InitializeIndex(new System.String[]{"A", "B", "C", "D"});
-			IndexSearcher searcher = new IndexSearcher(dir);
+			IndexSearcher searcher = new IndexSearcher(dir, true);
 			ScoreDoc[] hits = searcher.Search(query, null, 1000).ScoreDocs;
 			Assert.AreEqual(1, hits.Length, "A,B,C,D, only B in range");
 			searcher.Close();
 			
 			InitializeIndex(new System.String[]{"A", "B", "D"});
-			searcher = new IndexSearcher(dir);
+            searcher = new IndexSearcher(dir, true);
 			hits = searcher.Search(query, null, 1000).ScoreDocs;
 			Assert.AreEqual(1, hits.Length, "A,B,D, only B in range");
 			searcher.Close();
 			
 			AddDoc("C");
-			searcher = new IndexSearcher(dir);
+            searcher = new IndexSearcher(dir, true);
 			hits = searcher.Search(query, null, 1000).ScoreDocs;
 			Assert.AreEqual(1, hits.Length, "C added, still only B in range");
 			searcher.Close();
@@ -192,19 +170,19 @@ namespace Lucene.Net.Search
 			Query query = new TermRangeQuery("content", "A", "C", true, true, new System.Globalization.CultureInfo("en").CompareInfo);
 			
 			InitializeIndex(new System.String[]{"A", "B", "C", "D"});
-			IndexSearcher searcher = new IndexSearcher(dir);
+            IndexSearcher searcher = new IndexSearcher(dir, true);
 			ScoreDoc[] hits = searcher.Search(query, null, 1000).ScoreDocs;
 			Assert.AreEqual(3, hits.Length, "A,B,C,D - A,B,C in range");
 			searcher.Close();
 			
 			InitializeIndex(new System.String[]{"A", "B", "D"});
-			searcher = new IndexSearcher(dir);
+            searcher = new IndexSearcher(dir, true);
 			hits = searcher.Search(query, null, 1000).ScoreDocs;
 			Assert.AreEqual(2, hits.Length, "A,B,D - A and B in range");
 			searcher.Close();
 			
 			AddDoc("C");
-			searcher = new IndexSearcher(dir);
+            searcher = new IndexSearcher(dir, true);
 			hits = searcher.Search(query, null, 1000).ScoreDocs;
 			Assert.AreEqual(3, hits.Length, "C added - A, B, C in range");
 			searcher.Close();
@@ -223,7 +201,7 @@ namespace Lucene.Net.Search
 			// index Term below should NOT be returned by a TermRangeQuery with a Farsi
 			// Collator (or an Arabic one for the case when Farsi is not supported).
 			InitializeIndex(new System.String[]{"\u0633\u0627\u0628"});
-			IndexSearcher searcher = new IndexSearcher(dir);
+            IndexSearcher searcher = new IndexSearcher(dir, true);
 			ScoreDoc[] hits = searcher.Search(query, null, 1000).ScoreDocs;
 			Assert.AreEqual(0, hits.Length, "The index Term should not be included.");
 			
@@ -245,7 +223,7 @@ namespace Lucene.Net.Search
 			// Unicode order would not include "H\u00C5T" in [ "H\u00D8T", "MAND" ],
 			// but Danish collation does.
 			InitializeIndex(words);
-			IndexSearcher searcher = new IndexSearcher(dir);
+            IndexSearcher searcher = new IndexSearcher(dir, true);
 			ScoreDoc[] hits = searcher.Search(query, null, 1000).ScoreDocs;
 			Assert.AreEqual(1, hits.Length, "The index Term should be included.");
 			
@@ -271,7 +249,7 @@ namespace Lucene.Net.Search
 				
 				public override bool IncrementToken()
 				{
-					int count = input.Read((System.Char[]) buffer, 0, buffer.Length);
+					int count = input.Read(buffer, 0, buffer.Length);
 					if (done)
 						return false;
 					else
@@ -356,27 +334,27 @@ namespace Lucene.Net.Search
 			//http://issues.apache.org/jira/browse/LUCENE-38
 			Query query = new TermRangeQuery("content", null, "C", false, false);
 			InitializeIndex(new System.String[]{"A", "B", "", "C", "D"}, analyzer);
-			IndexSearcher searcher = new IndexSearcher(dir);
-			Hits hits = searcher.Search(query);
+            IndexSearcher searcher = new IndexSearcher(dir, true);
+			int numHits = searcher.Search(query, null, 1000).TotalHits;
 			// When Lucene-38 is fixed, use the assert on the next line:
-			Assert.AreEqual(3, hits.Length(), "A,B,<empty string>,C,D => A, B & <empty string> are in range");
+            Assert.AreEqual(3, numHits, "A,B,<empty string>,C,D => A, B & <empty string> are in range");
 			// until Lucene-38 is fixed, use this assert:
             //Assert.AreEqual(2, hits.length(),"A,B,<empty string>,C,D => A, B & <empty string> are in range");
 			
 			searcher.Close();
 			InitializeIndex(new System.String[]{"A", "B", "", "D"}, analyzer);
-			searcher = new IndexSearcher(dir);
-			hits = searcher.Search(query);
+            searcher = new IndexSearcher(dir, true);
+            numHits = searcher.Search(query, null, 1000).TotalHits;
 			// When Lucene-38 is fixed, use the assert on the next line:
-			Assert.AreEqual(3, hits.Length(), "A,B,<empty string>,D => A, B & <empty string> are in range");
+            Assert.AreEqual(3, numHits, "A,B,<empty string>,D => A, B & <empty string> are in range");
 			// until Lucene-38 is fixed, use this assert:
             //Assert.AreEqual(2, hits.length(), "A,B,<empty string>,D => A, B & <empty string> are in range");
 			searcher.Close();
 			AddDoc("C");
-			searcher = new IndexSearcher(dir);
-			hits = searcher.Search(query);
+            searcher = new IndexSearcher(dir, true);
+            numHits = searcher.Search(query, null, 1000).TotalHits;
 			// When Lucene-38 is fixed, use the assert on the next line:
-			Assert.AreEqual(3, hits.Length(), "C added, still A, B & <empty string> are in range");
+            Assert.AreEqual(3, numHits, "C added, still A, B & <empty string> are in range");
 			// until Lucene-38 is fixed, use this assert
             //Assert.AreEqual(2, hits.length(), "C added, still A, B & <empty string> are in range");
 			searcher.Close();
@@ -390,26 +368,26 @@ namespace Lucene.Net.Search
 			Analyzer analyzer = new SingleCharAnalyzer();
 			Query query = new TermRangeQuery("content", null, "C", true, true);
 			InitializeIndex(new System.String[]{"A", "B", "", "C", "D"}, analyzer);
-			IndexSearcher searcher = new IndexSearcher(dir);
-			Hits hits = searcher.Search(query);
+            IndexSearcher searcher = new IndexSearcher(dir, true);
+            int numHits = searcher.Search(query, null, 1000).TotalHits;
 			// When Lucene-38 is fixed, use the assert on the next line:
-			Assert.AreEqual(4, hits.Length(), "A,B,<empty string>,C,D => A,B,<empty string>,C in range");
+            Assert.AreEqual(4, numHits, "A,B,<empty string>,C,D => A,B,<empty string>,C in range");
 			// until Lucene-38 is fixed, use this assert
             //Assert.AreEqual(3, hits.length(), "A,B,<empty string>,C,D => A,B,<empty string>,C in range");
 			searcher.Close();
 			InitializeIndex(new System.String[]{"A", "B", "", "D"}, analyzer);
-			searcher = new IndexSearcher(dir);
-			hits = searcher.Search(query);
+            searcher = new IndexSearcher(dir, true);
+            numHits = searcher.Search(query, null, 1000).TotalHits;
 			// When Lucene-38 is fixed, use the assert on the next line:
-			Assert.AreEqual(3, hits.Length(), "A,B,<empty string>,D - A, B and <empty string> in range");
+            Assert.AreEqual(3, numHits, "A,B,<empty string>,D - A, B and <empty string> in range");
 			// until Lucene-38 is fixed, use this assert
             //Assert.AreEqual(2, hits.length(), "A,B,<empty string>,D => A, B and <empty string> in range");
 			searcher.Close();
 			AddDoc("C");
-			searcher = new IndexSearcher(dir);
-			hits = searcher.Search(query);
+            searcher = new IndexSearcher(dir, true);
+            numHits = searcher.Search(query, null, 1000).TotalHits;
 			// When Lucene-38 is fixed, use the assert on the next line:
-			Assert.AreEqual(4, hits.Length(), "C added => A,B,<empty string>,C in range");
+            Assert.AreEqual(4, numHits, "C added => A,B,<empty string>,C in range");
 			// until Lucene-38 is fixed, use this assert
             //Assert.AreEqual(3, hits.length(), "C added => A,B,<empty string>,C in range");
 			searcher.Close();

Modified: incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/UpdatedTests.txt
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/UpdatedTests.txt?rev=1203041&r1=1203040&r2=1203041&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/UpdatedTests.txt (original)
+++ incubator/lucene.net/branches/Lucene.Net.3.0.3/trunk/test/core/UpdatedTests.txt Thu Nov 17 03:49:32 2011
@@ -83,7 +83,7 @@ index\TestNewestSegment.java - IDENTICAL
 index\TestNorms.java - DONE
 index\TestNRTReaderWithThreads.java - Text files are different
 index\TestOmitTf.java - DONE
-index\TestParallelReader.java - Text files are different
+index\TestParallelReader.java - DONE
 index\TestParallelReaderEmptyIndex.java - IDENTICAL
 index\TestParallelTermEnum.java - Text files are different
 index\TestPayloads.java - DONE
@@ -204,7 +204,7 @@ search\TestSort.java - DONE
 search\TestSpanQueryFilter.java - Text files are different
 search\TestStressSort.java - REMOVED
 search\TestTermRangeFilter.java - DONE
-search\TestTermRangeQuery.java - Text files are different
+search\TestTermRangeQuery.java - DONE
 search\TestTermScorer.java - Text files are different
 search\TestTermVectors.java - DONE
 search\TestThreadSafe.java - DONE



Mime
View raw message