lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject svn commit: r1375253 - in /incubator/lucene.net/trunk/src/contrib/Spatial: BBox/BBoxStrategy.cs Prefix/PrefixTreeStrategy.cs SpatialStrategy.cs Vector/TwoDoublesStrategy.cs
Date Mon, 20 Aug 2012 21:49:56 GMT
Author: synhershko
Date: Mon Aug 20 21:49:55 2012
New Revision: 1375253

URL: http://svn.apache.org/viewvc?rev=1375253&view=rev
Log:
LUCENE-4192 remove spatial isPolyField and createField

Modified:
    incubator/lucene.net/trunk/src/contrib/Spatial/BBox/BBoxStrategy.cs
    incubator/lucene.net/trunk/src/contrib/Spatial/Prefix/PrefixTreeStrategy.cs
    incubator/lucene.net/trunk/src/contrib/Spatial/SpatialStrategy.cs
    incubator/lucene.net/trunk/src/contrib/Spatial/Vector/TwoDoublesStrategy.cs

Modified: incubator/lucene.net/trunk/src/contrib/Spatial/BBox/BBoxStrategy.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/contrib/Spatial/BBox/BBoxStrategy.cs?rev=1375253&r1=1375252&r2=1375253&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/contrib/Spatial/BBox/BBoxStrategy.cs (original)
+++ incubator/lucene.net/trunk/src/contrib/Spatial/BBox/BBoxStrategy.cs Mon Aug 20 21:49:55
2012
@@ -70,7 +70,7 @@ namespace Lucene.Net.Spatial.BBox
 		// Indexing
 		//---------------------------------
 
-		public override Field CreateField(Shape shape)
+		public override AbstractField[] CreateIndexableFields(Shape shape)
 		{
 			throw new NotImplementedException();
 		}

Modified: incubator/lucene.net/trunk/src/contrib/Spatial/Prefix/PrefixTreeStrategy.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/contrib/Spatial/Prefix/PrefixTreeStrategy.cs?rev=1375253&r1=1375252&r2=1375253&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/contrib/Spatial/Prefix/PrefixTreeStrategy.cs (original)
+++ incubator/lucene.net/trunk/src/contrib/Spatial/Prefix/PrefixTreeStrategy.cs Mon Aug 20
21:49:55 2012
@@ -61,7 +61,7 @@ namespace Lucene.Net.Spatial.Prefix
 			this.distErrPct = distErrPct;
 		}
 
-		public override Field CreateField(Shape shape)
+		public override AbstractField[] CreateIndexableFields(Shape shape)
 		{
 			int detailLevel = grid.GetMaxLevelForPrecision(shape, distErrPct);
 			var cells = grid.GetNodes(shape, detailLevel, true);//true=intermediates cells
@@ -78,7 +78,7 @@ namespace Lucene.Net.Spatial.Prefix
 			//TODO is CellTokenStream supposed to be re-used somehow? see Uwe's comments:
 			//  http://code.google.com/p/lucene-spatial-playground/issues/detail?id=4
 
-			return new Field(GetFieldName(), new CellTokenStream(cells.GetEnumerator())) {OmitNorms
= true};
+			return new AbstractField[] {new Field(GetFieldName(), new CellTokenStream(cells.GetEnumerator()))
{OmitNorms = true}};
 		}
 
 		/// <summary>

Modified: incubator/lucene.net/trunk/src/contrib/Spatial/SpatialStrategy.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/contrib/Spatial/SpatialStrategy.cs?rev=1375253&r1=1375252&r2=1375253&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/contrib/Spatial/SpatialStrategy.cs (original)
+++ incubator/lucene.net/trunk/src/contrib/Spatial/SpatialStrategy.cs Mon Aug 20 21:49:55
2012
@@ -59,12 +59,6 @@ namespace Lucene.Net.Spatial
 			return ctx;
 		}
 
-		/** Corresponds with Solr's  FieldType.isPolyField(). */
-		public virtual bool IsPolyField()
-		{
-			return false;
-		}
-
 		/// <summary>
 		/// The name of the field or the prefix of them if there are multiple
 		/// fields needed internally.
@@ -76,18 +70,9 @@ namespace Lucene.Net.Spatial
 		}
 
 		/// <summary>
-		/// Corresponds with Solr's FieldType.createField().
-		/// 
-		/// This may return a null field if it does not want to make anything.
-		/// This is reasonable behavior if 'ignoreIncompatibleGeometry=true' and the
-		/// geometry is incompatible
-		/// </summary>
-		/// <param name="shape"></param>
-		/// <returns></returns>
-		public abstract Field CreateField(Shape shape);
-
-		/// <summary>
-		/// Corresponds with Solr's FieldType.createFields().
+		/// Returns the IndexableField(s) from the <code>shape</code> that are to be
+		/// added to the {@link org.apache.lucene.document.Document}.  These fields
+		/// are expected to be marked as indexed and not stored.
 		/// <p/>
 		/// Note: If you want to <i>store</i> the shape as a string for retrieval in
search
 		/// results, you could add it like this:
@@ -96,11 +81,8 @@ namespace Lucene.Net.Spatial
 		/// doesn't use it.
 		/// </summary>
 		/// <param name="shape"></param>
-		/// <returns></returns>
-		public virtual AbstractField[] CreateFields(Shape shape)
-		{
-			return new AbstractField[] { CreateField(shape) };
-		}
+		/// <returns>Not null nor will it have null elements.</returns>
+		public abstract AbstractField[] CreateIndexableFields(Shape shape);
 
 		public AbstractField CreateStoredField(Shape shape)
 		{

Modified: incubator/lucene.net/trunk/src/contrib/Spatial/Vector/TwoDoublesStrategy.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/contrib/Spatial/Vector/TwoDoublesStrategy.cs?rev=1375253&r1=1375252&r2=1375253&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/contrib/Spatial/Vector/TwoDoublesStrategy.cs (original)
+++ incubator/lucene.net/trunk/src/contrib/Spatial/Vector/TwoDoublesStrategy.cs Mon Aug 20
21:49:55 2012
@@ -61,12 +61,7 @@ namespace Lucene.Net.Spatial.Vector
 			return fieldNameY;
 		}
 
-		public override bool IsPolyField()
-		{
-			return true;
-		}
-
-		public override AbstractField[] CreateFields(Shape shape)
+		public override AbstractField[] CreateIndexableFields(Shape shape)
 		{
 			var point = shape as Point;
 			if (point != null)
@@ -92,11 +87,6 @@ namespace Lucene.Net.Spatial.Vector
 			return new AbstractField[0]; // nothing (solr does not support null) 
 		}
 
-		public override Field CreateField(Shape shape)
-		{
-			throw new InvalidOperationException("Point is poly field");
-		}
-
 		public override ValueSource MakeValueSource(SpatialArgs args)
 		{
 			Point p = args.GetShape().GetCenter();



Mime
View raw message