lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject svn commit: r1388921 - in /lucene.net/trunk: src/contrib/Spatial/Util/ValueSourceFilter.cs src/contrib/Spatial/Vector/DistanceValueSource.cs test/contrib/Spatial/PortedSolr3Test.cs test/contrib/Spatial/StrategyTestCase.cs
Date Sat, 22 Sep 2012 23:06:01 GMT
Author: synhershko
Date: Sat Sep 22 23:06:01 2012
New Revision: 1388921

URL: http://svn.apache.org/viewvc?rev=1388921&view=rev
Log:
Minor

Modified:
    lucene.net/trunk/src/contrib/Spatial/Util/ValueSourceFilter.cs
    lucene.net/trunk/src/contrib/Spatial/Vector/DistanceValueSource.cs
    lucene.net/trunk/test/contrib/Spatial/PortedSolr3Test.cs
    lucene.net/trunk/test/contrib/Spatial/StrategyTestCase.cs

Modified: lucene.net/trunk/src/contrib/Spatial/Util/ValueSourceFilter.cs
URL: http://svn.apache.org/viewvc/lucene.net/trunk/src/contrib/Spatial/Util/ValueSourceFilter.cs?rev=1388921&r1=1388920&r2=1388921&view=diff
==============================================================================
--- lucene.net/trunk/src/contrib/Spatial/Util/ValueSourceFilter.cs (original)
+++ lucene.net/trunk/src/contrib/Spatial/Util/ValueSourceFilter.cs Sat Sep 22 23:06:01 2012
@@ -27,27 +27,8 @@ namespace Lucene.Net.Spatial.Util
     /// </summary>
 	public class ValueSourceFilter : Filter
 	{
-		public class ValueSourceFilteredDocIdSet : FilteredDocIdSet
-		{
-			private readonly ValueSourceFilter enclosingFilter;
-			private readonly DocValues values;
-
-			public ValueSourceFilteredDocIdSet(DocIdSet innerSet, DocValues values, ValueSourceFilter
caller) : base(innerSet)
-			{
-				this.enclosingFilter = caller;
-				this.values = values;
-			}
-
-			public override bool Match(int docid)
-			{
-				double val = values.DoubleVal(docid);
-				return val >= enclosingFilter.min && val <= enclosingFilter.max;
-			}
-		}
-
 		readonly Filter startingFilter;
 		readonly ValueSource source;
-
 		public readonly double min;
 		public readonly double max;
 
@@ -68,5 +49,24 @@ namespace Lucene.Net.Spatial.Util
 			var values = source.GetValues(reader);
 			return new ValueSourceFilteredDocIdSet(startingFilter.GetDocIdSet(reader), values, this);
 		}
+
+        public class ValueSourceFilteredDocIdSet : FilteredDocIdSet
+        {
+            private readonly ValueSourceFilter enclosingFilter;
+            private readonly DocValues values;
+
+            public ValueSourceFilteredDocIdSet(DocIdSet innerSet, DocValues values, ValueSourceFilter
caller)
+                : base(innerSet)
+            {
+                this.enclosingFilter = caller;
+                this.values = values;
+            }
+
+            public override bool Match(int doc)
+            {
+                double val = values.DoubleVal(doc);
+                return val >= enclosingFilter.min && val <= enclosingFilter.max;
+            }
+        }
 	}
 }

Modified: lucene.net/trunk/src/contrib/Spatial/Vector/DistanceValueSource.cs
URL: http://svn.apache.org/viewvc/lucene.net/trunk/src/contrib/Spatial/Vector/DistanceValueSource.cs?rev=1388921&r1=1388920&r2=1388921&view=diff
==============================================================================
--- lucene.net/trunk/src/contrib/Spatial/Vector/DistanceValueSource.cs (original)
+++ lucene.net/trunk/src/contrib/Spatial/Vector/DistanceValueSource.cs Sat Sep 22 23:06:01
2012
@@ -76,7 +76,7 @@ namespace Lucene.Net.Spatial.Vector
 				if (validX.Get(doc))
 				{
 				    Debug.Assert(validY.Get(doc));
-					return calculator.Distance(enclosingInstance.from, ptX[doc], ptY[doc]);
+					return calculator.Distance(from, ptX[doc], ptY[doc]);
 				}
 				return nullValue;
 			}

Modified: lucene.net/trunk/test/contrib/Spatial/PortedSolr3Test.cs
URL: http://svn.apache.org/viewvc/lucene.net/trunk/test/contrib/Spatial/PortedSolr3Test.cs?rev=1388921&r1=1388920&r2=1388921&view=diff
==============================================================================
--- lucene.net/trunk/test/contrib/Spatial/PortedSolr3Test.cs (original)
+++ lucene.net/trunk/test/contrib/Spatial/PortedSolr3Test.cs Sat Sep 22 23:06:01 2012
@@ -34,7 +34,6 @@ namespace Lucene.Net.Contrib.Spatial.Tes
    /**
 	* Based off of Solr 3's SpatialFilterTest.
 	*/
-
     public class PortedSolr3Test : StrategyTestCase
     {
         public class TestValuesProvider

Modified: lucene.net/trunk/test/contrib/Spatial/StrategyTestCase.cs
URL: http://svn.apache.org/viewvc/lucene.net/trunk/test/contrib/Spatial/StrategyTestCase.cs?rev=1388921&r1=1388920&r2=1388921&view=diff
==============================================================================
--- lucene.net/trunk/test/contrib/Spatial/StrategyTestCase.cs (original)
+++ lucene.net/trunk/test/contrib/Spatial/StrategyTestCase.cs Sat Sep 22 23:06:01 2012
@@ -56,9 +56,18 @@ namespace Lucene.Net.Contrib.Spatial.Tes
         protected SpatialContext ctx;
         protected bool storeShape = true;
 
+        [TearDown]
+        public override void TearDown()
+        {
+            base.TearDown();
+            ctx = null;
+            strategy = null;
+            storeShape = true;
+        }
+
         protected void executeQueries(SpatialMatchConcern concern, params String[] testQueryFile)
         {
-            Console.WriteLine("testing queries for strategy " + strategy);
+            Console.WriteLine("testing queries for strategy " + strategy + ". Executer: "
+ GetType().Name);
             foreach (String path in testQueryFile)
             {
                 IEnumerator<SpatialTestQuery> testQueryIterator = getTestQueries(path,
ctx);



Mime
View raw message