lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aro...@apache.org
Subject svn commit: r564939 [5/8] - in /incubator/lucene.net/trunk/C#/src: ./ Demo/ Demo/DeleteFiles/ Demo/DemoLib/ Demo/IndexFiles/ Demo/IndexHtml/ Demo/SearchFiles/ Lucene.Net/ Lucene.Net/Analysis/Standard/ Lucene.Net/Document/ Lucene.Net/Index/ Lucene.Net/Q...
Date Sat, 11 Aug 2007 16:56:44 GMT
Modified: incubator/lucene.net/trunk/C#/src/Test/QueryParser/TestQueryParser.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/QueryParser/TestQueryParser.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/QueryParser/TestQueryParser.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/QueryParser/TestQueryParser.cs Sat Aug 11 09:56:37 2007
@@ -16,7 +16,9 @@
  */
 
 using System;
+
 using NUnit.Framework;
+
 using Analyzer = Lucene.Net.Analysis.Analyzer;
 using LowerCaseTokenizer = Lucene.Net.Analysis.LowerCaseTokenizer;
 using SimpleAnalyzer = Lucene.Net.Analysis.SimpleAnalyzer;
@@ -26,16 +28,15 @@
 using WhitespaceAnalyzer = Lucene.Net.Analysis.WhitespaceAnalyzer;
 using StandardAnalyzer = Lucene.Net.Analysis.Standard.StandardAnalyzer;
 using DateField = Lucene.Net.Documents.DateField;
-using ParseException = Lucene.Net.QueryParsers.ParseException;
-using QueryParser = Lucene.Net.QueryParsers.QueryParser;
-using BooleanQuery = Lucene.Net.Search.BooleanQuery;
-using FuzzyQuery = Lucene.Net.Search.FuzzyQuery;
-using PhraseQuery = Lucene.Net.Search.PhraseQuery;
-using PrefixQuery = Lucene.Net.Search.PrefixQuery;
-using Query = Lucene.Net.Search.Query;
-using RangeQuery = Lucene.Net.Search.RangeQuery;
-using TermQuery = Lucene.Net.Search.TermQuery;
-using WildcardQuery = Lucene.Net.Search.WildcardQuery;
+using DateTools = Lucene.Net.Documents.DateTools;
+using Document = Lucene.Net.Documents.Document;
+using Field = Lucene.Net.Documents.Field;
+using IndexWriter = Lucene.Net.Index.IndexWriter;
+using Term = Lucene.Net.Index.Term;
+using Lucene.Net.Search;
+using Searchable = Lucene.Net.Search.Searchable;
+using RAMDirectory = Lucene.Net.Store.RAMDirectory;
+using ParseException = Lucene.Net.Analysis.Standard.ParseException;
 
 namespace Lucene.Net.QueryParser
 {
@@ -44,6 +45,46 @@
 	[TestFixture]
     public class TestQueryParser
 	{
+        public class AnonymousClassQueryParser : Lucene.Net.QueryParsers.QueryParser
+        {
+            private void  InitBlock(int[] type, TestQueryParser enclosingInstance)
+            {
+                this.type = type;
+                this.enclosingInstance = enclosingInstance;
+            }
+            private int[] type;
+            private TestQueryParser enclosingInstance;
+            public TestQueryParser Enclosing_Instance
+            {
+                get
+                {
+                    return enclosingInstance;
+                }
+				
+            }
+            internal AnonymousClassQueryParser(int[] type, TestQueryParser enclosingInstance, System.String Param1, Lucene.Net.Analysis.Analyzer Param2):base(Param1, Param2)
+            {
+                InitBlock(type, enclosingInstance);
+            }
+            public override Lucene.Net.Search.Query GetWildcardQuery(System.String field, System.String termStr)
+            {
+                // override error checking of superclass
+                type[0] = 1;
+                return new TermQuery(new Term(field, termStr));
+            }
+            public Lucene.Net.Search.Query GetPrefixQuery(System.String field, System.String termStr)
+            {
+                // override error checking of superclass
+                type[0] = 2;
+                return new TermQuery(new Term(field, termStr));
+            }
+			
+            public Lucene.Net.Search.Query GetFieldQuery(System.String field, System.String queryText)
+            {
+                type[0] = 3;
+                return base.GetFieldQuery(field, queryText);
+            }
+        }
 		
 		public static Analyzer qpAnalyzer = new QPTestAnalyzer();
 		
@@ -99,12 +140,12 @@
 			{
 			}
 			
-			protected override Query GetFuzzyQuery(System.String field, System.String termStr, float minSimilarity)
+			public override Query GetFuzzyQuery(System.String field, System.String termStr, float minSimilarity)
 			{
 				throw new ParseException("Fuzzy queries not allowed");
 			}
 			
-			protected override Query GetWildcardQuery(System.String field, System.String termStr)
+			public override Query GetWildcardQuery(System.String field, System.String termStr)
 			{
 				throw new ParseException("Wildcard queries not allowed");
 			}
@@ -142,6 +183,16 @@
 			}
 		}
 		
+        public virtual void  AssertQueryEquals(Lucene.Net.QueryParsers.QueryParser qp, System.String field, System.String query, System.String result)
+        {
+            Query q = qp.Parse(query);
+            System.String s = q.ToString(field);
+            if (!s.Equals(result))
+            {
+                Assert.Fail("Query /" + query + "/ yielded /" + s + "/, expecting /" + result + "/");
+            }
+        }
+		
         public virtual void  AssertEscapedQueryEquals(System.String query, Analyzer a, System.String result)
         {
             System.String escapedQuery = Lucene.Net.QueryParsers.QueryParser.Escape(query);
@@ -151,11 +202,12 @@
             }
         }
 		
-        public virtual void  AssertWildcardQueryEquals(System.String query, bool lowercase, System.String result)
+        public virtual void  AssertWildcardQueryEquals(System.String query, bool lowercase, System.String result, bool allowLeadingWildcard)
 		{
 			Lucene.Net.QueryParsers.QueryParser qp = GetParser(null);
 			qp.SetLowercaseExpandedTerms(lowercase);
-			Query q = qp.Parse(query);
+            qp.SetAllowLeadingWildcard(allowLeadingWildcard);
+            Query q = qp.Parse(query);
 			System.String s = q.ToString("field");
 			if (!s.Equals(result))
 			{
@@ -163,7 +215,12 @@
 			}
 		}
 		
-		public virtual void  AssertWildcardQueryEquals(System.String query, System.String result)
+        public virtual void  AssertWildcardQueryEquals(System.String query, bool lowercase, System.String result)
+        {
+            AssertWildcardQueryEquals(query, lowercase, result, false);
+        }
+		
+        public virtual void  AssertWildcardQueryEquals(System.String query, System.String result)
 		{
 			Lucene.Net.QueryParsers.QueryParser qp = GetParser(null);
 			Query q = qp.Parse(query);
@@ -346,7 +403,29 @@
 			AssertWildcardQueryEquals("[A TO C]", "[a TO c]");
 			AssertWildcardQueryEquals("[A TO C]", true, "[a TO c]");
 			AssertWildcardQueryEquals("[A TO C]", false, "[A TO C]");
-		}
+            // Test suffix queries: first disallow
+            try
+            {
+                AssertWildcardQueryEquals("*Term", true, "*term");
+                Assert.Fail();
+            }
+            catch (ParseException pe)
+            {
+                // expected exception
+            }
+            try
+            {
+                AssertWildcardQueryEquals("?Term", true, "?term");
+                Assert.Fail();
+            }
+            catch (ParseException pe)
+            {
+                // expected exception
+            }
+            // Test suffix queries: then allow
+            AssertWildcardQueryEquals("*Term", true, "*term", true);
+            AssertWildcardQueryEquals("?Term", true, "?term", true);
+        }
 		
 		[Test]
         public virtual void  TestQPA()
@@ -365,19 +444,51 @@
 		[Test]
         public virtual void  TestRange()
 		{
-			AssertQueryEquals("[ a TO z]", null, "[a TO z]");
-			Assert.IsTrue(GetQuery("[ a TO z]", null) is RangeQuery);
-			AssertQueryEquals("[ a TO z ]", null, "[a TO z]");
-			AssertQueryEquals("{ a TO z}", null, "{a TO z}");
-			AssertQueryEquals("{ a TO z }", null, "{a TO z}");
-			AssertQueryEquals("{ a TO z }^2.0", null, "{a TO z}^2.0");
-			AssertQueryEquals("[ a TO z] OR bar", null, "[a TO z] bar");
-			AssertQueryEquals("[ a TO z] AND bar", null, "+[a TO z] +bar");
-			AssertQueryEquals("( bar blar { a TO z}) ", null, "bar blar {a TO z}");
-			AssertQueryEquals("gack ( bar blar { a TO z}) ", null, "gack (bar blar {a TO z})");
-		}
+            AssertQueryEquals("[ a TO z]", null, "[a TO z]");
+            Assert.IsTrue(GetQuery("[ a TO z]", null) is ConstantScoreRangeQuery);
+			
+            Lucene.Net.QueryParsers.QueryParser qp = new Lucene.Net.QueryParsers.QueryParser("field", new SimpleAnalyzer());
+            qp.SetUseOldRangeQuery(true);
+            Assert.IsTrue(qp.Parse("[ a TO z]") is RangeQuery);
+			
+            AssertQueryEquals("[ a TO z ]", null, "[a TO z]");
+            AssertQueryEquals("{ a TO z}", null, "{a TO z}");
+            AssertQueryEquals("{ a TO z }", null, "{a TO z}");
+            AssertQueryEquals("{ a TO z }^2.0", null, "{a TO z}^2.0");
+            AssertQueryEquals("[ a TO z] OR bar", null, "[a TO z] bar");
+            AssertQueryEquals("[ a TO z] AND bar", null, "+[a TO z] +bar");
+            AssertQueryEquals("( bar blar { a TO z}) ", null, "bar blar {a TO z}");
+            AssertQueryEquals("gack ( bar blar { a TO z}) ", null, "gack (bar blar {a TO z})");
+        }
+		
+        /// <summary>for testing legacy DateField support </summary>
+        private System.String GetLegacyDate(System.String s)
+        {
+            System.DateTime tempAux = System.DateTime.Parse(s, System.Globalization.CultureInfo.CurrentCulture);
+            return DateField.DateToString(tempAux);
+        }
+		
+        /// <summary>for testing DateTools support </summary>
+        private System.String GetDate(System.String s, DateTools.Resolution resolution)
+        {
+            System.DateTime tempAux = System.DateTime.Parse(s, System.Globalization.CultureInfo.CurrentCulture);
+            return GetDate(tempAux, resolution);
+        }
+		
+        /// <summary>for testing DateTools support </summary>
+        private System.String GetDate(System.DateTime d, DateTools.Resolution resolution)
+        {
+            if (resolution == null)
+            {
+                return DateField.DateToString(d);
+            }
+            else
+            {
+                return DateTools.DateToString(d, resolution);
+            }
+        }
 		
-		public virtual System.String GetDate(System.String s)
+        public virtual System.String GetDate(System.String s)
 		{
             System.DateTime tempAux = System.DateTime.Parse(s);
             return DateField.DateToString(tempAux);
@@ -396,18 +507,67 @@
             return temp.ToString("MM/d/yyy");
 		}
 		
-		[Test]
+        /// <summary>for testing legacy DateField support </summary>
+        [Test]
+        public virtual void  TestLegacyDateRange()
+        {
+            System.String startDate = GetLocalizedDate(2002, 2, 1, false);
+            System.String endDate = GetLocalizedDate(2002, 2, 4, false);
+            System.Globalization.Calendar endDateExpected = new System.Globalization.GregorianCalendar();
+            // endDateExpected should be set to: "2002, 1, 4, 23, 59, 59, 999" otherwise what's the point of useing GregorianCalendar()   // {{Aroush-2.1}}
+            System.DateTime tempAux = new System.DateTime(2002, 1, 4, 23, 59, 59, 999);
+            AssertQueryEquals("[ " + startDate + " TO " + endDate + "]", null, "[" + GetLegacyDate(startDate) + " TO " + DateField.DateToString(tempAux) + "]");
+            AssertQueryEquals("{  " + startDate + "    " + endDate + "   }", null, "{" + GetLegacyDate(startDate) + " TO " + GetLegacyDate(endDate) + "}");
+        }
+		
+        [Test]
         public virtual void  TestDateRange()
 		{
             System.String startDate = GetLocalizedDate(2002, 2, 1, false);
             System.String endDate = GetLocalizedDate(2002, 2, 4, false);
-            System.DateTime endDateExpected = new System.DateTime(2002, 2, 4, 23, 59, 59);
-            endDateExpected = endDateExpected.AddMilliseconds(999);
-            AssertQueryEquals("[ " + startDate + " TO " + endDate + "]", null, "[" + GetDate(startDate) + " TO " + DateField.DateToString(endDateExpected) + "]");
-            AssertQueryEquals("{  " + startDate + "    " + endDate + "   }", null, "{" + GetDate(startDate) + " TO " + GetDate(endDate) + "}");
+            System.DateTime endDateExpected = new System.DateTime(2002, 2, 4, 23, 59, 59, 999);
+            System.String defaultField = "default";
+            System.String monthField = "month";
+            System.String hourField = "hour";
+            Lucene.Net.QueryParsers.QueryParser qp = new Lucene.Net.QueryParsers.QueryParser("field", new SimpleAnalyzer());
+			
+            // Don't set any date resolution and verify if DateField is used
+            System.DateTime tempAux = endDateExpected;
+            AssertDateRangeQueryEquals(qp, defaultField, startDate, endDate, tempAux, null);
+			
+            // set a field specific date resolution
+            qp.SetDateResolution(monthField, DateTools.Resolution.MONTH);
+			
+            // DateField should still be used for defaultField
+            System.DateTime tempAux2 = endDateExpected;
+            AssertDateRangeQueryEquals(qp, defaultField, startDate, endDate, tempAux2, null);
+			
+            // set default date resolution to MILLISECOND 
+            qp.SetDateResolution(DateTools.Resolution.MILLISECOND);
+			
+            // set second field specific date resolution    
+            qp.SetDateResolution(hourField, DateTools.Resolution.HOUR);
+			
+            // for this field no field specific date resolution has been set,
+            // so verify if the default resolution is used
+            System.DateTime tempAux3 = endDateExpected;
+            AssertDateRangeQueryEquals(qp, defaultField, startDate, endDate, tempAux3, DateTools.Resolution.MILLISECOND);
+			
+            // verify if field specific date resolutions are used for these two fields
+            System.DateTime tempAux4 = endDateExpected;
+            AssertDateRangeQueryEquals(qp, monthField, startDate, endDate, tempAux4, DateTools.Resolution.MONTH);
+			
+            System.DateTime tempAux5 = endDateExpected;
+            AssertDateRangeQueryEquals(qp, hourField, startDate, endDate, tempAux5, DateTools.Resolution.HOUR);
         }
 		
-		[Test]
+        public virtual void  AssertDateRangeQueryEquals(Lucene.Net.QueryParsers.QueryParser qp, System.String field, System.String startDate, System.String endDate, System.DateTime endDateInclusive, DateTools.Resolution resolution)
+        {
+            AssertQueryEquals(qp, field, field + ":[" + startDate + " TO " + endDate + "]", "[" + GetDate(startDate, resolution) + " TO " + GetDate(endDateInclusive, resolution) + "]");
+            AssertQueryEquals(qp, field, field + ":{" + startDate + " TO " + endDate + "}", "{" + GetDate(startDate, resolution) + " TO " + GetDate(endDate, resolution) + "}");
+        }
+		
+        [Test]
         public virtual void  TestEscaped()
 		{
 			Analyzer a = new WhitespaceAnalyzer();
@@ -466,7 +626,51 @@
 			AssertQueryEquals("[ a\\- TO a\\+ ]", null, "[a- TO a+]");
 			AssertQueryEquals("[ a\\: TO a\\~ ]", null, "[a: TO a~]");
 			AssertQueryEquals("[ a\\\\ TO a\\* ]", null, "[a\\ TO a*]");
-		}
+			
+            AssertQueryEquals("[\"c\\:\\\\temp\\\\\\~foo0.txt\" TO \"c\\:\\\\temp\\\\\\~foo9.txt\"]", a, "[c:\\temp\\~foo0.txt TO c:\\temp\\~foo9.txt]");
+			
+            AssertQueryEquals("a\\\\\\+b", a, "a\\+b");
+			
+            AssertQueryEquals("a \\\"b c\\\" d", a, "a \"b c\" d");
+            AssertQueryEquals("\"a \\\"b c\\\" d\"", a, "\"a \"b c\" d\"");
+            AssertQueryEquals("\"a \\+b c d\"", a, "\"a +b c d\"");
+			
+            AssertQueryEquals("c\\:\\\\temp\\\\\\~foo.txt", a, "c:\\temp\\~foo.txt");
+			
+			
+            try
+            {
+                AssertQueryEquals("XY\\", a, "XYZ");
+                Assert.Fail("ParseException expected, not thrown");
+            }
+            catch (ParseException expected)
+            {
+            }
+			
+            // test unicode escaping
+            AssertQueryEquals("a\\u0062c", a, "abc");
+            AssertQueryEquals("XY\\u005a", a, "XYZ");
+            AssertQueryEquals("XY\\u005A", a, "XYZ");
+            AssertQueryEquals("\"a \\\\\\u0028\\u0062\\\" c\"", a, "\"a \\(b\" c\"");
+			
+            try
+            {
+                AssertQueryEquals("XY\\u005G", a, "XYZ");
+                Assert.Fail("ParseException expected, not thrown");
+            }
+            catch (ParseException expected)
+            {
+            }
+			
+            try
+            {
+                AssertQueryEquals("XY\\u005", a, "XYZ");
+                Assert.Fail("ParseException expected, not thrown");
+            }
+            catch (ParseException expected)
+            {
+            }
+        }
 		
         [Test]
         public virtual void  TestQueryStringEscaping()
@@ -645,6 +849,59 @@
             AssertHits(1, "{12/1/2005 TO 12/4/2005}", is_Renamed);
             AssertHits(0, "{12/3/2005 TO 12/4/2005}", is_Renamed);
             is_Renamed.Close();
+        }
+		
+        [Test]
+        public virtual void  TestStarParsing()
+        {
+            int[] type = new int[1];
+            Lucene.Net.QueryParsers.QueryParser qp = new AnonymousClassQueryParser(type, this, "field", new WhitespaceAnalyzer());
+			
+            TermQuery tq;
+			
+            tq = (TermQuery) qp.Parse("foo:zoo*");
+            Assert.AreEqual("zoo", tq.GetTerm().Text());
+            Assert.AreEqual(2, type[0]);
+			
+            tq = (TermQuery) qp.Parse("foo:zoo*^2");
+            Assert.AreEqual("zoo", tq.GetTerm().Text());
+            Assert.AreEqual(2, type[0]);
+            Assert.AreEqual(tq.GetBoost(), 2, 0);
+			
+            tq = (TermQuery) qp.Parse("foo:*");
+            Assert.AreEqual("*", tq.GetTerm().Text());
+            Assert.AreEqual(1, type[0]); // could be a valid prefix query in the future too
+			
+            tq = (TermQuery) qp.Parse("foo:*^2");
+            Assert.AreEqual("*", tq.GetTerm().Text());
+            Assert.AreEqual(1, type[0]);
+            Assert.AreEqual(tq.GetBoost(), 2, 0);
+			
+            tq = (TermQuery) qp.Parse("*:foo");
+            Assert.AreEqual("*", tq.GetTerm().Field());
+            Assert.AreEqual("foo", tq.GetTerm().Text());
+            Assert.AreEqual(3, type[0]);
+			
+            tq = (TermQuery) qp.Parse("*:*");
+            Assert.AreEqual("*", tq.GetTerm().Field());
+            Assert.AreEqual("*", tq.GetTerm().Text());
+            Assert.AreEqual(1, type[0]); // could be handled as a prefix query in the future
+			
+            tq = (TermQuery) qp.Parse("(*:*)");
+            Assert.AreEqual("*", tq.GetTerm().Field());
+            Assert.AreEqual("*", tq.GetTerm().Text());
+            Assert.AreEqual(1, type[0]);
+        }
+		
+        [Test]
+        public virtual void  TestMatchAllDocs()
+        {
+            Lucene.Net.QueryParsers.QueryParser qp = new Lucene.Net.QueryParsers.QueryParser("field", new WhitespaceAnalyzer());
+            Assert.AreEqual(new MatchAllDocsQuery(), qp.Parse("*:*"));
+            Assert.AreEqual(new MatchAllDocsQuery(), qp.Parse("(*:*)"));
+            BooleanQuery bq = (BooleanQuery) qp.Parse("+*:* -*:*");
+            Assert.IsTrue(bq.GetClauses()[0].GetQuery() is MatchAllDocsQuery);
+            Assert.IsTrue(bq.GetClauses()[1].GetQuery() is MatchAllDocsQuery);
         }
 		
         private void  AssertHits(int expected, System.String query, Lucene.Net.Search.IndexSearcher is_Renamed)

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/BaseTestRangeFilter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/BaseTestRangeFilter.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/BaseTestRangeFilter.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/BaseTestRangeFilter.cs Sat Aug 11 09:56:37 2007
@@ -16,7 +16,9 @@
  */
 
 using System;
+
 using NUnit.Framework;
+
 using SimpleAnalyzer = Lucene.Net.Analysis.SimpleAnalyzer;
 using Document = Lucene.Net.Documents.Document;
 using Field = Lucene.Net.Documents.Field;

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/CheckHits.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/CheckHits.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/CheckHits.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/CheckHits.cs Sat Aug 11 09:56:37 2007
@@ -16,48 +16,142 @@
  */
 
 using System;
+
 using NUnit.Framework;
 
+using Directory = Lucene.Net.Store.Directory;
+using IndexReader = Lucene.Net.Index.IndexReader;
+
 namespace Lucene.Net.Search
 {
 	
 	public class CheckHits
 	{
-		/// <summary>Tests that a query has expected document number results.</summary>
-		public static void  CheckHits_Renamed_Method(Query query, System.String defaultFieldName, Searcher searcher, int[] results)
-		{
-			Hits hits = searcher.Search(query);
+        private class AnonymousClassHitCollector : HitCollector
+        {
+            public AnonymousClassHitCollector(System.Collections.Hashtable actual)
+            {
+                InitBlock(actual);
+            }
+            private void  InitBlock(System.Collections.Hashtable actual)
+            {
+                this.actual = actual;
+            }
+            private System.Collections.Hashtable actual;
+            public override void  Collect(int doc, float score)
+            {
+                actual.Add((System.Int32) doc, (System.Int32) doc);
+            }
+        }
+		
+        /// <summary> Tests that all documents up to maxDoc which are *not* in the
+        /// expected result set, have an explanation which indicates no match
+        /// (ie: Explanation value of 0.0f)
+        /// </summary>
+        public static void  CheckNoMatchExplanations(Query q, System.String defaultFieldName, Searcher searcher, int[] results)
+        {
 			
-			System.Collections.Hashtable correct = new System.Collections.Hashtable();
-			for (int i = 0; i < results.Length; i++)
-			{
-				correct.Add((System.Int32) results[i], (System.Int32) results[i]);
-			}
+            System.String d = q.ToString(defaultFieldName);
+            System.Collections.Hashtable ignore = new System.Collections.Hashtable();
+            for (int i = 0; i < results.Length; i++)
+            {
+                ignore.Add((System.Int32) results[i], (System.Int32) results[i]);
+            }
 			
-			System.Collections.Hashtable actual = new System.Collections.Hashtable();
-			for (int i = 0; i < hits.Length(); i++)
-			{
-				actual.Add((System.Int32) hits.Id(i), (System.Int32) hits.Id(i));
-			}
+            int maxDoc = searcher.MaxDoc();
+            for (int doc = 0; doc < maxDoc; doc++)
+            {
+                if (ignore.Contains((System.Int32) doc))
+                    continue;
+				
+                Explanation exp = searcher.Explain(q, doc);
+                Assert.IsNotNull(exp, "Explanation of [[" + d + "]] for #" + doc + " is null");
+                Assert.AreEqual(0.0f, exp.GetValue(), 0.0f, "Explanation of [[" + d + "]] for #" + doc + " doesn't indicate non-match: " + exp.ToString());
+            }
+        }
+		
+        /// <summary> Tests that a query matches the an expected set of documents using a
+        /// HitCollector.
+        /// 
+        /// <p>
+        /// Note that when using the HitCollector API, documents will be collected
+        /// if they "match" regardless of what their score is.
+        /// </p>
+        /// </summary>
+        /// <param name="query">the query to test
+        /// </param>
+        /// <param name="searcher">the searcher to test the query against
+        /// </param>
+        /// <param name="defaultFieldName">used for displaing the query in assertion messages
+        /// </param>
+        /// <param name="results">a list of documentIds that must match the query
+        /// </param>
+        /// <seealso cref="Searcher.Search(Query,HitCollector)">
+        /// </seealso>
+        /// <seealso cref="checkHits">
+        /// </seealso>
+        public static void  CheckHitCollector(Query query, System.String defaultFieldName, Searcher searcher, int[] results)
+        {
 			
-            if (correct.Count != 0)
+            System.Collections.Hashtable correct = new System.Collections.Hashtable();
+            for (int i = 0; i < results.Length; i++)
             {
-                System.Collections.IDictionaryEnumerator iter = correct.GetEnumerator();
-                System.Collections.IDictionaryEnumerator iter2 = actual.GetEnumerator();
-                bool status = true;
-                while (iter2.MoveNext() && iter.MoveNext())
-                {
-                    if (iter2.Key.ToString() != iter.Key.ToString())
-                    {
-                        status = false;
-                        break;
-                    }
-                }
-                Assert.IsTrue(status, query.ToString(defaultFieldName));
+                correct.Add((System.Int32) results[i], (System.Int32) results[i]);
             }
-		}
+			
+            System.Collections.Hashtable actual = new System.Collections.Hashtable();
+            searcher.Search(query, new AnonymousClassHitCollector(actual));
+            Assert.AreEqual(correct, actual, query.ToString(defaultFieldName));
+			
+            QueryUtils.Check(query, searcher);
+        }
+		
+        /// <summary> Tests that a query matches the an expected set of documents using Hits.
+        /// 
+        /// <p>
+        /// Note that when using the Hits API, documents will only be returned
+        /// if they have a positive normalized score.
+        /// </p>
+        /// </summary>
+        /// <param name="query">the query to test
+        /// </param>
+        /// <param name="searcher">the searcher to test the query against
+        /// </param>
+        /// <param name="defaultFieldName">used for displaing the query in assertion messages
+        /// </param>
+        /// <param name="results">a list of documentIds that must match the query
+        /// </param>
+        /// <seealso cref="Searcher.Search(Query)">
+        /// </seealso>
+        /// <seealso cref="CheckHitCollector">
+        /// </seealso>
+        public static void  CheckHits_Renamed(Query query, System.String defaultFieldName, Searcher searcher, int[] results)
+        {
+            if (searcher is IndexSearcher)
+            {
+                QueryUtils.Check(query, (IndexSearcher) searcher);
+            }
+			
+            Hits hits = searcher.Search(query);
+			
+            System.Collections.Hashtable correct = new System.Collections.Hashtable();
+            for (int i = 0; i < results.Length; i++)
+            {
+                correct.Add((System.Int32) results[i], (System.Int32) results[i]);
+            }
+			
+            System.Collections.Hashtable actual = new System.Collections.Hashtable();
+            for (int i = 0; i < hits.Length(); i++)
+            {
+                actual.Add((System.Int32) hits.Id(i), (System.Int32) hits.Id(i));
+            }
+			
+            Assert.AreEqual(correct, actual, query.ToString(defaultFieldName));
+			
+            QueryUtils.Check(query, searcher);
+        }
 		
-		/// <summary>Tests that a Hits has an expected order of documents </summary>
+        /// <summary>Tests that a Hits has an expected order of documents </summary>
 		public static void  CheckDocIds(System.String mes, int[] results, Hits hits)
 		{
 			Assert.AreEqual(results.Length, hits.Length(), mes + " nr of hits");
@@ -154,5 +248,119 @@
 			}
 			return sb.ToString();
 		}
-	}
+		
+        /// <summary> Asserts that the score explanation for every document matching a
+        /// query corrisponds with the true score.
+        /// 
+        /// </summary>
+        /// <seealso cref="ExplanationAsserter">
+        /// </seealso>
+        /// <param name="query">the query to test
+        /// </param>
+        /// <param name="searcher">the searcher to test the query against
+        /// </param>
+        /// <param name="defaultFieldName">used for displaing the query in assertion messages
+        /// </param>
+        public static void  CheckExplanations(Query query, System.String defaultFieldName, Searcher searcher)
+        {
+			
+            searcher.Search(query, new ExplanationAsserter(query, defaultFieldName, searcher));
+        }
+		
+        /// <summary> an IndexSearcher that implicitly checks hte explanation of every match
+        /// whenever it executes a search
+        /// </summary>
+        public class ExplanationAssertingSearcher : IndexSearcher
+        {
+            public ExplanationAssertingSearcher(Directory d) : base(d)
+            {
+            }
+            public ExplanationAssertingSearcher(IndexReader r) : base(r)
+            {
+            }
+            protected internal virtual void  CheckExplanations(Query q)
+            {
+                base.Search(q, null, new ExplanationAsserter(q, null, this));
+            }
+            public virtual Hits search(Query query, Filter filter)
+            {
+                CheckExplanations(query);
+                return base.Search(query, filter);
+            }
+            public override Hits Search(Query query, Sort sort)
+            {
+                CheckExplanations(query);
+                return base.Search(query, sort);
+            }
+            public override Hits Search(Query query, Filter filter, Sort sort)
+            {
+                CheckExplanations(query);
+                return base.Search(query, filter, sort);
+            }
+            public override TopFieldDocs Search(Query query, Filter filter, int n, Sort sort)
+            {
+				
+                CheckExplanations(query);
+                return base.Search(query, filter, n, sort);
+            }
+            public override void  Search(Query query, HitCollector results)
+            {
+                CheckExplanations(query);
+                base.Search(query, results);
+            }
+            public override void  Search(Query query, Filter filter, HitCollector results)
+            {
+                CheckExplanations(query);
+                base.Search(query, filter, results);
+            }
+            public override TopDocs Search(Query query, Filter filter, int n)
+            {
+				
+                CheckExplanations(query);
+                return base.Search(query, filter, n);
+            }
+        }
+		
+        /// <summary> Asserts that the score explanation for every document matching a
+        /// query corrisponds with the true score.
+        /// 
+        /// NOTE: this HitCollector should only be used with the Query and Searcher
+        /// specified at when it is constructed.
+        /// </summary>
+        public class ExplanationAsserter : HitCollector
+        {
+			
+            /// <summary> Some explains methods calculate their vlaues though a slightly
+            /// differnet  order of operations from the acctaul scoring method ...
+            /// this allows for a small amount of variation
+            /// </summary>
+            public static float SCORE_TOLERANCE_DELTA = 0.00005f;
+			
+            internal Query q;
+            internal Searcher s;
+            internal System.String d;
+            public ExplanationAsserter(Query q, System.String defaultFieldName, Searcher s)
+            {
+                this.q = q;
+                this.s = s;
+                this.d = q.ToString(defaultFieldName);
+            }
+            public override void  Collect(int doc, float score)
+            {
+                Explanation exp = null;
+				
+                try
+                {
+                    exp = s.Explain(q, doc);
+                }
+                catch (System.IO.IOException e)
+                {
+                    throw new System.SystemException("exception in hitcollector of [[" + d + "]] for #" + doc, e);
+                }
+				
+                Assert.IsNotNull(exp, "Explanation of [[" + d + "]] for #" + doc + " is null");
+                Assert.AreEqual(score, exp.GetValue(), SCORE_TOLERANCE_DELTA, "Score of [[" + d + "]] for #" + doc + " does not match explanation: " + exp.ToString());
+            }
+        }
+    }
 }

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/MockFilter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/MockFilter.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/MockFilter.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/MockFilter.cs Sat Aug 11 09:56:37 2007
@@ -16,6 +16,7 @@
  */
 
 using System;
+
 using IndexReader = Lucene.Net.Index.IndexReader;
 
 namespace Lucene.Net.Search

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/QueryUtils.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/QueryUtils.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/QueryUtils.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/QueryUtils.cs Sat Aug 11 09:56:37 2007
@@ -36,8 +36,51 @@
 				return null;
 			}
 		}
+
+        private class AnonymousClassHitCollector : HitCollector
+        {
+            public AnonymousClassHitCollector(int[] which, Lucene.Net.Search.Scorer scorer, int[] sdoc, float maxDiff, Lucene.Net.Search.Query q, Lucene.Net.Search.IndexSearcher s)
+            {
+                InitBlock(which, scorer, sdoc, maxDiff, q, s);
+            }
+            private void  InitBlock(int[] which, Lucene.Net.Search.Scorer scorer, int[] sdoc, float maxDiff, Lucene.Net.Search.Query q, Lucene.Net.Search.IndexSearcher s)
+            {
+                this.which = which;
+                this.scorer = scorer;
+                this.sdoc = sdoc;
+                this.maxDiff = maxDiff;
+                this.q = q;
+                this.s = s;
+            }
+            private int[] which;
+            private Lucene.Net.Search.Scorer scorer;
+            private int[] sdoc;
+            private float maxDiff;
+            private Lucene.Net.Search.Query q;
+            private Lucene.Net.Search.IndexSearcher s;
+            public override void  Collect(int doc, float score)
+            {
+                try
+                {
+                    bool more = (which[0]++ & 0x02) == 0?scorer.SkipTo(sdoc[0] + 1):scorer.Next();
+                    sdoc[0] = scorer.Doc();
+                    float scorerScore = scorer.Score();
+                    float scoreDiff = System.Math.Abs(score - scorerScore);
+                    scoreDiff = 0; // TODO: remove this go get LUCENE-697
+                    // failures
+                    if (more == false || doc != sdoc[0] || scoreDiff > maxDiff)
+                    {
+                        throw new System.SystemException("ERROR matching docs:" + "\n\tscorer.more=" + more + " doc=" + sdoc[0] + " score=" + scorerScore + "\n\thitCollector.doc=" + doc + " score=" + score + "\n\t Scorer=" + scorer + "\n\t Query=" + q + "\n\t Searcher=" + s);
+                    }
+                }
+                catch (System.IO.IOException e)
+                {
+                    throw new System.SystemException("", e);
+                }
+            }
+        }
 		
-		/// <summary>Check the types of things query objects should be able to do. </summary>
+        /// <summary>Check the types of things query objects should be able to do. </summary>
 		public static void  Check(Query q)
 		{
 			CheckHashEquals(q);
@@ -75,5 +118,46 @@
 			// happens, please change test to use a different example.
 			Assert.IsTrue(q1.GetHashCode() != q2.GetHashCode());
 		}
-	}
+		
+        /// <summary>various query sanity checks on a searcher </summary>
+        public static void  Check(Query q1, Searcher s)
+        {
+            try
+            {
+                Check(q1);
+                if (s != null && s is IndexSearcher)
+                {
+                    IndexSearcher is_Renamed = (IndexSearcher) s;
+                    CheckSkipTo(q1, is_Renamed);
+                }
+            }
+            catch (System.IO.IOException e)
+            {
+                throw new System.SystemException("", e);
+            }
+        }
+		
+        /// <summary> alternate scorer skipTo(),skipTo(),next(),next(),skipTo(),skipTo(), etc
+        /// and ensure a hitcollector receives same docs and scores
+        /// </summary>
+        public static void  CheckSkipTo(Query q, IndexSearcher s)
+        {
+            // System.out.println("Checking "+q);
+            Weight w = q.Weight(s);
+            Scorer scorer = w.Scorer(s.GetIndexReader());
+			
+            // FUTURE: ensure scorer.doc()==-1
+			
+            if (BooleanQuery.GetUseScorer14())
+                return ; // 1.4 doesn't support skipTo
+			
+            int[] which = new int[1];
+            int[] sdoc = new int[]{- 1};
+            float maxDiff = 1e-5f;
+            s.Search(q, new AnonymousClassHitCollector(which, scorer, sdoc, maxDiff, q, s));
+			
+            // make sure next call to scorer is false.
+            Assert.IsFalse((which[0]++ & 0x02) == 0 ? scorer.SkipTo(sdoc[0] + 1) : scorer.Next());
+        }
+    }
 }

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/SampleComparable.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/SampleComparable.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/SampleComparable.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/SampleComparable.cs Sat Aug 11 09:56:37 2007
@@ -16,6 +16,7 @@
  */
 
 using System;
+
 using IndexReader = Lucene.Net.Index.IndexReader;
 using Term = Lucene.Net.Index.Term;
 using TermDocs = Lucene.Net.Index.TermDocs;
@@ -43,8 +44,8 @@
 	/// </summary>
 	/// <author>  Tim Jones
 	/// </author>
-	/// <version>  $Id: SampleComparable.java 150348 2004-05-19 23:05:27Z tjones $
-	/// </version>
+    /// <version>  $Id: SampleComparable.java 472959 2006-11-09 16:21:50Z yonik $
+    /// </version>
 	/// <since> 1.4
 	/// </since>
 	[Serializable]

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/SingleDocTestFilter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/SingleDocTestFilter.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/SingleDocTestFilter.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/SingleDocTestFilter.cs Sat Aug 11 09:56:37 2007
@@ -16,6 +16,7 @@
  */
 
 using System;
+
 using IndexReader = Lucene.Net.Index.IndexReader;
 
 namespace Lucene.Net.search

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestBasics.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/Spans/TestBasics.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestBasics.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestBasics.cs Sat Aug 11 09:56:37 2007
@@ -16,16 +16,18 @@
  */
 
 using System;
+
 using NUnit.Framework;
+
+using English = Lucene.Net.Util.English;
 using SimpleAnalyzer = Lucene.Net.Analysis.SimpleAnalyzer;
 using Document = Lucene.Net.Documents.Document;
 using Field = Lucene.Net.Documents.Field;
 using IndexWriter = Lucene.Net.Index.IndexWriter;
 using Term = Lucene.Net.Index.Term;
+using RAMDirectory = Lucene.Net.Store.RAMDirectory;
 using Lucene.Net.Search;
 using Searchable = Lucene.Net.Search.Searchable;
-using RAMDirectory = Lucene.Net.Store.RAMDirectory;
-using English = Lucene.Net.Util.English;
 
 namespace Lucene.Net.Search.Spans
 {
@@ -330,8 +332,7 @@
 		
 		private void  CheckHits(Query query, int[] results)
 		{
-            Lucene.Net.Search.CheckHits.CheckHits_Renamed_Method(query, "field", searcher, results);
-            QueryUtils.Check(query);
+            Lucene.Net.Search.CheckHits.CheckHits_Renamed(query, "field", searcher, results);
         }
 	}
 }

Added: incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestNearSpansOrdered.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/Spans/TestNearSpansOrdered.cs?view=auto&rev=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestNearSpansOrdered.cs (added)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestNearSpansOrdered.cs Sat Aug 11 09:56:37 2007
@@ -0,0 +1,197 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+using NUnit.Framework;
+
+using Explanation = Lucene.Net.Search.Explanation;
+using IndexSearcher = Lucene.Net.Search.IndexSearcher;
+using Scorer = Lucene.Net.Search.Scorer;
+using Weight = Lucene.Net.Search.Weight;
+using CheckHits = Lucene.Net.Search.CheckHits;
+using RAMDirectory = Lucene.Net.Store.RAMDirectory;
+using IndexWriter = Lucene.Net.Index.IndexWriter;
+using Term = Lucene.Net.Index.Term;
+using WhitespaceAnalyzer = Lucene.Net.Analysis.WhitespaceAnalyzer;
+using Document = Lucene.Net.Documents.Document;
+using Field = Lucene.Net.Documents.Field;
+using QueryParser = Lucene.Net.QueryParsers.QueryParser;
+
+namespace Lucene.Net.Search.Spans
+{
+	
+    [TestFixture]
+	public class TestNearSpansOrdered
+	{
+		protected internal IndexSearcher searcher;
+		
+		public const System.String FIELD = "field";
+		public static readonly Lucene.Net.QueryParsers.QueryParser qp = new Lucene.Net.QueryParsers.QueryParser(FIELD, new WhitespaceAnalyzer());
+		
+        [TearDown]
+		public virtual void  TearDown()
+		{
+			searcher.Close();
+		}
+		
+        [SetUp]
+		public virtual void  SetUp()
+		{
+			RAMDirectory directory = new RAMDirectory();
+			IndexWriter writer = new IndexWriter(directory, new WhitespaceAnalyzer(), true);
+			for (int i = 0; i < docFields.Length; i++)
+			{
+				Document doc = new Document();
+				doc.Add(new Field(FIELD, docFields[i], Field.Store.NO, Field.Index.TOKENIZED));
+				writer.AddDocument(doc);
+			}
+			writer.Close();
+			searcher = new IndexSearcher(directory);
+		}
+		
+		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"};
+		
+		protected internal virtual SpanNearQuery MakeQuery(System.String s1, System.String s2, System.String s3, int slop, bool inOrder)
+		{
+			return new SpanNearQuery(new SpanQuery[]{new SpanTermQuery(new Term(FIELD, s1)), new SpanTermQuery(new Term(FIELD, s2)), new SpanTermQuery(new Term(FIELD, s3))}, slop, inOrder);
+		}
+
+		protected internal virtual SpanNearQuery MakeQuery()
+		{
+			return MakeQuery("w1", "w2", "w3", 1, true);
+		}
+		
+        [Test]
+		public virtual void  TestSpanNearQuery()
+		{
+			SpanNearQuery q = MakeQuery();
+			CheckHits.CheckHits_Renamed(q, FIELD, searcher, new int[]{0, 1});
+		}
+		
+		public virtual System.String S(Spans span)
+		{
+			return S(span.Doc(), span.Start(), span.End());
+		}
+
+		public virtual System.String S(int doc, int start, int end)
+		{
+			return "s(" + doc + "," + start + "," + end + ")";
+		}
+		
+        [Test]
+		public virtual void  TestNearSpansNext()
+		{
+			SpanNearQuery q = MakeQuery();
+			Spans span = q.GetSpans(searcher.GetIndexReader());
+			Assert.AreEqual(true, span.Next());
+			Assert.AreEqual(S(0, 0, 3), S(span));
+			Assert.AreEqual(true, span.Next());
+			Assert.AreEqual(S(1, 0, 4), S(span));
+			Assert.AreEqual(false, span.Next());
+		}
+		
+		/// <summary> test does not imply that skipTo(doc+1) should work exactly the
+		/// same as next -- it's only applicable in this case since we know doc
+		/// does not contain more than one span
+		/// </summary>
+		[Test]
+		public virtual void  TestNearSpansSkipToLikeNext()
+		{
+			SpanNearQuery q = MakeQuery();
+			Spans span = q.GetSpans(searcher.GetIndexReader());
+			Assert.AreEqual(true, span.SkipTo(0));
+			Assert.AreEqual(S(0, 0, 3), S(span));
+			Assert.AreEqual(true, span.SkipTo(1));
+			Assert.AreEqual(S(1, 0, 4), S(span));
+			Assert.AreEqual(false, span.SkipTo(2));
+		}
+		
+        [Test]
+		public virtual void  TestNearSpansNextThenSkipTo()
+		{
+			SpanNearQuery q = MakeQuery();
+			Spans span = q.GetSpans(searcher.GetIndexReader());
+			Assert.AreEqual(true, span.Next());
+			Assert.AreEqual(S(0, 0, 3), S(span));
+			Assert.AreEqual(true, span.SkipTo(1));
+			Assert.AreEqual(S(1, 0, 4), S(span));
+			Assert.AreEqual(false, span.Next());
+		}
+		
+        [Test]
+		public virtual void  TestNearSpansNextThenSkipPast()
+		{
+			SpanNearQuery q = MakeQuery();
+			Spans span = q.GetSpans(searcher.GetIndexReader());
+			Assert.AreEqual(true, span.Next());
+			Assert.AreEqual(S(0, 0, 3), S(span));
+			Assert.AreEqual(false, span.SkipTo(2));
+		}
+		
+        [Test]
+		public virtual void  TestNearSpansSkipPast()
+		{
+			SpanNearQuery q = MakeQuery();
+			Spans span = q.GetSpans(searcher.GetIndexReader());
+			Assert.AreEqual(false, span.SkipTo(2));
+		}
+		
+        [Test]
+		public virtual void  TestNearSpansSkipTo0()
+		{
+			SpanNearQuery q = MakeQuery();
+			Spans span = q.GetSpans(searcher.GetIndexReader());
+			Assert.AreEqual(true, span.SkipTo(0));
+			Assert.AreEqual(S(0, 0, 3), S(span));
+		}
+		
+        [Test]
+		public virtual void  TestNearSpansSkipTo1()
+		{
+			SpanNearQuery q = MakeQuery();
+			Spans span = q.GetSpans(searcher.GetIndexReader());
+			Assert.AreEqual(true, span.SkipTo(1));
+			Assert.AreEqual(S(1, 0, 4), S(span));
+		}
+		
+		/// <summary> not a direct test of NearSpans, but a demonstration of how/when
+		/// this causes problems
+		/// </summary>
+		[Test]
+		public virtual void  TestSpanNearScorerSkipTo1()
+		{
+			SpanNearQuery q = MakeQuery();
+			Weight w = q.CreateWeight_ForNUnitTest(searcher);
+			Scorer s = w.Scorer(searcher.GetIndexReader());
+			Assert.AreEqual(true, s.SkipTo(1));
+			Assert.AreEqual(1, s.Doc());
+		}
+		/// <summary> not a direct test of NearSpans, but a demonstration of how/when
+		/// this causes problems
+		/// </summary>
+		[Test]
+		public virtual void  TestSpanNearScorerExplain()
+		{
+			SpanNearQuery q = MakeQuery();
+			Weight w = q.CreateWeight_ForNUnitTest(searcher);
+			Scorer s = w.Scorer(searcher.GetIndexReader());
+			Explanation e = s.Explain(1);
+			Assert.IsTrue(0.0f < e.GetValue(), "Scorer explanation value for doc#1 isn't positive: " + e.ToString());
+		}
+	}
+}
\ No newline at end of file

Added: incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestSpanExplanations.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/Spans/TestSpanExplanations.cs?view=auto&rev=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestSpanExplanations.cs (added)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestSpanExplanations.cs Sat Aug 11 09:56:37 2007
@@ -0,0 +1,274 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+using NUnit.Framework;
+
+using Lucene.Net.Search;
+using Searchable = Lucene.Net.Search.Searchable;
+using RAMDirectory = Lucene.Net.Store.RAMDirectory;
+using IndexWriter = Lucene.Net.Index.IndexWriter;
+using IndexReader = Lucene.Net.Index.IndexReader;
+using Term = Lucene.Net.Index.Term;
+using WhitespaceAnalyzer = Lucene.Net.Analysis.WhitespaceAnalyzer;
+using Document = Lucene.Net.Documents.Document;
+using Field = Lucene.Net.Documents.Field;
+using QueryParser = Lucene.Net.QueryParsers.QueryParser;
+using ParseException = Lucene.Net.QueryParsers.ParseException;
+
+namespace Lucene.Net.Search.Spans
+{
+	
+	/// <summary> TestExplanations subclass focusing on span queries</summary>
+	[TestFixture]
+	public class TestSpanExplanations : TestExplanations
+	{
+		
+		/* simple SpanTermQueries */
+		[Test]
+		public virtual void  TestST1()
+		{
+			SpanQuery q = St("w1");
+			Qtest(q, new int[]{0, 1, 2, 3});
+		}
+
+        [Test]
+		public virtual void  TestST2()
+		{
+			SpanQuery q = St("w1");
+			q.SetBoost(1000);
+			Qtest(q, new int[]{0, 1, 2, 3});
+		}
+
+        [Test]
+		public virtual void  TestST4()
+		{
+			SpanQuery q = St("xx");
+			Qtest(q, new int[]{2, 3});
+		}
+
+        [Test]
+		public virtual void  TestST5()
+		{
+			SpanQuery q = St("xx");
+			q.SetBoost(1000);
+			Qtest(q, new int[]{2, 3});
+		}
+		
+		/* some SpanFirstQueries */
+		
+        [Test]
+        public virtual void  TestSF1()
+		{
+			SpanQuery q = Sf(("w1"), 1);
+			Qtest(q, new int[]{0, 1, 2, 3});
+		}
+
+        [Test]
+        public virtual void  TestSF2()
+		{
+			SpanQuery q = Sf(("w1"), 1);
+			q.SetBoost(1000);
+			Qtest(q, new int[]{0, 1, 2, 3});
+		}
+
+        [Test]
+        public virtual void  TestSF4()
+		{
+			SpanQuery q = Sf(("xx"), 2);
+			Qtest(q, new int[]{2});
+		}
+
+        [Test]
+        public virtual void  TestSF5()
+		{
+			SpanQuery q = Sf(("yy"), 2);
+			Qtest(q, new int[]{});
+		}
+
+        [Test]
+        public virtual void  TestSF6()
+		{
+			SpanQuery q = Sf(("yy"), 4);
+			q.SetBoost(1000);
+			Qtest(q, new int[]{2});
+		}
+		
+		/* some SpanOrQueries */
+		
+        [Test]
+        public virtual void  TestSO1()
+		{
+			SpanQuery q = Sor("w1", "QQ");
+			Qtest(q, new int[]{0, 1, 2, 3});
+		}
+
+        [Test]
+        public virtual void  TestSO2()
+		{
+			SpanQuery q = Sor("w1", "w3", "zz");
+			Qtest(q, new int[]{0, 1, 2, 3});
+		}
+
+        [Test]
+        public virtual void  TestSO3()
+		{
+			SpanQuery q = Sor("w5", "QQ", "yy");
+			Qtest(q, new int[]{0, 2, 3});
+		}
+
+        [Test]
+        public virtual void  TestSO4()
+		{
+			SpanQuery q = Sor("w5", "QQ", "yy");
+			Qtest(q, new int[]{0, 2, 3});
+		}
+		
+		
+		
+		/* some SpanNearQueries */
+		
+        [Test]
+        public virtual void  TestSNear1()
+		{
+			SpanQuery q = Snear("w1", "QQ", 100, true);
+			Qtest(q, new int[]{});
+		}
+
+        [Test]
+        public virtual void  TestSNear2()
+		{
+			SpanQuery q = Snear("w1", "xx", 100, true);
+			Qtest(q, new int[]{2, 3});
+		}
+
+        [Test]
+        public virtual void  TestSNear3()
+		{
+			SpanQuery q = Snear("w1", "xx", 0, true);
+			Qtest(q, new int[]{2});
+		}
+
+        [Test]
+        public virtual void  TestSNear4()
+		{
+			SpanQuery q = Snear("w1", "xx", 1, true);
+			Qtest(q, new int[]{2, 3});
+		}
+
+        [Test]
+        public virtual void  TestSNear5()
+		{
+			SpanQuery q = Snear("xx", "w1", 0, false);
+			Qtest(q, new int[]{2});
+		}
+		
+        [Test]
+        public virtual void  TestSNear6()
+		{
+			SpanQuery q = Snear("w1", "w2", "QQ", 100, true);
+			Qtest(q, new int[]{});
+		}
+
+        [Test]
+        public virtual void  TestSNear7()
+		{
+			SpanQuery q = Snear("w1", "xx", "w2", 100, true);
+			Qtest(q, new int[]{2, 3});
+		}
+
+        [Test]
+        public virtual void  TestSNear8()
+		{
+			SpanQuery q = Snear("w1", "xx", "w2", 0, true);
+			Qtest(q, new int[]{2});
+		}
+
+        [Test]
+        public virtual void  TestSNear9()
+		{
+			SpanQuery q = Snear("w1", "xx", "w2", 1, true);
+			Qtest(q, new int[]{2, 3});
+		}
+
+        [Test]
+        public virtual void  TestSNear10()
+		{
+			SpanQuery q = Snear("xx", "w1", "w2", 0, false);
+			Qtest(q, new int[]{2});
+		}
+
+        [Test]
+        public virtual void  TestSNear11()
+		{
+			SpanQuery q = Snear("w1", "w2", "w3", 1, true);
+			Qtest(q, new int[]{0, 1});
+		}
+		
+		
+		/* some SpanNotQueries */
+		
+        [Test]
+        public virtual void  TestSNot1()
+		{
+			SpanQuery q = Snot(Sf("w1", 10), St("QQ"));
+			Qtest(q, new int[]{0, 1, 2, 3});
+		}
+
+        [Test]
+        public virtual void  TestSNot2()
+		{
+			SpanQuery q = Snot(Sf("w1", 10), St("QQ"));
+			q.SetBoost(1000);
+			Qtest(q, new int[]{0, 1, 2, 3});
+		}
+
+        [Test]
+        public virtual void  TestSNot4()
+		{
+			SpanQuery q = Snot(Sf("w1", 10), St("xx"));
+			Qtest(q, new int[]{0, 1, 2, 3});
+		}
+
+        [Test]
+        public virtual void  TestSNot5()
+		{
+			SpanQuery q = Snot(Sf("w1", 10), St("xx"));
+			q.SetBoost(1000);
+			Qtest(q, new int[]{0, 1, 2, 3});
+		}
+
+        [Test]
+        public virtual void  TestSNot7()
+		{
+			SpanQuery f = Snear("w1", "w3", 10, true);
+			f.SetBoost(1000);
+			SpanQuery q = Snot(f, St("xx"));
+			Qtest(q, new int[]{0, 1, 3});
+		}
+
+        [Test]
+        public virtual void  TestSNot10()
+		{
+			SpanQuery t = St("xx");
+			t.SetBoost(10000);
+			SpanQuery q = Snot(Snear("w1", "w3", 10, true), t);
+			Qtest(q, new int[]{0, 1, 3});
+		}
+	}
+}
\ No newline at end of file

Added: incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestSpanExplanationsOfNonMatches.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/Spans/TestSpanExplanationsOfNonMatches.cs?view=auto&rev=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestSpanExplanationsOfNonMatches.cs (added)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestSpanExplanationsOfNonMatches.cs Sat Aug 11 09:56:37 2007
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+using Query = Lucene.Net.Search.Query;
+using CheckHits = Lucene.Net.Search.CheckHits;
+
+namespace Lucene.Net.Search.Spans
+{
+	
+	
+	/// <summary> subclass of TestSimpleExplanations that verifies non matches.</summary>
+    public class TestSpanExplanationsOfNonMatches : TestSpanExplanations
+	{
+		
+		/// <summary> Overrides superclass to ignore matches and focus on non-matches
+		/// 
+		/// </summary>
+		/// <seealso cref="CheckHits.checkNoMatchExplanations">
+		/// </seealso>
+		public override void  Qtest(Query q, int[] expDocNrs)
+		{
+			CheckHits.CheckNoMatchExplanations(q, FIELD, searcher, expDocNrs);
+		}
+	}
+}
\ No newline at end of file

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestSpans.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/Spans/TestSpans.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestSpans.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestSpans.cs Sat Aug 11 09:56:37 2007
@@ -16,16 +16,18 @@
  */
 
 using System;
-using WhitespaceAnalyzer = Lucene.Net.Analysis.WhitespaceAnalyzer;
-using Document = Lucene.Net.Documents.Document;
-using Field = Lucene.Net.Documents.Field;
-using IndexWriter = Lucene.Net.Index.IndexWriter;
-using Term = Lucene.Net.Index.Term;
-using CheckHits = Lucene.Net.Search.CheckHits;
+
+using NUnit.Framework;
+
 using IndexSearcher = Lucene.Net.Search.IndexSearcher;
 using Query = Lucene.Net.Search.Query;
+using CheckHits = Lucene.Net.Search.CheckHits;
 using RAMDirectory = Lucene.Net.Store.RAMDirectory;
-using NUnit.Framework;
+using IndexWriter = Lucene.Net.Index.IndexWriter;
+using Term = Lucene.Net.Index.Term;
+using WhitespaceAnalyzer = Lucene.Net.Analysis.WhitespaceAnalyzer;
+using Document = Lucene.Net.Documents.Document;
+using Field = Lucene.Net.Documents.Field;
 
 namespace Lucene.Net.Search.Spans
 {
@@ -61,7 +63,7 @@
 		
 		private void  CheckHits(Query query, int[] results)
 		{
-			Lucene.Net.Search.CheckHits.CheckHits_Renamed_Method(query, field, searcher, results);
+			Lucene.Net.Search.CheckHits.CheckHits_Renamed(query, field, searcher, results);
 		}
 		
 		private void  OrderedSlopTest3SQ(SpanQuery q1, SpanQuery q2, SpanQuery q3, int slop, int[] expectedDocs)
@@ -190,5 +192,86 @@
 			
 			Assert.IsFalse(spans.Next(), "third range");
 		}
-	}
+		
+		
+        private Spans OrSpans(System.String[] terms)
+        {
+            SpanQuery[] sqa = new SpanQuery[terms.Length];
+            for (int i = 0; i < terms.Length; i++)
+            {
+                sqa[i] = MakeSpanTermQuery(terms[i]);
+            }
+            return (new SpanOrQuery(sqa)).GetSpans(searcher.GetIndexReader());
+        }
+		
+        private void  TstNextSpans(Spans spans, int doc, int start, int end)
+        {
+            Assert.IsTrue(spans.Next(), "next");
+            Assert.AreEqual(doc, spans.Doc(), "doc");
+            Assert.AreEqual(start, spans.Start(), "start");
+            Assert.AreEqual(end, spans.End(), "end");
+        }
+		
+        [Test]
+        public virtual void  TestSpanOrEmpty()
+        {
+            Spans spans = OrSpans(new System.String[0]);
+            Assert.IsFalse(spans.Next(), "empty next");
+        }
+		
+        [Test]
+        public virtual void  TestSpanOrSingle()
+        {
+            Spans spans = OrSpans(new System.String[]{"w5"});
+            TstNextSpans(spans, 0, 4, 5);
+            Assert.IsFalse(spans.Next(), "final next");
+        }
+		
+        [Test]
+        public virtual void  TestSpanOrDouble()
+        {
+            Spans spans = OrSpans(new System.String[]{"w5", "yy"});
+            TstNextSpans(spans, 0, 4, 5);
+            TstNextSpans(spans, 2, 3, 4);
+            TstNextSpans(spans, 3, 4, 5);
+            TstNextSpans(spans, 7, 3, 4);
+            Assert.IsFalse(spans.Next(), "final next");
+        }
+		
+        [Test]
+        public virtual void  TestSpanOrDoubleSkip()
+        {
+            Spans spans = OrSpans(new System.String[]{"w5", "yy"});
+            Assert.IsTrue(spans.SkipTo(3), "initial skipTo");
+            Assert.AreEqual(3, spans.Doc(), "doc");
+            Assert.AreEqual(4, spans.Start(), "start");
+            Assert.AreEqual(5, spans.End(), "end");
+            TstNextSpans(spans, 7, 3, 4);
+            Assert.IsFalse(spans.Next(), "final next");
+        }
+		
+        [Test]
+        public virtual void  TestSpanOrUnused()
+        {
+            Spans spans = OrSpans(new System.String[]{"w5", "unusedTerm", "yy"});
+            TstNextSpans(spans, 0, 4, 5);
+            TstNextSpans(spans, 2, 3, 4);
+            TstNextSpans(spans, 3, 4, 5);
+            TstNextSpans(spans, 7, 3, 4);
+            Assert.IsFalse(spans.Next(), "final next");
+        }
+		
+        [Test]
+        public virtual void  TestSpanOrTripleSameDoc()
+        {
+            Spans spans = OrSpans(new System.String[]{"t1", "t2", "t3"});
+            TstNextSpans(spans, 11, 0, 1);
+            TstNextSpans(spans, 11, 1, 2);
+            TstNextSpans(spans, 11, 2, 3);
+            TstNextSpans(spans, 11, 3, 4);
+            TstNextSpans(spans, 11, 4, 5);
+            TstNextSpans(spans, 11, 5, 6);
+            Assert.IsFalse(spans.Next(), "final next");
+        }
+    }
 }

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestSpansAdvanced.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/Spans/TestSpansAdvanced.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestSpansAdvanced.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestSpansAdvanced.cs Sat Aug 11 09:56:37 2007
@@ -16,17 +16,16 @@
  */
 
 using System;
+
 using NUnit.Framework;
+
 using StandardAnalyzer = Lucene.Net.Analysis.Standard.StandardAnalyzer;
 using Document = Lucene.Net.Documents.Document;
 using Field = Lucene.Net.Documents.Field;
 using IndexWriter = Lucene.Net.Index.IndexWriter;
 using Term = Lucene.Net.Index.Term;
-using BooleanClause = Lucene.Net.Search.BooleanClause;
-using BooleanQuery = Lucene.Net.Search.BooleanQuery;
-using Hits = Lucene.Net.Search.Hits;
-using IndexSearcher = Lucene.Net.Search.IndexSearcher;
-using Query = Lucene.Net.Search.Query;
+using Lucene.Net.Search;
+using Searchable = Lucene.Net.Search.Searchable;
 using Directory = Lucene.Net.Store.Directory;
 using RAMDirectory = Lucene.Net.Store.RAMDirectory;
 
@@ -139,6 +138,8 @@
 		/// <throws>  IOException </throws>
 		protected internal virtual void  AssertHits(Searcher s, Query query, System.String description, System.String[] expectedIds, float[] expectedScores)
 		{
+            QueryUtils.Check(query, s);
+
             float tolerance = 1e-5f;
 			
             // Hits hits = searcher.search(query);

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestSpansAdvanced2.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/Spans/TestSpansAdvanced2.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestSpansAdvanced2.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/Spans/TestSpansAdvanced2.cs Sat Aug 11 09:56:37 2007
@@ -16,15 +16,15 @@
  */
 
 using System;
+
 using NUnit.Framework;
+
 using StandardAnalyzer = Lucene.Net.Analysis.Standard.StandardAnalyzer;
 using IndexReader = Lucene.Net.Index.IndexReader;
 using IndexWriter = Lucene.Net.Index.IndexWriter;
 using Term = Lucene.Net.Index.Term;
-using BooleanClause = Lucene.Net.Search.BooleanClause;
-using BooleanQuery = Lucene.Net.Search.BooleanQuery;
-using Hits = Lucene.Net.Search.Hits;
-using Query = Lucene.Net.Search.Query;
+using Lucene.Net.Search;
+using Searchable = Lucene.Net.Search.Searchable;
 
 namespace Lucene.Net.Search.Spans
 {

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/TestBoolean2.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/TestBoolean2.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/TestBoolean2.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/TestBoolean2.cs Sat Aug 11 09:56:37 2007
@@ -16,15 +16,17 @@
  */
 
 using System;
+
+using NUnit.Framework;
+
+using RAMDirectory = Lucene.Net.Store.RAMDirectory;
+using IndexWriter = Lucene.Net.Index.IndexWriter;
+using Term = Lucene.Net.Index.Term;
 using WhitespaceAnalyzer = Lucene.Net.Analysis.WhitespaceAnalyzer;
 using Document = Lucene.Net.Documents.Document;
 using Field = Lucene.Net.Documents.Field;
-using IndexWriter = Lucene.Net.Index.IndexWriter;
-using Term = Lucene.Net.Index.Term;
-using ParseException = Lucene.Net.QueryParsers.ParseException;
 using QueryParser = Lucene.Net.QueryParsers.QueryParser;
-using RAMDirectory = Lucene.Net.Store.RAMDirectory;
-using NUnit.Framework;
+using ParseException = Lucene.Net.QueryParsers.ParseException;
 
 namespace Lucene.Net.Search
 {
@@ -84,7 +86,8 @@
 		
 		public virtual Query MakeQuery(System.String queryText)
 		{
-			return (new Lucene.Net.QueryParsers.QueryParser(field, new WhitespaceAnalyzer())).Parse(queryText);
+            Query q = (new Lucene.Net.QueryParsers.QueryParser(field, new WhitespaceAnalyzer())).Parse(queryText);
+            return q;
 		}
 		
 		public virtual void  QueriesTest(System.String queryText, int[] expDocNrs)
@@ -214,7 +217,10 @@
 					Sort sort = Sort.INDEXORDER;
 					
 					BooleanQuery.SetUseScorer14(false);
-					Hits hits1 = searcher.Search(q1, sort);
+					
+                    QueryUtils.Check(q1, searcher);
+					
+                    Hits hits1 = searcher.Search(q1, sort);
 					if (hits1.Length() > 0)
 						hits1.Id(hits1.Length() - 1);
 					

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/TestBooleanMinShouldMatch.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/TestBooleanMinShouldMatch.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/TestBooleanMinShouldMatch.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/TestBooleanMinShouldMatch.cs Sat Aug 11 09:56:37 2007
@@ -16,17 +16,17 @@
  */
 
 using System;
+
+using NUnit.Framework;
+
 using WhitespaceAnalyzer = Lucene.Net.Analysis.WhitespaceAnalyzer;
 using Document = Lucene.Net.Documents.Document;
 using Field = Lucene.Net.Documents.Field;
 using IndexReader = Lucene.Net.Index.IndexReader;
 using IndexWriter = Lucene.Net.Index.IndexWriter;
 using Term = Lucene.Net.Index.Term;
-using ParseException = Lucene.Net.QueryParsers.ParseException;
-using QueryParser = Lucene.Net.QueryParsers.QueryParser;
 using Directory = Lucene.Net.Store.Directory;
 using RAMDirectory = Lucene.Net.Store.RAMDirectory;
-using NUnit.Framework;
 
 namespace Lucene.Net.Search
 {
@@ -116,7 +116,8 @@
 				PrintHits("TestBooleanMinShouldMatch", h);  // PrintHits(NUnit.Framework.TestCase.GetName(), h);    // {{Aroush-1.9}} 'GetName()' gives us the name of the test in JUnit, how is it done in NUnit?
             }
 			Assert.AreEqual(expected, h.Length(), "result count");
-		}
+            QueryUtils.Check(q, s);
+        }
 		
 		[Test]
         public virtual void  TestAllOptional()
@@ -369,7 +370,10 @@
 				TopDocs top1 = s.Search(q1, null, 100);
 				TopDocs top2 = s.Search(q2, null, 100);
 				
-				// The constrained query
+                QueryUtils.Check(q1, s);
+                QueryUtils.Check(q2, s);
+				
+                // The constrained query
 				// should be a superset to the unconstrained query.
 				if (top2.totalHits > top1.totalHits)
 				{

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/TestBooleanOr.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/TestBooleanOr.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/TestBooleanOr.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/TestBooleanOr.cs Sat Aug 11 09:56:37 2007
@@ -16,7 +16,9 @@
  */
 
 using System;
+
 using NUnit.Framework;
+
 using StandardAnalyzer = Lucene.Net.Analysis.Standard.StandardAnalyzer;
 using Document = Lucene.Net.Documents.Document;
 using Field = Lucene.Net.Documents.Field;
@@ -48,8 +50,9 @@
 		
 		private int Search(Query q)
 		{
-			return searcher.Search(q).Length();
-		}
+            QueryUtils.Check(q, searcher);
+            return searcher.Search(q).Length();
+        }
 		
 		[Test]
         public virtual void  TestElements()

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/TestBooleanPrefixQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/TestBooleanPrefixQuery.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/TestBooleanPrefixQuery.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/TestBooleanPrefixQuery.cs Sat Aug 11 09:56:37 2007
@@ -16,22 +16,24 @@
  */
 
 using System;
+
 using NUnit.Framework;
+
+using RAMDirectory = Lucene.Net.Store.RAMDirectory;
+using IndexWriter = Lucene.Net.Index.IndexWriter;
+using Term = Lucene.Net.Index.Term;
+using IndexReader = Lucene.Net.Index.IndexReader;
 using WhitespaceAnalyzer = Lucene.Net.Analysis.WhitespaceAnalyzer;
 using Document = Lucene.Net.Documents.Document;
 using Field = Lucene.Net.Documents.Field;
-using IndexReader = Lucene.Net.Index.IndexReader;
-using IndexWriter = Lucene.Net.Index.IndexWriter;
-using Term = Lucene.Net.Index.Term;
-using RAMDirectory = Lucene.Net.Store.RAMDirectory;
 
 namespace Lucene.Net.Search
 {
 	
 	/// <author>  schnee
 	/// </author>
-	/// <version>  $Id: TestBooleanPrefixQuery.java 150492 2004-09-06 22:01:49Z dnaber $
-	/// 
+    /// <version>  $Id: TestBooleanPrefixQuery.java 472959 2006-11-09 16:21:50Z yonik $
+    /// 
 	/// </version>
 	[TestFixture]
 	public class TestBooleanPrefixQuery

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/TestBooleanQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/TestBooleanQuery.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/TestBooleanQuery.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/TestBooleanQuery.cs Sat Aug 11 09:56:37 2007
@@ -16,7 +16,9 @@
  */
 
 using System;
+
 using NUnit.Framework;
+
 using Term = Lucene.Net.Index.Term;
 
 namespace Lucene.Net.Search

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/TestBooleanScorer.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/TestBooleanScorer.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/TestBooleanScorer.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/TestBooleanScorer.cs Sat Aug 11 09:56:37 2007
@@ -16,21 +16,23 @@
  */
 
 using System;
+
+using NUnit.Framework;
+
 using WhitespaceAnalyzer = Lucene.Net.Analysis.WhitespaceAnalyzer;
 using Document = Lucene.Net.Documents.Document;
 using Field = Lucene.Net.Documents.Field;
 using IndexWriter = Lucene.Net.Index.IndexWriter;
 using Term = Lucene.Net.Index.Term;
 using RAMDirectory = Lucene.Net.Store.RAMDirectory;
-using NUnit.Framework;
 
 namespace Lucene.Net.Search
 {
 	
 	/// <author>  Christoph Goller
 	/// </author>
-	/// <version>  $rcs = ' $Id: TestBooleanScorer.java 150700 2004-12-10 19:36:40Z goller $ ' ;
-	/// </version>
+    /// <version>  $rcs = ' $Id: TestBooleanScorer.java 472959 2006-11-09 16:21:50Z yonik $ ' ;
+    /// </version>
 	[TestFixture]
     public class TestBooleanScorer
 	{

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/TestCachingWrapperFilter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/TestCachingWrapperFilter.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/TestCachingWrapperFilter.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/TestCachingWrapperFilter.cs Sat Aug 11 09:56:37 2007
@@ -16,12 +16,14 @@
  */
 
 using System;
+
 using NUnit.Framework;
-using StandardAnalyzer = Lucene.Net.Analysis.Standard.StandardAnalyzer;
-using IndexReader = Lucene.Net.Index.IndexReader;
-using IndexWriter = Lucene.Net.Index.IndexWriter;
+
 using Directory = Lucene.Net.Store.Directory;
 using RAMDirectory = Lucene.Net.Store.RAMDirectory;
+using IndexReader = Lucene.Net.Index.IndexReader;
+using IndexWriter = Lucene.Net.Index.IndexWriter;
+using StandardAnalyzer = Lucene.Net.Analysis.Standard.StandardAnalyzer;
 
 namespace Lucene.Net.Search
 {

Added: incubator/lucene.net/trunk/C#/src/Test/Search/TestComplexExplanations.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/TestComplexExplanations.cs?view=auto&rev=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/TestComplexExplanations.cs (added)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/TestComplexExplanations.cs Sat Aug 11 09:56:37 2007
@@ -0,0 +1,326 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+using NUnit.Framework;
+
+using Occur = Lucene.Net.Search.BooleanClause.Occur;
+using Lucene.Net.Search.Spans;
+using RAMDirectory = Lucene.Net.Store.RAMDirectory;
+using IndexWriter = Lucene.Net.Index.IndexWriter;
+using IndexReader = Lucene.Net.Index.IndexReader;
+using Term = Lucene.Net.Index.Term;
+using WhitespaceAnalyzer = Lucene.Net.Analysis.WhitespaceAnalyzer;
+using Document = Lucene.Net.Documents.Document;
+using Field = Lucene.Net.Documents.Field;
+using QueryParser = Lucene.Net.QueryParsers.QueryParser;
+using ParseException = Lucene.Net.QueryParsers.ParseException;
+
+namespace Lucene.Net.Search
+{
+	
+	/// <summary> TestExplanations subclass that builds up super crazy complex queries
+	/// on the assumption that if the explanations work out right for them,
+	/// they should work for anything.
+	/// </summary>
+    [TestFixture]
+    public class TestComplexExplanations : TestExplanations
+	{
+		[Serializable]
+		private class AnonymousClassDefaultSimilarity : DefaultSimilarity
+		{
+			public AnonymousClassDefaultSimilarity(TestComplexExplanations enclosingInstance)
+			{
+				InitBlock(enclosingInstance);
+			}
+			private void  InitBlock(TestComplexExplanations enclosingInstance)
+			{
+				this.enclosingInstance = enclosingInstance;
+			}
+			private TestComplexExplanations enclosingInstance;
+			public TestComplexExplanations Enclosing_Instance
+			{
+				get
+				{
+					return enclosingInstance;
+				}
+				
+			}
+			public override float QueryNorm(float sumOfSquaredWeights)
+			{
+				return 1.0f; // / (float) Math.sqrt(1.0f + sumOfSquaredWeights);
+			}
+		}
+		
+		/// <summary> Override the Similarity used in our searcher with one that plays
+		/// nice with boosts of 0.0
+		/// </summary>
+		[SetUp]
+        public override void  SetUp()
+		{
+			searcher.SetSimilarity(new AnonymousClassDefaultSimilarity(this));
+		}
+		
+		
+        [Test]
+        public virtual void  Test1()
+		{
+			
+			BooleanQuery q = new BooleanQuery();
+			
+			q.Add(qp.Parse("\"w1 w2\"~1"), Occur.MUST);
+			q.Add(Snear(St("w2"), Sor("w5", "zz"), 4, true), Occur.SHOULD);
+			q.Add(Snear(Sf("w3", 2), St("w2"), St("w3"), 5, true), Occur.SHOULD);
+			
+			Query t = new FilteredQuery(qp.Parse("xx"), new ItemizedFilter(new int[]{1, 3}));
+			t.SetBoost(1000);
+			q.Add(t, Occur.SHOULD);
+			
+			t = new ConstantScoreQuery(new ItemizedFilter(new int[]{0, 2}));
+			t.SetBoost(30);
+			q.Add(t, Occur.SHOULD);
+			
+			DisjunctionMaxQuery dm = new DisjunctionMaxQuery(0.2f);
+			dm.Add(Snear(St("w2"), Sor("w5", "zz"), 4, true));
+			dm.Add(qp.Parse("QQ"));
+			dm.Add(qp.Parse("xx yy -zz"));
+			dm.Add(qp.Parse("-xx -w1"));
+			
+			DisjunctionMaxQuery dm2 = new DisjunctionMaxQuery(0.5f);
+			dm2.Add(qp.Parse("w1"));
+			dm2.Add(qp.Parse("w2"));
+			dm2.Add(qp.Parse("w3"));
+			dm.Add(dm2);
+			
+			q.Add(dm, Occur.SHOULD);
+			
+			BooleanQuery b = new BooleanQuery();
+			b.SetMinimumNumberShouldMatch(2);
+			b.Add(Snear("w1", "w2", 1, true), Occur.SHOULD);
+			b.Add(Snear("w2", "w3", 1, true), Occur.SHOULD);
+			b.Add(Snear("w1", "w3", 3, true), Occur.SHOULD);
+			
+			q.Add(b, Occur.SHOULD);
+			
+			Qtest(q, new int[]{0, 1, 2});
+		}
+		
+        [Test]
+		public virtual void  Test2()
+		{
+			
+			BooleanQuery q = new BooleanQuery();
+			
+			q.Add(qp.Parse("\"w1 w2\"~1"), Occur.MUST);
+			q.Add(Snear(St("w2"), Sor("w5", "zz"), 4, true), Occur.SHOULD);
+			q.Add(Snear(Sf("w3", 2), St("w2"), St("w3"), 5, true), Occur.SHOULD);
+			
+			Query t = new FilteredQuery(qp.Parse("xx"), new ItemizedFilter(new int[]{1, 3}));
+			t.SetBoost(1000);
+			q.Add(t, Occur.SHOULD);
+			
+			t = new ConstantScoreQuery(new ItemizedFilter(new int[]{0, 2}));
+			t.SetBoost(- 20.0f);
+			q.Add(t, Occur.SHOULD);
+			
+			DisjunctionMaxQuery dm = new DisjunctionMaxQuery(0.2f);
+			dm.Add(Snear(St("w2"), Sor("w5", "zz"), 4, true));
+			dm.Add(qp.Parse("QQ"));
+			dm.Add(qp.Parse("xx yy -zz"));
+			dm.Add(qp.Parse("-xx -w1"));
+			
+			DisjunctionMaxQuery dm2 = new DisjunctionMaxQuery(0.5f);
+			dm2.Add(qp.Parse("w1"));
+			dm2.Add(qp.Parse("w2"));
+			dm2.Add(qp.Parse("w3"));
+			dm.Add(dm2);
+			
+			q.Add(dm, Occur.SHOULD);
+			
+			BooleanQuery b = new BooleanQuery();
+			b.SetMinimumNumberShouldMatch(2);
+			b.Add(Snear("w1", "w2", 1, true), Occur.SHOULD);
+			b.Add(Snear("w2", "w3", 1, true), Occur.SHOULD);
+			b.Add(Snear("w1", "w3", 3, true), Occur.SHOULD);
+			b.SetBoost(0.0f);
+			
+			q.Add(b, Occur.SHOULD);
+			
+			Qtest(q, new int[]{0, 1, 2});
+		}
+		
+		// :TODO: we really need more crazy complex cases.
+		
+		
+		// //////////////////////////////////////////////////////////////////
+		
+		// The rest of these aren't that complex, but they are <i>somewhat</i>
+		// complex, and they expose weakness in dealing with queries that match
+		// with scores of 0 wrapped in other queries
+		
+        [Test]
+        public virtual void  TestT3()
+		{
+			Bqtest("w1^0.0", new int[]{0, 1, 2, 3});
+		}
+		
+        [Test]
+        public virtual void  TestMA3()
+		{
+			Query q = new MatchAllDocsQuery();
+			q.SetBoost(0);
+			Bqtest(q, new int[]{0, 1, 2, 3});
+		}
+		
+        [Test]
+        public virtual void  TestFQ5()
+		{
+			Bqtest(new FilteredQuery(qp.Parse("xx^0"), new ItemizedFilter(new int[]{1, 3})), new int[]{3});
+		}
+		
+        [Test]
+        public virtual void  TestCSQ4()
+		{
+			Query q = new ConstantScoreQuery(new ItemizedFilter(new int[]{3}));
+			q.SetBoost(0);
+			Bqtest(q, new int[]{3});
+		}
+		
+        [Test]
+        public virtual void  TestDMQ10()
+		{
+			DisjunctionMaxQuery q = new DisjunctionMaxQuery(0.5f);
+			q.Add(qp.Parse("yy w5^100"));
+			q.Add(qp.Parse("xx^0"));
+			q.SetBoost(0.0f);
+			Bqtest(q, new int[]{0, 2, 3});
+		}
+		
+        [Test]
+        public virtual void  TestMPQ7()
+		{
+			MultiPhraseQuery q = new MultiPhraseQuery();
+			q.Add(Ta(new System.String[]{"w1"}));
+			q.Add(Ta(new System.String[]{"w2"}));
+			q.SetSlop(1);
+			q.SetBoost(0.0f);
+			Bqtest(q, new int[]{0, 1, 2});
+		}
+		
+        [Test]
+        public virtual void  TestBQ12()
+		{
+			// NOTE: using qtest not bqtest
+			Qtest("w1 w2^0.0", new int[]{0, 1, 2, 3});
+		}
+
+        [Test]
+        public virtual void  TestBQ13()
+		{
+			// NOTE: using qtest not bqtest
+			Qtest("w1 -w5^0.0", new int[]{1, 2, 3});
+		}
+
+        [Test]
+        public virtual void  TestBQ18()
+		{
+			// NOTE: using qtest not bqtest
+			Qtest("+w1^0.0 w2", new int[]{0, 1, 2, 3});
+		}
+
+        [Test]
+        public virtual void  TestBQ21()
+		{
+			Bqtest("(+w1 w2)^0.0", new int[]{0, 1, 2, 3});
+		}
+
+        [Test]
+        public virtual void  TestBQ22()
+		{
+			Bqtest("(+w1^0.0 w2)^0.0", new int[]{0, 1, 2, 3});
+		}
+		
+        [Test]
+        public virtual void  TestST3()
+		{
+			SpanQuery q = St("w1");
+			q.SetBoost(0);
+			Bqtest(q, new int[]{0, 1, 2, 3});
+		}
+
+        [Test]
+        public virtual void  TestST6()
+		{
+			SpanQuery q = St("xx");
+			q.SetBoost(0);
+			Qtest(q, new int[]{2, 3});
+		}
+		
+        [Test]
+        public virtual void  TestSF3()
+		{
+			SpanQuery q = Sf(("w1"), 1);
+			q.SetBoost(0);
+			Bqtest(q, new int[]{0, 1, 2, 3});
+		}
+
+        [Test]
+        public virtual void  TestSF7()
+		{
+			SpanQuery q = Sf(("xx"), 3);
+			q.SetBoost(0);
+			Bqtest(q, new int[]{2, 3});
+		}
+		
+        [Test]
+        public virtual void  TestSNot3()
+		{
+			SpanQuery q = Snot(Sf("w1", 10), St("QQ"));
+			q.SetBoost(0);
+			Bqtest(q, new int[]{0, 1, 2, 3});
+		}
+		
+        [Test]
+        public virtual void  TestSNot6()
+		{
+			SpanQuery q = Snot(Sf("w1", 10), St("xx"));
+			q.SetBoost(0);
+			Bqtest(q, new int[]{0, 1, 2, 3});
+		}
+		
+        [Test]
+        public virtual void  TestSNot8()
+		{
+			// NOTE: using qtest not bqtest
+			SpanQuery f = Snear("w1", "w3", 10, true);
+			f.SetBoost(0);
+			SpanQuery q = Snot(f, St("xx"));
+			Qtest(q, new int[]{0, 1, 3});
+		}
+
+        [Test]
+        public virtual void  TestSNot9()
+		{
+			// NOTE: using qtest not bqtest
+			SpanQuery t = St("xx");
+			t.SetBoost(0);
+			SpanQuery q = Snot(Snear("w1", "w3", 10, true), t);
+			Qtest(q, new int[]{0, 1, 3});
+		}
+	}
+}
\ No newline at end of file

Added: incubator/lucene.net/trunk/C#/src/Test/Search/TestComplexExplanationsOfNonMatches.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/TestComplexExplanationsOfNonMatches.cs?view=auto&rev=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/TestComplexExplanationsOfNonMatches.cs (added)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/TestComplexExplanationsOfNonMatches.cs Sat Aug 11 09:56:37 2007
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+using NUnit.Framework;
+
+using RAMDirectory = Lucene.Net.Store.RAMDirectory;
+using IndexWriter = Lucene.Net.Index.IndexWriter;
+using IndexReader = Lucene.Net.Index.IndexReader;
+using Term = Lucene.Net.Index.Term;
+using WhitespaceAnalyzer = Lucene.Net.Analysis.WhitespaceAnalyzer;
+using Document = Lucene.Net.Documents.Document;
+using Field = Lucene.Net.Documents.Field;
+using QueryParser = Lucene.Net.QueryParsers.QueryParser;
+using ParseException = Lucene.Net.QueryParsers.ParseException;
+
+namespace Lucene.Net.Search
+{
+	
+	/// <summary> subclass of TestSimpleExplanations that verifies non matches.</summary>
+	public class TestComplexExplanationsOfNonMatches : TestComplexExplanations
+	{
+		
+		/// <summary> Overrides superclass to ignore matches and focus on non-matches
+		/// 
+		/// </summary>
+		/// <seealso cref="CheckHits.checkNoMatchExplanations">
+		/// </seealso>
+		public override void  Qtest(Query q, int[] expDocNrs)
+		{
+			CheckHits.CheckNoMatchExplanations(q, FIELD, searcher, expDocNrs);
+		}
+	}
+}
\ No newline at end of file

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/TestConstantScoreRangeQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/TestConstantScoreRangeQuery.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/TestConstantScoreRangeQuery.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/TestConstantScoreRangeQuery.cs Sat Aug 11 09:56:37 2007
@@ -16,7 +16,9 @@
  */
 
 using System;
+
 using NUnit.Framework;
+
 using WhitespaceAnalyzer = Lucene.Net.Analysis.WhitespaceAnalyzer;
 using Document = Lucene.Net.Documents.Document;
 using Field = Lucene.Net.Documents.Field;
@@ -73,6 +75,11 @@
 		{
 			Assert.AreEqual(e, a, m, SCORE_COMP_THRESH);
 		}
+		
+        static public void  AssertEquals(System.String m, int e, int a)
+        {
+            Assert.AreEqual(e, a, m);
+        }
 		
         [SetUp]
         public virtual void  SetUp()

Modified: incubator/lucene.net/trunk/C#/src/Test/Search/TestCustomSearcherSort.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Search/TestCustomSearcherSort.cs?view=diff&rev=564939&r1=564938&r2=564939
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Search/TestCustomSearcherSort.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Search/TestCustomSearcherSort.cs Sat Aug 11 09:56:37 2007
@@ -16,7 +16,9 @@
  */
 
 using System;
+
 using NUnit.Framework;
+
 using StandardAnalyzer = Lucene.Net.Analysis.Standard.StandardAnalyzer;
 using DateTools = Lucene.Net.Documents.DateTools;
 using Document = Lucene.Net.Documents.Document;



Mime
View raw message