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: r1294875 [41/45] - in /incubator/lucene.net/trunk: ./ build/ build/vs2010/contrib/ build/vs2010/test/ doc/ src/ src/contrib/Analyzers/ src/contrib/Analyzers/AR/ src/contrib/Analyzers/BR/ src/contrib/Analyzers/CJK/ src/contrib/Analyzers/Cn/ ...
Date Tue, 28 Feb 2012 22:43:28 GMT
Modified: incubator/lucene.net/trunk/test/core/Search/TestBoolean2.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Search/TestBoolean2.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Search/TestBoolean2.cs (original)
+++ incubator/lucene.net/trunk/test/core/Search/TestBoolean2.cs Tue Feb 28 22:43:08 2012
@@ -16,7 +16,8 @@
  */
 
 using System;
-
+using Lucene.Net.Index;
+using Lucene.Net.Store;
 using NUnit.Framework;
 
 using WhitespaceAnalyzer = Lucene.Net.Analysis.WhitespaceAnalyzer;
@@ -64,8 +65,13 @@ namespace Lucene.Net.Search
 			}
 		}
 		private IndexSearcher searcher;
+	    private IndexSearcher bigSearcher;
+	    private IndexReader reader;
+	    private static int NUM_EXTRA_DOCS = 6000;
 		
 		public const System.String field = "field";
+	    private Directory dir2;
+	    private int mulFactor;
 		
 		[SetUp]
 		public override void  SetUp()
@@ -75,55 +81,84 @@ namespace Lucene.Net.Search
 			IndexWriter writer = new IndexWriter(directory, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
 			for (int i = 0; i < docFields.Length; i++)
 			{
-				Document doc = new Document();
-				doc.Add(new Field(field, docFields[i], Field.Store.NO, Field.Index.ANALYZED));
-				writer.AddDocument(doc);
+				Document document = new Document();
+				document.Add(new Field(field, docFields[i], Field.Store.NO, Field.Index.ANALYZED));
+				writer.AddDocument(document);
 			}
 			writer.Close();
-			searcher = new IndexSearcher(directory);
+			searcher = new IndexSearcher(directory, true);
+
+            // Make big index
+		    dir2 = new MockRAMDirectory(directory);
+
+            // First multiply small test index:
+		    mulFactor = 1;
+		    int docCount = 0;
+		    do
+		    {
+		        Directory copy = new RAMDirectory(dir2);
+                IndexWriter indexWriter = new IndexWriter(dir2, new WhitespaceAnalyzer(), IndexWriter.MaxFieldLength.UNLIMITED);
+		        indexWriter.AddIndexesNoOptimize(new[] {copy});
+		        docCount = indexWriter.MaxDoc();
+		        indexWriter.Close();
+		        mulFactor *= 2;
+		    } while (docCount < 3000);
+
+		    IndexWriter w = new IndexWriter(dir2, new WhitespaceAnalyzer(), IndexWriter.MaxFieldLength.UNLIMITED);
+		    Document doc = new Document();
+            doc.Add(new Field("field2", "xxx", Field.Store.NO, Field.Index.ANALYZED));
+            for (int i = 0; i < NUM_EXTRA_DOCS / 2; i++)
+            {
+                w.AddDocument(doc);
+            }
+            doc = new Document();
+            doc.Add(new Field("field2", "big bad bug", Field.Store.NO, Field.Index.ANALYZED));
+            for (int i = 0; i < NUM_EXTRA_DOCS / 2; i++)
+            {
+                w.AddDocument(doc);
+            }
+            // optimize to 1 segment
+		    w.Optimize();
+		    reader = w.GetReader();
+		    w.Close();
+		    bigSearcher = new IndexSearcher(reader);
 		}
 
         [TearDown]
         public override void TearDown()
         {
-            searcher.Close();
-            searcher = null;
-            GC.Collect();
-            base.TearDown();
+            reader.Close();
+            dir2.Close();
         }
 		
 		private System.String[] docFields = new System.String[]{"w1 w2 w3 w4 w5", "w1 w3 w2 w3", "w1 xx w2 yy w3", "w1 w3 xx w2 yy w3"};
 		
 		public virtual Query MakeQuery(System.String queryText)
 		{
-			Query q = (new QueryParser(field, new WhitespaceAnalyzer())).Parse(queryText);
+			Query q = (new QueryParser(Util.Version.LUCENE_CURRENT, field, new WhitespaceAnalyzer())).Parse(queryText);
 			return q;
 		}
-		
-		public virtual void  QueriesTest(System.String queryText, int[] expDocNrs)
-		{
-			//System.out.println();
-			//System.out.println("Query: " + queryText);
-			try
-			{
-				Query query1 = MakeQuery(queryText);
-				BooleanQuery.SetAllowDocsOutOfOrder(true);
-				ScoreDoc[] hits1 = searcher.Search(query1, null, 1000).ScoreDocs;
-				
-				Query query2 = MakeQuery(queryText); // there should be no need to parse again...
-				BooleanQuery.SetAllowDocsOutOfOrder(false);
-				ScoreDoc[] hits2 = searcher.Search(query2, null, 1000).ScoreDocs;
-				
-				CheckHits.CheckHitsQuery(query2, hits1, hits2, expDocNrs);
-			}
-			finally
-			{
-				// even when a test fails.
-				BooleanQuery.SetAllowDocsOutOfOrder(false);
-			}
-		}
-		
-		[Test]
+
+        public virtual void QueriesTest(System.String queryText, int[] expDocNrs)
+        {
+            //System.out.println();
+            //System.out.println("Query: " + queryText);
+            Query query1 = MakeQuery(queryText);
+            TopScoreDocCollector collector = TopScoreDocCollector.create(1000, false);
+            searcher.Search(query1, null, collector);
+            ScoreDoc[] hits1 = collector.TopDocs().ScoreDocs;
+
+            Query query2 = MakeQuery(queryText); // there should be no need to parse again...
+            collector = TopScoreDocCollector.create(1000, true);
+            searcher.Search(query2, null, collector);
+            ScoreDoc[] hits2 = collector.TopDocs().ScoreDocs;
+
+            Assert.AreEqual(mulFactor*collector.totalHits, bigSearcher.Search(query1, 1).TotalHits);
+
+            CheckHits.CheckHitsQuery(query2, hits1, hits2, expDocNrs);
+        }
+
+	    [Test]
 		public virtual void  TestQueries01()
 		{
 			System.String queryText = "+w3 +xx";
@@ -221,22 +256,29 @@ namespace Lucene.Net.Search
 				for (int i = 0; i < 1000; i++)
 				{
 					int level = rnd.Next(3);
-					q1 = RandBoolQuery(new System.Random((System.Int32) rnd.Next(System.Int32.MaxValue)), level, field, vals, null);
+					q1 = RandBoolQuery(new System.Random(rnd.Next(System.Int32.MaxValue)), rnd.Next(0, 2) == 0 ? false : true, level, field, vals, null);
 					
 					// Can't sort by relevance since floating point numbers may not quite
 					// match up.
 					Sort sort = Sort.INDEXORDER;
 					
-					BooleanQuery.SetAllowDocsOutOfOrder(false);
-					
 					QueryUtils.Check(q1, searcher);
-					
-					ScoreDoc[] hits1 = searcher.Search(q1, null, 1000, sort).ScoreDocs;
-					
-					BooleanQuery.SetAllowDocsOutOfOrder(true);
-					ScoreDoc[] hits2 = searcher.Search(q1, null, 1000, sort).ScoreDocs;
+
+				    TopFieldCollector collector = TopFieldCollector.create(sort, 1000, false, true, true, true);
+				    searcher.Search(q1, null, collector);
+					ScoreDoc[] hits1 = collector.TopDocs().ScoreDocs;
+
+				    collector = TopFieldCollector.create(sort, 1000, false, true, true, false);
+				    searcher.Search(q1, null, collector);
+					ScoreDoc[] hits2 = collector.TopDocs().ScoreDocs;
 					tot += hits2.Length;
 					CheckHits.CheckEqual(q1, hits1, hits2);
+
+                    BooleanQuery q3 = new BooleanQuery();
+				    q3.Add(q1, BooleanClause.Occur.SHOULD);
+                    q3.Add(new PrefixQuery(new Term("field2", "b")), BooleanClause.Occur.SHOULD);
+				    TopDocs hits4 = bigSearcher.Search(q3, 1);
+				    Assert.AreEqual(mulFactor*collector.totalHits + NUM_EXTRA_DOCS/2, hits4.TotalHits);
 				}
 			}
 			catch (System.Exception e)
@@ -245,11 +287,6 @@ namespace Lucene.Net.Search
 				System.Console.Out.WriteLine("failed query: " + q1);
 				throw e;
 			}
-			finally
-			{
-				// even when a test fails.
-				BooleanQuery.SetAllowDocsOutOfOrder(false);
-			}
 			
 			// System.out.println("Total hits:"+tot);
 		}
@@ -264,7 +301,7 @@ namespace Lucene.Net.Search
 		
 		// Random rnd is passed in so that the exact same random query may be created
 		// more than once.
-		public static BooleanQuery RandBoolQuery(System.Random rnd, int level, System.String field, System.String[] vals, TestBoolean2.Callback cb)
+		public static BooleanQuery RandBoolQuery(System.Random rnd, bool allowMust, int level, System.String field, System.String[] vals, TestBoolean2.Callback cb)
 		{
 			BooleanQuery current = new BooleanQuery(rnd.Next() < 0);
 			for (int i = 0; i < rnd.Next(vals.Length) + 1; i++)
@@ -275,19 +312,33 @@ namespace Lucene.Net.Search
 					qType = rnd.Next(10);
 				}
 				Query q;
-				if (qType < 7)
-					q = new TermQuery(new Term(field, vals[rnd.Next(vals.Length)]));
-				else
-					q = RandBoolQuery(rnd, level - 1, field, vals, cb);
-				
-				int r = rnd.Next(10);
+                if (qType < 3)
+                {
+                    q = new TermQuery(new Term(field, vals[rnd.Next(vals.Length)]));
+                }
+                else if (qType < 7)
+                {
+                    q = new WildcardQuery(new Term(field, "w*"));
+                }
+                else
+                {
+                    q = RandBoolQuery(rnd, allowMust, level - 1, field, vals, cb);
+                }
+
+			    int r = rnd.Next(10);
 				BooleanClause.Occur occur;
-				if (r < 2)
-					occur = BooleanClause.Occur.MUST_NOT;
-				else if (r < 5)
-					occur = BooleanClause.Occur.MUST;
-				else
-					occur = BooleanClause.Occur.SHOULD;
+                if (r < 2)
+                {
+                    occur = BooleanClause.Occur.MUST_NOT;
+                }
+                else if (r < 5)
+                {
+                    occur = allowMust ? BooleanClause.Occur.MUST : BooleanClause.Occur.SHOULD;
+                }
+                else
+                {
+                    occur = BooleanClause.Occur.SHOULD;
+                }
 				
 				current.Add(q, occur);
 			}

Modified: incubator/lucene.net/trunk/test/core/Search/TestBooleanMinShouldMatch.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Search/TestBooleanMinShouldMatch.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Search/TestBooleanMinShouldMatch.cs (original)
+++ incubator/lucene.net/trunk/test/core/Search/TestBooleanMinShouldMatch.cs Tue Feb 28 22:43:08 2012
@@ -101,7 +101,7 @@ namespace Lucene.Net.Search
 			writer.Optimize();
 			writer.Close();
 			
-			r = IndexReader.Open(index);
+			r = IndexReader.Open(index, true);
 			s = new IndexSearcher(r);
 			
 			//System.out.println("Set up " + getName());
@@ -370,9 +370,9 @@ namespace Lucene.Net.Search
 			{
 				int lev = rnd.Next(maxLev);
 				long seed = rnd.Next(System.Int32.MaxValue);
-				BooleanQuery q1 = TestBoolean2.RandBoolQuery(new System.Random((System.Int32) seed), lev, field, vals, null);
+				BooleanQuery q1 = TestBoolean2.RandBoolQuery(new System.Random((System.Int32) seed), true, lev, field, vals, null);
 				// BooleanQuery q2 = TestBoolean2.randBoolQuery(new Random(seed), lev, field, vals, minNrCB);
-				BooleanQuery q2 = TestBoolean2.RandBoolQuery(new System.Random((System.Int32) seed), lev, field, vals, null);
+				BooleanQuery q2 = TestBoolean2.RandBoolQuery(new System.Random((System.Int32) seed), true, lev, field, vals, null);
 				// only set minimumNumberShouldMatch on the top level query since setting
 				// at a lower level can change the score.
 				minNrCB.PostCreate(q2);

Modified: incubator/lucene.net/trunk/test/core/Search/TestBooleanOr.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Search/TestBooleanOr.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Search/TestBooleanOr.cs (original)
+++ incubator/lucene.net/trunk/test/core/Search/TestBooleanOr.cs Tue Feb 28 22:43:08 2012
@@ -139,13 +139,12 @@ namespace Lucene.Net.Search
 		public override void  SetUp()
 		{
 			base.SetUp();
-			base.SetUp();
 			
 			//
 			RAMDirectory rd = new RAMDirectory();
 			
 			//
-			IndexWriter writer = new IndexWriter(rd, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
+			IndexWriter writer = new IndexWriter(rd, new StandardAnalyzer(Util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED);
 			
 			//
 			Document d = new Document();
@@ -157,7 +156,7 @@ namespace Lucene.Net.Search
 			writer.Close();
 			
 			//
-			searcher = new IndexSearcher(rd);
+		    searcher = new IndexSearcher(rd, true);
 		}
 	}
 }
\ No newline at end of file

Modified: incubator/lucene.net/trunk/test/core/Search/TestBooleanPrefixQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Search/TestBooleanPrefixQuery.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Search/TestBooleanPrefixQuery.cs (original)
+++ incubator/lucene.net/trunk/test/core/Search/TestBooleanPrefixQuery.cs Tue Feb 28 22:43:08 2012
@@ -32,10 +32,6 @@ namespace Lucene.Net.Search
 {
 	
 	/// <summary> </summary>
-	/// <version>  $Id: TestBooleanPrefixQuery.java 808519 2009-08-27 16:57:27Z mikemccand $
-	/// 
-	/// </version>
-	
     [TestFixture]
 	public class TestBooleanPrefixQuery:LuceneTestCase
 	{
@@ -97,8 +93,8 @@ namespace Lucene.Net.Search
 					writer.AddDocument(doc);
 				}
 				writer.Close();
-				
-				reader = IndexReader.Open(directory);
+
+			    reader = IndexReader.Open(directory, true);
 				PrefixQuery query = new PrefixQuery(new Term("category", "foo"));
 				rw1 = query.Rewrite(reader);
 				

Modified: incubator/lucene.net/trunk/test/core/Search/TestBooleanQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Search/TestBooleanQuery.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Search/TestBooleanQuery.cs (original)
+++ incubator/lucene.net/trunk/test/core/Search/TestBooleanQuery.cs Tue Feb 28 22:43:08 2012
@@ -81,11 +81,37 @@ namespace Lucene.Net.Search
 			Document doc = new Document();
 			doc.Add(new Field("field", "a b c d", Field.Store.NO, Field.Index.ANALYZED));
 			w.AddDocument(doc);
+
 			IndexReader r = w.GetReader();
 			IndexSearcher s = new IndexSearcher(r);
 			BooleanQuery q = new BooleanQuery();
 			q.Add(new TermQuery(new Term("field", "a")), BooleanClause.Occur.SHOULD);
-			
+
+            // LUCENE-2617: make sure that a term not in the index still contributes to the score via coord factor
+            float score = s.Search(q, 10).GetMaxScore();
+            Query subQuery = new TermQuery(new Term("field", "not_in_index"));
+            subQuery.SetBoost(0);
+            q.Add(subQuery, BooleanClause.Occur.SHOULD);
+            float score2 = s.Search(q, 10).GetMaxScore();
+            Assert.AreEqual(score * .5, score2, 1e-6);
+
+            // LUCENE-2617: make sure that a clause not in the index still contributes to the score via coord factor
+            BooleanQuery qq = (BooleanQuery)q.Clone();
+            PhraseQuery phrase = new PhraseQuery();
+            phrase.Add(new Term("field", "not_in_index"));
+            phrase.Add(new Term("field", "another_not_in_index"));
+            phrase.SetBoost(0);
+            qq.Add(phrase, BooleanClause.Occur.SHOULD);
+            score2 = s.Search(qq, 10).GetMaxScore();
+            Assert.AreEqual(score * (1.0 / 3), score2, 1e-6);
+
+            // now test BooleanScorer2
+            subQuery = new TermQuery(new Term("field", "b"));
+            subQuery.SetBoost(0);
+            q.Add(subQuery, BooleanClause.Occur.MUST);
+            score2 = s.Search(q, 10).GetMaxScore();
+            Assert.AreEqual(score * (2.0 / 3), score2, 1e-6);
+
 			// PhraseQuery w/ no terms added returns a null scorer
 			PhraseQuery pq = new PhraseQuery();
 			q.Add(pq, BooleanClause.Occur.SHOULD);

Modified: incubator/lucene.net/trunk/test/core/Search/TestBooleanScorer.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Search/TestBooleanScorer.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Search/TestBooleanScorer.cs (original)
+++ incubator/lucene.net/trunk/test/core/Search/TestBooleanScorer.cs Tue Feb 28 22:43:08 2012
@@ -16,7 +16,7 @@
  */
 
 using System;
-
+using System.Collections.Generic;
 using NUnit.Framework;
 
 using WhitespaceAnalyzer = Lucene.Net.Analysis.WhitespaceAnalyzer;
@@ -29,10 +29,6 @@ using LuceneTestCase = Lucene.Net.Util.L
 
 namespace Lucene.Net.Search
 {
-	
-	/// <summary> </summary>
-	/// <version>  $rcs = ' $Id: TestBooleanScorer.java 782410 2009-06-07 16:58:41Z mikemccand $ ' ;
-	/// </version>
     [TestFixture]
 	public class TestBooleanScorer:LuceneTestCase
 	{
@@ -56,49 +52,24 @@ namespace Lucene.Net.Search
 				InitBlock(enclosingInstance);
 			}
 			private int doc = - 1;
-			public override Explanation Explain(int doc)
-			{
-				return null;
-			}
+
 			public override float Score()
 			{
 				return 0;
 			}
-			/// <deprecated> delete in 3.0. 
-			/// </deprecated>
-            [Obsolete("delete in 3.0")]
-			public override int Doc()
-			{
-				return 3000;
-			}
 			public override int DocID()
 			{
 				return doc;
 			}
-			/// <deprecated> delete in 3.0 
-			/// </deprecated>
-            [Obsolete("delete in 3.0")]
-			public override bool Next()
-			{
-				return NextDoc() != NO_MORE_DOCS;
-			}
 			
 			public override int NextDoc()
 			{
-				return doc = doc == - 1?3000:NO_MORE_DOCS;
-			}
-			
-			/// <deprecated> delete in 3.0 
-			/// </deprecated>
-            [Obsolete("delete in 3.0")]
-			public override bool SkipTo(int target)
-			{
-				return Advance(target) != NO_MORE_DOCS;
+			    return doc = doc == -1 ? 3000 : NO_MORE_DOCS;
 			}
-			
+
 			public override int Advance(int target)
 			{
-				return doc = target <= 3000?3000:NO_MORE_DOCS;
+			    return doc = target <= 3000 ? 3000 : NO_MORE_DOCS;
 			}
 		}
 		
@@ -134,7 +105,7 @@ namespace Lucene.Net.Search
 				query.Add(booleanQuery1, BooleanClause.Occur.MUST);
 				query.Add(new TermQuery(new Term(FIELD, "9")), BooleanClause.Occur.MUST_NOT);
 				
-				IndexSearcher indexSearcher = new IndexSearcher(directory);
+				IndexSearcher indexSearcher = new IndexSearcher(directory, true);
 				ScoreDoc[] hits = indexSearcher.Search(query, null, 1000).ScoreDocs;
 				Assert.AreEqual(2, hits.Length, "Number of matched documents");
 			}
@@ -154,7 +125,7 @@ namespace Lucene.Net.Search
 			
 			Similarity sim = Similarity.GetDefault();
 			Scorer[] scorers = new Scorer[]{new AnonymousClassScorer(this, sim)};
-			BooleanScorer bs = new BooleanScorer(sim, 1, new System.Collections.ArrayList(scorers), null);
+			BooleanScorer bs = new BooleanScorer(sim, 1, new List<Scorer>(scorers), null);
 			
 			Assert.AreEqual(3000, bs.NextDoc(), "should have received 3000");
 			Assert.AreEqual(DocIdSetIterator.NO_MORE_DOCS, bs.NextDoc(), "should have received NO_MORE_DOCS");

Modified: incubator/lucene.net/trunk/test/core/Search/TestCachingWrapperFilter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Search/TestCachingWrapperFilter.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Search/TestCachingWrapperFilter.cs (original)
+++ incubator/lucene.net/trunk/test/core/Search/TestCachingWrapperFilter.cs Tue Feb 28 22:43:08 2012
@@ -41,7 +41,7 @@ namespace Lucene.Net.Search
             IndexWriter writer = new IndexWriter(dir, new KeywordAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
             writer.Close();
 
-            IndexReader reader = IndexReader.Open(dir);
+            IndexReader reader = IndexReader.Open(dir, true);
 
             MockFilter filter = new MockFilter();
             CachingWrapperFilter cacher = new CachingWrapperFilter(filter);
@@ -50,8 +50,7 @@ namespace Lucene.Net.Search
             cacher.GetDocIdSet(reader);
             Assert.IsTrue(filter.WasCalled(), "first time");
 
-            // make sure no exception if cache is holding the wrong bitset
-            cacher.Bits(reader);
+            // make sure no exception if cache is holding the wrong DocIdSet
             cacher.GetDocIdSet(reader);
 
             // second time, nested filter should not be called
@@ -100,17 +99,6 @@ namespace Lucene.Net.Search
             IndexReader reader = IndexReader.Open(dir, true);
 
             Filter filter = new AnonymousFilter2();
-            //final Filter filter = new Filter() {
-            //  //@Override
-            //  public DocIdSet getDocIdSet(IndexReader reader) {
-            //    return new DocIdSet() {
-            //      //@Override
-            //      public DocIdSetIterator iterator() {
-            //        return null;
-            //      }
-            //    };
-            //  }
-            //};
             CachingWrapperFilter cacher = new CachingWrapperFilter(filter);
 
             // the caching filter should return the empty set constant
@@ -154,13 +142,13 @@ namespace Lucene.Net.Search
         }
 
         [Test]
-        public void TestIsCacheAble()
+        public void TestIsCacheable()
         {
             Directory dir = new RAMDirectory();
             IndexWriter writer = new IndexWriter(dir, new KeywordAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
             writer.Close();
 
-            IndexReader reader = IndexReader.Open(dir);
+            IndexReader reader = IndexReader.Open(dir, true);
 
             // not cacheable:
             assertDocIdSetCacheable(reader, new QueryWrapperFilter(new TermQuery(new Term("test", "value"))), false);
@@ -170,24 +158,10 @@ namespace Lucene.Net.Search
             assertDocIdSetCacheable(reader, FieldCacheRangeFilter.NewIntRange("test", 10, 20, true, true), true);
             // a openbitset filter is always cacheable
             assertDocIdSetCacheable(reader, new AnonymousFilter3(), true);
-            // a deprecated filter is always cacheable
-            assertDocIdSetCacheable(reader, new AnonymousFilter4(), true);
 
             reader.Close();
         }
-        /*
-          new Filter() {
-              public DocIdSet getDocIdSet(IndexReader reader) {
-                return new OpenBitSet();
-              }
-            }
-    
-         * new Filter() {
-              public BitSet bits(IndexReader reader) {
-                return new BitSet();
-              }
-            }
-         */
+
         class AnonymousFilter3 : Filter
         {
             public override DocIdSet GetDocIdSet(IndexReader reader)
@@ -196,14 +170,6 @@ namespace Lucene.Net.Search
             }
         }
 
-        class AnonymousFilter4 : Filter
-        {
-            public override System.Collections.BitArray Bits(IndexReader reader)
-            {
-                return new System.Collections.BitArray(100000); //DIGY
-            }
-        }
-
         [Test]
         public void TestEnforceDeletions()
         {

Modified: incubator/lucene.net/trunk/test/core/Search/TestCustomSearcherSort.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Search/TestCustomSearcherSort.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Search/TestCustomSearcherSort.cs (original)
+++ incubator/lucene.net/trunk/test/core/Search/TestCustomSearcherSort.cs Tue Feb 28 22:43:08 2012
@@ -67,7 +67,7 @@ namespace Lucene.Net.Search
 		private Directory GetIndex()
 		{
 			RAMDirectory indexStore = new RAMDirectory();
-			IndexWriter writer = new IndexWriter(indexStore, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
+			IndexWriter writer = new IndexWriter(indexStore, new StandardAnalyzer(Util.Version.LUCENE_CURRENT), true, IndexWriter.MaxFieldLength.LIMITED);
 			RandomGen random = new RandomGen(this, NewRandom());
 			for (int i = 0; i < INDEX_SIZE; ++i)
 			{
@@ -107,7 +107,7 @@ namespace Lucene.Net.Search
 		{
 			// log("Run testFieldSortCustomSearcher");
 			// define the sort criteria
-			Sort custSort = new Sort(new SortField[]{new SortField("publicationDate_"), SortField.FIELD_SCORE});
+			Sort custSort = new Sort(new SortField("publicationDate_", SortField.STRING), SortField.FIELD_SCORE);
 			Searcher searcher = new CustomSearcher(this, index, 2);
 			// search and check hits
 			MatchHits(searcher, custSort);
@@ -118,7 +118,7 @@ namespace Lucene.Net.Search
 		{
 			// log("Run testFieldSortSingleSearcher");
 			// define the sort criteria
-			Sort custSort = new Sort(new SortField[]{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[]{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);
@@ -146,7 +146,7 @@ namespace Lucene.Net.Search
 			// store hits in TreeMap - TreeMap does not allow duplicates; existing entries are silently overwritten
 			for (int hitid = 0; hitid < hitsByRank.Length; ++hitid)
 			{
-				resultMap[(System.Int32) hitsByRank[hitid].doc] = (System.Int32) hitid; // Value: Hits-Objekt Index
+				resultMap[hitsByRank[hitid].doc] = hitid; // Value: Hits-Objekt Index
 			}
 			
 			// now make a query using the sort criteria
@@ -187,9 +187,9 @@ namespace Lucene.Net.Search
 				System.Collections.IDictionary idMap = new System.Collections.SortedList();
 				for (int docnum = 0; docnum < hits.Length; ++docnum)
 				{
-					System.Int32 luceneId;
+					int luceneId;
 					
-					luceneId = (System.Int32) hits[docnum].doc;
+					luceneId = hits[docnum].doc;
 					if (idMap.Contains(luceneId))
 					{
 						System.Text.StringBuilder message = new System.Text.StringBuilder(prefix);
@@ -203,7 +203,7 @@ namespace Lucene.Net.Search
 					}
 					else
 					{
-						idMap[luceneId] = (System.Int32) docnum;
+						idMap[luceneId] = docnum;
 					}
 				}
 			}
@@ -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;
@@ -246,14 +248,6 @@ namespace Lucene.Net.Search
 				InitBlock(enclosingInstance);
 				this.switcher = switcher;
 			}
-			/// <param name="path">
-			/// </param>
-			/// <throws>  IOException </throws>
-			public CustomSearcher(TestCustomSearcherSort enclosingInstance, System.String path, int switcher):base(path)
-			{
-				InitBlock(enclosingInstance);
-				this.switcher = switcher;
-			}
 			/* (non-Javadoc)
 			* @see Lucene.Net.Search.Searchable#search(Lucene.Net.Search.Query, Lucene.Net.Search.Filter, int, Lucene.Net.Search.Sort)
 			*/

Modified: incubator/lucene.net/trunk/test/core/Search/TestDateFilter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Search/TestDateFilter.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Search/TestDateFilter.cs (original)
+++ incubator/lucene.net/trunk/test/core/Search/TestDateFilter.cs Tue Feb 28 22:43:08 2012
@@ -35,7 +35,7 @@ namespace Lucene.Net.Search
 	/// 
 	/// 
 	/// </summary>
-	/// <version>  $Revision: 791175 $
+	/// <version>  $Revision: 821340 $
 	/// </version>
     [TestFixture]
 	public class TestDateFilter:LuceneTestCase
@@ -58,8 +58,8 @@ namespace Lucene.Net.Search
 			writer.AddDocument(doc);
 			writer.Optimize();
 			writer.Close();
-			
-			IndexSearcher searcher = new IndexSearcher(indexStore);
+
+		    IndexSearcher searcher = new IndexSearcher(indexStore, true);
 			
 			// filter that should preserve matches
 			//DateFilter df1 = DateFilter.Before("datefield", now);
@@ -115,8 +115,8 @@ namespace Lucene.Net.Search
 			writer.AddDocument(doc);
 			writer.Optimize();
 			writer.Close();
-			
-			IndexSearcher searcher = new IndexSearcher(indexStore);
+
+		    IndexSearcher searcher = new IndexSearcher(indexStore, true);
 			
 			// filter that should preserve matches
 			//DateFilter df1 = DateFilter.After("datefield", now);

Modified: incubator/lucene.net/trunk/test/core/Search/TestDateSort.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Search/TestDateSort.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Search/TestDateSort.cs (original)
+++ incubator/lucene.net/trunk/test/core/Search/TestDateSort.cs Tue Feb 28 22:43:08 2012
@@ -72,13 +72,11 @@ namespace Lucene.Net.Search
 		[Test]
 		public virtual void  TestReverseDateSort()
 		{
-			IndexSearcher searcher = new IndexSearcher(directory);
+			IndexSearcher searcher = new IndexSearcher(directory, true);
 			
-			// Create a Sort object.  reverse is set to true.
-			// problem occurs only with SortField.AUTO:
-			Sort sort = new Sort(new SortField(DATE_TIME_FIELD, SortField.AUTO, true));
+			Sort sort = new Sort(new SortField(DATE_TIME_FIELD, SortField.STRING, true));
 			
-			QueryParser queryParser = new QueryParser(TEXT_FIELD, new WhitespaceAnalyzer());
+			QueryParser queryParser = new QueryParser(Util.Version.LUCENE_CURRENT, TEXT_FIELD, new WhitespaceAnalyzer());
 			Query query = queryParser.Parse("Document");
 			
 			// Execute the search and process the search results.

Modified: incubator/lucene.net/trunk/test/core/Search/TestDisjunctionMaxQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Search/TestDisjunctionMaxQuery.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Search/TestDisjunctionMaxQuery.cs (original)
+++ incubator/lucene.net/trunk/test/core/Search/TestDisjunctionMaxQuery.cs Tue Feb 28 22:43:08 2012
@@ -136,8 +136,8 @@ namespace Lucene.Net.Search
 			}
 			
 			writer.Close();
-			
-			r = IndexReader.Open(index);
+
+		    r = IndexReader.Open(index, true);
 			s = new IndexSearcher(r);
 			s.SetSimilarity(sim);
 		}

Modified: incubator/lucene.net/trunk/test/core/Search/TestDocBoost.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Search/TestDocBoost.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Search/TestDocBoost.cs (original)
+++ incubator/lucene.net/trunk/test/core/Search/TestDocBoost.cs Tue Feb 28 22:43:08 2012
@@ -111,7 +111,7 @@ namespace Lucene.Net.Search
 			
 			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/trunk/test/core/Search/TestDocIdSet.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Search/TestDocIdSet.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Search/TestDocIdSet.cs (original)
+++ incubator/lucene.net/trunk/test/core/Search/TestDocIdSet.cs Tue Feb 28 22:43:08 2012
@@ -16,7 +16,7 @@
  */
 
 using System;
-
+using Lucene.Net.Support;
 using NUnit.Framework;
 
 using WhitespaceAnalyzer = Lucene.Net.Analysis.WhitespaceAnalyzer;
@@ -68,25 +68,11 @@ namespace Lucene.Net.Search
 				
 				internal int docid = - 1;
 				
-				/** @deprecated use {@link #DocID()} instead. */
-				public override int Doc()
-				{
-					return docid;
-				}
-				
 				public override int DocID()
 				{
 					return docid;
 				}
 				
-				/// <deprecated> use {@link #NextDoc()} instead. 
-				/// </deprecated>
-                [Obsolete("use NextDoc() instead. ")]
-				public override bool Next()
-				{
-					return NextDoc() != NO_MORE_DOCS;
-				}
-				
 				//@Override
 				public override int NextDoc()
 				{
@@ -94,14 +80,6 @@ namespace Lucene.Net.Search
 					return docid < maxdoc?docid:(docid = NO_MORE_DOCS);
 				}
 				
-				/// <deprecated> use {@link #Advance(int)} instead. 
-				/// </deprecated>
-                [Obsolete("use Advance(int) instead. ")]
-				public override bool SkipTo(int target)
-				{
-					return Advance(target) != NO_MORE_DOCS;
-				}
-				
 				//@Override
 				public override int Advance(int target)
 				{
@@ -127,7 +105,6 @@ namespace Lucene.Net.Search
 				
 			}
 			
-			// @Override
 			public override DocIdSetIterator Iterator()
 			{
 				return new AnonymousClassDocIdSetIterator(maxdoc, this);
@@ -212,7 +189,7 @@ namespace Lucene.Net.Search
 				docs[c++] = ((System.Int32) intIter.Current);
 			}
 			int[] answer = new int[]{4, 6, 8};
-			bool same = SupportClass.CollectionsHelper.Equals(answer, docs);
+			bool same = CollectionsHelper.Equals(answer, docs);
 			if (!same)
 			{
 				System.Console.Out.WriteLine("answer: " + _TestUtil.ArrayToString(answer));

Modified: incubator/lucene.net/trunk/test/core/Search/TestElevationComparator.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Search/TestElevationComparator.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Search/TestElevationComparator.cs (original)
+++ incubator/lucene.net/trunk/test/core/Search/TestElevationComparator.cs Tue Feb 28 22:43:08 2012
@@ -72,9 +72,9 @@ namespace Lucene.Net.Search
 			newq.Add(query, BooleanClause.Occur.SHOULD);
 			newq.Add(GetElevatedQuery(new System.String[]{"id", "a", "id", "x"}), BooleanClause.Occur.SHOULD);
 			
-			Sort sort = new Sort(new SortField[]{new SortField("id", new ElevationComparatorSource(priority), false), new SortField(null, SortField.SCORE, reversed)});
+			Sort sort = new Sort(new SortField("id", new ElevationComparatorSource(priority), false), new SortField(null, SortField.SCORE, reversed));
 			
-			TopDocsCollector topCollector = TopFieldCollector.create(sort, 50, false, true, true, true);
+			TopFieldCollector topCollector = TopFieldCollector.create(sort, 50, false, true, true, true);
 			searcher.Search(newq, null, topCollector);
 			
 			TopDocs topDocs = topCollector.TopDocs(0, 10);

Modified: incubator/lucene.net/trunk/test/core/Search/TestExplanations.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Search/TestExplanations.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Search/TestExplanations.cs (original)
+++ incubator/lucene.net/trunk/test/core/Search/TestExplanations.cs Tue Feb 28 22:43:08 2012
@@ -56,7 +56,7 @@ namespace Lucene.Net.Search
 		
 		public const System.String KEY = "KEY";
 		public const System.String FIELD = "field";
-		public static readonly QueryParser qp = new QueryParser(FIELD, new WhitespaceAnalyzer());
+		public static readonly QueryParser qp = new QueryParser(Util.Version.LUCENE_CURRENT, FIELD, new WhitespaceAnalyzer());
 		
 		[TearDown]
 		public override void  TearDown()
@@ -81,7 +81,7 @@ namespace Lucene.Net.Search
 				writer.AddDocument(doc);
 			}
 			writer.Close();
-			searcher = new IndexSearcher(directory);
+		    searcher = new IndexSearcher(directory, true);
 		}
 		
 		protected internal System.String[] docFields = new System.String[]{"w1 w2 w3 w4 w5", "w1 w3 w2 w3 zz", "w1 xx w2 yy w3", "w1 w3 xx w2 yy w3 zz"};

Modified: incubator/lucene.net/trunk/test/core/Search/TestFieldCache.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Search/TestFieldCache.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Search/TestFieldCache.cs (original)
+++ incubator/lucene.net/trunk/test/core/Search/TestFieldCache.cs Tue Feb 28 22:43:08 2012
@@ -60,7 +60,7 @@ namespace Lucene.Net.Search
 				writer.AddDocument(doc);
 			}
 			writer.Close();
-			reader = IndexReader.Open(directory);
+		    reader = IndexReader.Open(directory, true);
 		}
 		
 		[Test]

Modified: incubator/lucene.net/trunk/test/core/Search/TestFieldCacheRangeFilter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Search/TestFieldCacheRangeFilter.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Search/TestFieldCacheRangeFilter.cs (original)
+++ incubator/lucene.net/trunk/test/core/Search/TestFieldCacheRangeFilter.cs Tue Feb 28 22:43:08 2012
@@ -1,7 +1,7 @@
 /* 
  * 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.
+ * 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
@@ -51,10 +51,10 @@ namespace Lucene.Net.Search
 		
         [Test]
 		public virtual void  TestRangeFilterId()
-		{
-			
-			IndexReader reader = IndexReader.Open(signedIndex.index);
-			IndexSearcher search = new IndexSearcher(reader);
+        {
+
+            IndexReader reader = IndexReader.Open(signedIndex.index, true);
+			IndexSearcher Search = new IndexSearcher(reader);
 			
 			int medId = ((maxId - minId) / 2);
 			
@@ -71,76 +71,76 @@ namespace Lucene.Net.Search
 			
 			// test id, bounded on both ends
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("id", minIP, maxIP, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("id", minIP, maxIP, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs, result.Length, "find all");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("id", minIP, maxIP, T, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("id", minIP, maxIP, T, F), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs - 1, result.Length, "all but last");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("id", minIP, maxIP, F, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("id", minIP, maxIP, F, T), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs - 1, result.Length, "all but first");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("id", minIP, maxIP, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("id", minIP, maxIP, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs - 2, result.Length, "all but ends");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("id", medIP, maxIP, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("id", medIP, maxIP, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(1 + maxId - medId, result.Length, "med and up");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("id", minIP, medIP, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("id", minIP, medIP, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(1 + medId - minId, result.Length, "up to med");
 			
 			// unbounded id
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("id", null, null, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("id", null, null, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs, result.Length, "find all");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("id", minIP, null, T, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("id", minIP, null, T, F), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs, result.Length, "min and up");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("id", null, maxIP, F, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("id", null, maxIP, F, T), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs, result.Length, "max and down");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("id", minIP, null, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("id", minIP, null, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs - 1, result.Length, "not min, but up");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("id", null, maxIP, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("id", null, maxIP, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs - 1, result.Length, "not max, but down");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("id", medIP, maxIP, T, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("id", medIP, maxIP, T, F), numDocs).ScoreDocs;
 			Assert.AreEqual(maxId - medId, result.Length, "med and up, not max");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("id", minIP, medIP, F, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("id", minIP, medIP, F, T), numDocs).ScoreDocs;
 			Assert.AreEqual(medId - minId, result.Length, "not min, up to med");
 			
 			// very small sets
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("id", minIP, minIP, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("id", minIP, minIP, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(0, result.Length, "min,min,F,F");
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("id", medIP, medIP, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("id", medIP, medIP, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(0, result.Length, "med,med,F,F");
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("id", maxIP, maxIP, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("id", maxIP, maxIP, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(0, result.Length, "max,max,F,F");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("id", minIP, minIP, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("id", minIP, minIP, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(1, result.Length, "min,min,T,T");
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("id", null, minIP, F, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("id", null, minIP, F, T), numDocs).ScoreDocs;
 			Assert.AreEqual(1, result.Length, "nul,min,F,T");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("id", maxIP, maxIP, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("id", maxIP, maxIP, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(1, result.Length, "max,max,T,T");
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("id", maxIP, null, T, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("id", maxIP, null, T, F), numDocs).ScoreDocs;
 			Assert.AreEqual(1, result.Length, "max,nul,T,T");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("id", medIP, medIP, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("id", medIP, medIP, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(1, result.Length, "med,med,T,T");
 		}
 		
         [Test]
 		public virtual void  TestFieldCacheRangeFilterRand()
-		{
-			
-			IndexReader reader = IndexReader.Open(signedIndex.index);
-			IndexSearcher search = new IndexSearcher(reader);
+        {
+
+            IndexReader reader = IndexReader.Open(signedIndex.index, true);
+			IndexSearcher Search = new IndexSearcher(reader);
 			
 			System.String minRP = Pad(signedIndex.minR);
 			System.String maxRP = Pad(signedIndex.maxR);
@@ -154,47 +154,47 @@ namespace Lucene.Net.Search
 			
 			// test extremes, bounded on both ends
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("rand", minRP, maxRP, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("rand", minRP, maxRP, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs, result.Length, "find all");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("rand", minRP, maxRP, T, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("rand", minRP, maxRP, T, F), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs - 1, result.Length, "all but biggest");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("rand", minRP, maxRP, F, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("rand", minRP, maxRP, F, T), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs - 1, result.Length, "all but smallest");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("rand", minRP, maxRP, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("rand", minRP, maxRP, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs - 2, result.Length, "all but extremes");
 			
 			// unbounded
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("rand", minRP, null, T, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("rand", minRP, null, T, F), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs, result.Length, "smallest and up");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("rand", null, maxRP, F, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("rand", null, maxRP, F, T), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs, result.Length, "biggest and down");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("rand", minRP, null, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("rand", minRP, null, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs - 1, result.Length, "not smallest, but up");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("rand", null, maxRP, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("rand", null, maxRP, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs - 1, result.Length, "not biggest, but down");
 			
 			// very small sets
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("rand", minRP, minRP, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("rand", minRP, minRP, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(0, result.Length, "min,min,F,F");
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("rand", maxRP, maxRP, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("rand", maxRP, maxRP, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(0, result.Length, "max,max,F,F");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("rand", minRP, minRP, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("rand", minRP, minRP, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(1, result.Length, "min,min,T,T");
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("rand", null, minRP, F, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("rand", null, minRP, F, T), numDocs).ScoreDocs;
 			Assert.AreEqual(1, result.Length, "nul,min,F,T");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("rand", maxRP, maxRP, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("rand", maxRP, maxRP, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(1, result.Length, "max,max,T,T");
-			result = search.Search(q, FieldCacheRangeFilter.NewStringRange("rand", maxRP, null, T, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewStringRange("rand", maxRP, null, T, F), numDocs).ScoreDocs;
 			Assert.AreEqual(1, result.Length, "max,nul,T,T");
 		}
 		
@@ -202,10 +202,10 @@ namespace Lucene.Net.Search
 		
         [Test]
 		public virtual void  TestFieldCacheRangeFilterShorts()
-		{
-			
-			IndexReader reader = IndexReader.Open(signedIndex.index);
-			IndexSearcher search = new IndexSearcher(reader);
+        {
+
+            IndexReader reader = IndexReader.Open(signedIndex.index, true);
+			IndexSearcher Search = new IndexSearcher(reader);
 			
 			int numDocs = reader.NumDocs();
 			int medId = ((maxId - minId) / 2);
@@ -220,86 +220,86 @@ namespace Lucene.Net.Search
 			
 			// test id, bounded on both ends
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewShortRange("id", minIdO, maxIdO, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewShortRange("id", minIdO, maxIdO, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs, result.Length, "find all");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewShortRange("id", minIdO, maxIdO, T, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewShortRange("id", minIdO, maxIdO, T, F), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs - 1, result.Length, "all but last");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewShortRange("id", minIdO, maxIdO, F, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewShortRange("id", minIdO, maxIdO, F, T), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs - 1, result.Length, "all but first");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewShortRange("id", minIdO, maxIdO, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewShortRange("id", minIdO, maxIdO, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs - 2, result.Length, "all but ends");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewShortRange("id", medIdO, maxIdO, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewShortRange("id", medIdO, maxIdO, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(1 + maxId - medId, result.Length, "med and up");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewShortRange("id", minIdO, medIdO, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewShortRange("id", minIdO, medIdO, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(1 + medId - minId, result.Length, "up to med");
 			
 			// unbounded id
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewShortRange("id", null, null, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewShortRange("id", null, null, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs, result.Length, "find all");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewShortRange("id", minIdO, null, T, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewShortRange("id", minIdO, null, T, F), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs, result.Length, "min and up");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewShortRange("id", null, maxIdO, F, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewShortRange("id", null, maxIdO, F, T), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs, result.Length, "max and down");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewShortRange("id", minIdO, null, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewShortRange("id", minIdO, null, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs - 1, result.Length, "not min, but up");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewShortRange("id", null, maxIdO, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewShortRange("id", null, maxIdO, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs - 1, result.Length, "not max, but down");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewShortRange("id", medIdO, maxIdO, T, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewShortRange("id", medIdO, maxIdO, T, F), numDocs).ScoreDocs;
 			Assert.AreEqual(maxId - medId, result.Length, "med and up, not max");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewShortRange("id", minIdO, medIdO, F, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewShortRange("id", minIdO, medIdO, F, T), numDocs).ScoreDocs;
 			Assert.AreEqual(medId - minId, result.Length, "not min, up to med");
 			
 			// very small sets
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewShortRange("id", minIdO, minIdO, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewShortRange("id", minIdO, minIdO, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(0, result.Length, "min,min,F,F");
-			result = search.Search(q, FieldCacheRangeFilter.NewShortRange("id", medIdO, medIdO, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewShortRange("id", medIdO, medIdO, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(0, result.Length, "med,med,F,F");
-			result = search.Search(q, FieldCacheRangeFilter.NewShortRange("id", maxIdO, maxIdO, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewShortRange("id", maxIdO, maxIdO, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(0, result.Length, "max,max,F,F");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewShortRange("id", minIdO, minIdO, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewShortRange("id", minIdO, minIdO, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(1, result.Length, "min,min,T,T");
-			result = search.Search(q, FieldCacheRangeFilter.NewShortRange("id", null, minIdO, F, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewShortRange("id", null, minIdO, F, T), numDocs).ScoreDocs;
 			Assert.AreEqual(1, result.Length, "nul,min,F,T");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewShortRange("id", maxIdO, maxIdO, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewShortRange("id", maxIdO, maxIdO, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(1, result.Length, "max,max,T,T");
-			result = search.Search(q, FieldCacheRangeFilter.NewShortRange("id", maxIdO, null, T, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewShortRange("id", maxIdO, null, T, F), numDocs).ScoreDocs;
 			Assert.AreEqual(1, result.Length, "max,nul,T,T");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewShortRange("id", medIdO, medIdO, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewShortRange("id", medIdO, medIdO, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(1, result.Length, "med,med,T,T");
 			
 			// special cases
 			System.Int16 tempAux = (short) System.Int16.MaxValue;
-			result = search.Search(q, FieldCacheRangeFilter.NewShortRange("id", tempAux, null, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewShortRange("id", tempAux, null, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(0, result.Length, "overflow special case");
 			System.Int16 tempAux2 = (short) System.Int16.MinValue;
-			result = search.Search(q, FieldCacheRangeFilter.NewShortRange("id", null, tempAux2, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewShortRange("id", null, tempAux2, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(0, result.Length, "overflow special case");
-			result = search.Search(q, FieldCacheRangeFilter.NewShortRange("id", maxIdO, minIdO, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewShortRange("id", maxIdO, minIdO, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(0, result.Length, "inverse range");
 		}
 		
         [Test]
 		public virtual void  TestFieldCacheRangeFilterInts()
-		{
-			
-			IndexReader reader = IndexReader.Open(signedIndex.index);
-			IndexSearcher search = new IndexSearcher(reader);
+        {
+
+            IndexReader reader = IndexReader.Open(signedIndex.index, true);
+			IndexSearcher Search = new IndexSearcher(reader);
 			
 			int numDocs = reader.NumDocs();
 			int medId = ((maxId - minId) / 2);
@@ -314,86 +314,86 @@ namespace Lucene.Net.Search
 			
 			// test id, bounded on both ends
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewIntRange("id", minIdO, maxIdO, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewIntRange("id", minIdO, maxIdO, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs, result.Length, "find all");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewIntRange("id", minIdO, maxIdO, T, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewIntRange("id", minIdO, maxIdO, T, F), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs - 1, result.Length, "all but last");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewIntRange("id", minIdO, maxIdO, F, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewIntRange("id", minIdO, maxIdO, F, T), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs - 1, result.Length, "all but first");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewIntRange("id", minIdO, maxIdO, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewIntRange("id", minIdO, maxIdO, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs - 2, result.Length, "all but ends");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewIntRange("id", medIdO, maxIdO, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewIntRange("id", medIdO, maxIdO, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(1 + maxId - medId, result.Length, "med and up");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewIntRange("id", minIdO, medIdO, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewIntRange("id", minIdO, medIdO, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(1 + medId - minId, result.Length, "up to med");
 			
 			// unbounded id
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewIntRange("id", null, null, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewIntRange("id", null, null, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs, result.Length, "find all");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewIntRange("id", minIdO, null, T, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewIntRange("id", minIdO, null, T, F), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs, result.Length, "min and up");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewIntRange("id", null, maxIdO, F, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewIntRange("id", null, maxIdO, F, T), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs, result.Length, "max and down");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewIntRange("id", minIdO, null, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewIntRange("id", minIdO, null, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs - 1, result.Length, "not min, but up");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewIntRange("id", null, maxIdO, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewIntRange("id", null, maxIdO, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs - 1, result.Length, "not max, but down");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewIntRange("id", medIdO, maxIdO, T, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewIntRange("id", medIdO, maxIdO, T, F), numDocs).ScoreDocs;
 			Assert.AreEqual(maxId - medId, result.Length, "med and up, not max");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewIntRange("id", minIdO, medIdO, F, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewIntRange("id", minIdO, medIdO, F, T), numDocs).ScoreDocs;
 			Assert.AreEqual(medId - minId, result.Length, "not min, up to med");
 			
 			// very small sets
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewIntRange("id", minIdO, minIdO, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewIntRange("id", minIdO, minIdO, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(0, result.Length, "min,min,F,F");
-			result = search.Search(q, FieldCacheRangeFilter.NewIntRange("id", medIdO, medIdO, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewIntRange("id", medIdO, medIdO, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(0, result.Length, "med,med,F,F");
-			result = search.Search(q, FieldCacheRangeFilter.NewIntRange("id", maxIdO, maxIdO, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewIntRange("id", maxIdO, maxIdO, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(0, result.Length, "max,max,F,F");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewIntRange("id", minIdO, minIdO, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewIntRange("id", minIdO, minIdO, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(1, result.Length, "min,min,T,T");
-			result = search.Search(q, FieldCacheRangeFilter.NewIntRange("id", null, minIdO, F, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewIntRange("id", null, minIdO, F, T), numDocs).ScoreDocs;
 			Assert.AreEqual(1, result.Length, "nul,min,F,T");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewIntRange("id", maxIdO, maxIdO, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewIntRange("id", maxIdO, maxIdO, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(1, result.Length, "max,max,T,T");
-			result = search.Search(q, FieldCacheRangeFilter.NewIntRange("id", maxIdO, null, T, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewIntRange("id", maxIdO, null, T, F), numDocs).ScoreDocs;
 			Assert.AreEqual(1, result.Length, "max,nul,T,T");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewIntRange("id", medIdO, medIdO, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewIntRange("id", medIdO, medIdO, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(1, result.Length, "med,med,T,T");
 			
 			// special cases
 			System.Int32 tempAux = (System.Int32) System.Int32.MaxValue;
-			result = search.Search(q, FieldCacheRangeFilter.NewIntRange("id", tempAux, null, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewIntRange("id", tempAux, null, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(0, result.Length, "overflow special case");
 			System.Int32 tempAux2 = (System.Int32) System.Int32.MinValue;
-			result = search.Search(q, FieldCacheRangeFilter.NewIntRange("id", null, tempAux2, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewIntRange("id", null, tempAux2, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(0, result.Length, "overflow special case");
-			result = search.Search(q, FieldCacheRangeFilter.NewIntRange("id", maxIdO, minIdO, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewIntRange("id", maxIdO, minIdO, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(0, result.Length, "inverse range");
 		}
 		
         [Test]
 		public virtual void  TestFieldCacheRangeFilterLongs()
-		{
-			
-			IndexReader reader = IndexReader.Open(signedIndex.index);
-			IndexSearcher search = new IndexSearcher(reader);
+        {
+
+            IndexReader reader = IndexReader.Open(signedIndex.index, true);
+			IndexSearcher Search = new IndexSearcher(reader);
 			
 			int numDocs = reader.NumDocs();
 			int medId = ((maxId - minId) / 2);
@@ -408,77 +408,77 @@ namespace Lucene.Net.Search
 			
 			// test id, bounded on both ends
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewLongRange("id", minIdO, maxIdO, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewLongRange("id", minIdO, maxIdO, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs, result.Length, "find all");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewLongRange("id", minIdO, maxIdO, T, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewLongRange("id", minIdO, maxIdO, T, F), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs - 1, result.Length, "all but last");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewLongRange("id", minIdO, maxIdO, F, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewLongRange("id", minIdO, maxIdO, F, T), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs - 1, result.Length, "all but first");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewLongRange("id", minIdO, maxIdO, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewLongRange("id", minIdO, maxIdO, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs - 2, result.Length, "all but ends");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewLongRange("id", medIdO, maxIdO, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewLongRange("id", medIdO, maxIdO, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(1 + maxId - medId, result.Length, "med and up");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewLongRange("id", minIdO, medIdO, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewLongRange("id", minIdO, medIdO, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(1 + medId - minId, result.Length, "up to med");
 			
 			// unbounded id
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewLongRange("id", null, null, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewLongRange("id", null, null, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs, result.Length, "find all");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewLongRange("id", minIdO, null, T, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewLongRange("id", minIdO, null, T, F), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs, result.Length, "min and up");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewLongRange("id", null, maxIdO, F, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewLongRange("id", null, maxIdO, F, T), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs, result.Length, "max and down");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewLongRange("id", minIdO, null, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewLongRange("id", minIdO, null, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs - 1, result.Length, "not min, but up");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewLongRange("id", null, maxIdO, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewLongRange("id", null, maxIdO, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs - 1, result.Length, "not max, but down");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewLongRange("id", medIdO, maxIdO, T, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewLongRange("id", medIdO, maxIdO, T, F), numDocs).ScoreDocs;
 			Assert.AreEqual(maxId - medId, result.Length, "med and up, not max");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewLongRange("id", minIdO, medIdO, F, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewLongRange("id", minIdO, medIdO, F, T), numDocs).ScoreDocs;
 			Assert.AreEqual(medId - minId, result.Length, "not min, up to med");
 			
 			// very small sets
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewLongRange("id", minIdO, minIdO, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewLongRange("id", minIdO, minIdO, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(0, result.Length, "min,min,F,F");
-			result = search.Search(q, FieldCacheRangeFilter.NewLongRange("id", medIdO, medIdO, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewLongRange("id", medIdO, medIdO, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(0, result.Length, "med,med,F,F");
-			result = search.Search(q, FieldCacheRangeFilter.NewLongRange("id", maxIdO, maxIdO, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewLongRange("id", maxIdO, maxIdO, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(0, result.Length, "max,max,F,F");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewLongRange("id", minIdO, minIdO, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewLongRange("id", minIdO, minIdO, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(1, result.Length, "min,min,T,T");
-			result = search.Search(q, FieldCacheRangeFilter.NewLongRange("id", null, minIdO, F, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewLongRange("id", null, minIdO, F, T), numDocs).ScoreDocs;
 			Assert.AreEqual(1, result.Length, "nul,min,F,T");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewLongRange("id", maxIdO, maxIdO, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewLongRange("id", maxIdO, maxIdO, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(1, result.Length, "max,max,T,T");
-			result = search.Search(q, FieldCacheRangeFilter.NewLongRange("id", maxIdO, null, T, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewLongRange("id", maxIdO, null, T, F), numDocs).ScoreDocs;
 			Assert.AreEqual(1, result.Length, "max,nul,T,T");
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewLongRange("id", medIdO, medIdO, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewLongRange("id", medIdO, medIdO, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(1, result.Length, "med,med,T,T");
 			
 			// special cases
 			System.Int64 tempAux = (long) System.Int64.MaxValue;
-			result = search.Search(q, FieldCacheRangeFilter.NewLongRange("id", tempAux, null, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewLongRange("id", tempAux, null, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(0, result.Length, "overflow special case");
 			System.Int64 tempAux2 = (long) System.Int64.MinValue;
-			result = search.Search(q, FieldCacheRangeFilter.NewLongRange("id", null, tempAux2, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewLongRange("id", null, tempAux2, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(0, result.Length, "overflow special case");
-			result = search.Search(q, FieldCacheRangeFilter.NewLongRange("id", maxIdO, minIdO, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewLongRange("id", maxIdO, minIdO, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(0, result.Length, "inverse range");
 		}
 		
@@ -486,10 +486,10 @@ namespace Lucene.Net.Search
 		
         [Test]
 		public virtual void  TestFieldCacheRangeFilterFloats()
-		{
-			
-			IndexReader reader = IndexReader.Open(signedIndex.index);
-			IndexSearcher search = new IndexSearcher(reader);
+        {
+
+            IndexReader reader = IndexReader.Open(signedIndex.index, true);
+			IndexSearcher Search = new IndexSearcher(reader);
 			
 			int numDocs = reader.NumDocs();
 			System.Single minIdO = (float) (minId + .5f);
@@ -498,30 +498,30 @@ namespace Lucene.Net.Search
 			ScoreDoc[] result;
 			Query q = new TermQuery(new Term("body", "body"));
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewFloatRange("id", minIdO, medIdO, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewFloatRange("id", minIdO, medIdO, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs / 2, result.Length, "find all");
 			int count = 0;
-			result = search.Search(q, FieldCacheRangeFilter.NewFloatRange("id", null, medIdO, F, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewFloatRange("id", null, medIdO, F, T), numDocs).ScoreDocs;
 			count += result.Length;
-			result = search.Search(q, FieldCacheRangeFilter.NewFloatRange("id", medIdO, null, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewFloatRange("id", medIdO, null, F, F), numDocs).ScoreDocs;
 			count += result.Length;
 			Assert.AreEqual(numDocs, count, "sum of two concenatted ranges");
-			result = search.Search(q, FieldCacheRangeFilter.NewFloatRange("id", null, null, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewFloatRange("id", null, null, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs, result.Length, "find all");
 			System.Single tempAux = (float) System.Single.PositiveInfinity;
-			result = search.Search(q, FieldCacheRangeFilter.NewFloatRange("id", tempAux, null, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewFloatRange("id", tempAux, null, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(0, result.Length, "infinity special case");
 			System.Single tempAux2 = (float) System.Single.NegativeInfinity;
-			result = search.Search(q, FieldCacheRangeFilter.NewFloatRange("id", null, tempAux2, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewFloatRange("id", null, tempAux2, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(0, result.Length, "infinity special case");
 		}
 		
         [Test]
 		public virtual void  TestFieldCacheRangeFilterDoubles()
-		{
-			
-			IndexReader reader = IndexReader.Open(signedIndex.index);
-			IndexSearcher search = new IndexSearcher(reader);
+        {
+
+            IndexReader reader = IndexReader.Open(signedIndex.index, true);
+			IndexSearcher Search = new IndexSearcher(reader);
 			
 			int numDocs = reader.NumDocs();
 			System.Double minIdO = (double) (minId + .5);
@@ -530,22 +530,69 @@ namespace Lucene.Net.Search
 			ScoreDoc[] result;
 			Query q = new TermQuery(new Term("body", "body"));
 			
-			result = search.Search(q, FieldCacheRangeFilter.NewDoubleRange("id", minIdO, medIdO, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewDoubleRange("id", minIdO, medIdO, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs / 2, result.Length, "find all");
 			int count = 0;
-			result = search.Search(q, FieldCacheRangeFilter.NewDoubleRange("id", null, medIdO, F, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewDoubleRange("id", null, medIdO, F, T), numDocs).ScoreDocs;
 			count += result.Length;
-			result = search.Search(q, FieldCacheRangeFilter.NewDoubleRange("id", medIdO, null, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewDoubleRange("id", medIdO, null, F, F), numDocs).ScoreDocs;
 			count += result.Length;
 			Assert.AreEqual(numDocs, count, "sum of two concenatted ranges");
-			result = search.Search(q, FieldCacheRangeFilter.NewDoubleRange("id", null, null, T, T), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewDoubleRange("id", null, null, T, T), numDocs).ScoreDocs;
 			Assert.AreEqual(numDocs, result.Length, "find all");
 			System.Double tempAux = (double) System.Double.PositiveInfinity;
-			result = search.Search(q, FieldCacheRangeFilter.NewDoubleRange("id", tempAux, null, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewDoubleRange("id", tempAux, null, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(0, result.Length, "infinity special case");
 			System.Double tempAux2 = (double) System.Double.NegativeInfinity;
-			result = search.Search(q, FieldCacheRangeFilter.NewDoubleRange("id", null, tempAux2, F, F), numDocs).ScoreDocs;
+			result = Search.Search(q, FieldCacheRangeFilter.NewDoubleRange("id", null, tempAux2, F, F), numDocs).ScoreDocs;
 			Assert.AreEqual(0, result.Length, "infinity special case");
 		}
+
+        [Test]
+        // test using a sparse index (with deleted docs). The DocIdSet should be not cacheable, as it uses TermDocs if the range contains 0
+  public void TestSparseIndex()
+        {
+    RAMDirectory dir = new RAMDirectory();
+    IndexWriter writer = new IndexWriter(dir, new SimpleAnalyzer(), T, IndexWriter.MaxFieldLength.LIMITED);
+
+    for (int d = -20; d <= 20; d++) {
+      Document doc = new Document();
+      doc.Add(new Field("id",d.ToString(), Field.Store.NO, Field.Index.NOT_ANALYZED));
+      doc.Add(new Field("body","body", Field.Store.NO, Field.Index.NOT_ANALYZED));
+      writer.AddDocument(doc);
+    }
+    
+    writer.Optimize();
+    writer.DeleteDocuments(new Term("id","0"));
+    writer.Close();
+
+    IndexReader reader = IndexReader.Open(dir);
+    IndexSearcher Search = new IndexSearcher(reader);
+    Assert.True(reader.HasDeletions());
+
+    ScoreDoc[] result;
+    Query q = new TermQuery(new Term("body","body"));
+
+    FieldCacheRangeFilter<sbyte?> fcrf;
+    result = Search.Search(q, fcrf = FieldCacheRangeFilter.NewByteRange("id", -20, 20, T, T), 100).ScoreDocs;
+    Assert.False(fcrf.GetDocIdSet(reader.GetSequentialSubReaders()[0]).IsCacheable(), "DocIdSet must be not cacheable");
+    Assert.AreEqual(40, result.Length, "find all");
+
+    result = Search.Search(q, fcrf = FieldCacheRangeFilter.NewByteRange("id", 0, 20, T, T), 100).ScoreDocs;
+    Assert.False(fcrf.GetDocIdSet(reader.GetSequentialSubReaders()[0]).IsCacheable(), "DocIdSet must be not cacheable");
+    Assert.AreEqual( 20, result.Length, "find all");
+
+            result = Search.Search(q, fcrf = FieldCacheRangeFilter.NewByteRange("id", -20, 0, T, T), 100).ScoreDocs;
+    Assert.False(fcrf.GetDocIdSet(reader.GetSequentialSubReaders()[0]).IsCacheable(), "DocIdSet must be not cacheable");
+    Assert.AreEqual( 20, result.Length, "find all");
+
+    result = Search.Search(q, fcrf = FieldCacheRangeFilter.NewByteRange("id", 10, 20, T, T), 100).ScoreDocs;
+    Assert.True(fcrf.GetDocIdSet(reader.GetSequentialSubReaders()[0]).IsCacheable(), "DocIdSet must be not cacheable");
+    Assert.AreEqual( 11, result.Length, "find all");
+
+    result = Search.Search(q, fcrf = FieldCacheRangeFilter.NewByteRange("id", -20, -10, T, T), 100).ScoreDocs;
+    Assert.True(fcrf.GetDocIdSet(reader.GetSequentialSubReaders()[0]).IsCacheable(), "DocIdSet must be not cacheable");
+    Assert.AreEqual( 11, result.Length, "find all");
+  }
 	}
 }
\ No newline at end of file

Modified: incubator/lucene.net/trunk/test/core/Search/TestFieldCacheTermsFilter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Search/TestFieldCacheTermsFilter.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Search/TestFieldCacheTermsFilter.cs (original)
+++ incubator/lucene.net/trunk/test/core/Search/TestFieldCacheTermsFilter.cs Tue Feb 28 22:43:08 2012
@@ -53,8 +53,8 @@ namespace Lucene.Net.Search
 				w.AddDocument(doc);
 			}
 			w.Close();
-			
-			IndexReader reader = IndexReader.Open(rd);
+
+            IndexReader reader = IndexReader.Open(rd, true);
 			IndexSearcher searcher = new IndexSearcher(reader);
 			int numDocs = reader.NumDocs();
 			ScoreDoc[] results;

Modified: incubator/lucene.net/trunk/test/core/Search/TestFilteredQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/test/core/Search/TestFilteredQuery.cs?rev=1294875&r1=1294874&r2=1294875&view=diff
==============================================================================
--- incubator/lucene.net/trunk/test/core/Search/TestFilteredQuery.cs (original)
+++ incubator/lucene.net/trunk/test/core/Search/TestFilteredQuery.cs Tue Feb 28 22:43:08 2012
@@ -34,15 +34,8 @@ namespace Lucene.Net.Search
 {
 	
 	/// <summary> FilteredQuery JUnit tests.
-	/// 
 	/// <p/>Created: Apr 21, 2004 1:21:46 PM
-	/// 
-	/// 
 	/// </summary>
-	/// <version>  $Id: TestFilteredQuery.java 807821 2009-08-25 21:55:49Z mikemccand $
-	/// </version>
-	/// <since>   1.4
-	/// </since>
     [TestFixture]
 	public class TestFilteredQuery:LuceneTestCase
 	{
@@ -103,7 +96,7 @@ namespace Lucene.Net.Search
 			writer.Optimize();
 			writer.Close();
 			
-			searcher = new IndexSearcher(directory);
+			searcher = new IndexSearcher(directory, true);
 			query = new TermQuery(new Term("field", "three"));
 			filter = NewStaticFilterB();
 		}
@@ -131,7 +124,7 @@ namespace Lucene.Net.Search
 			Assert.AreEqual(1, hits[0].doc);
 			QueryUtils.Check(filteredquery, searcher);
 			
-			hits = searcher.Search(filteredquery, null, 1000, new Sort("sorter")).ScoreDocs;
+			hits = searcher.Search(filteredquery, null, 1000, new Sort(new SortField("sorter", SortField.STRING))).ScoreDocs;
 			Assert.AreEqual(1, hits.Length);
 			Assert.AreEqual(1, hits[0].doc);
 			



Mime
View raw message