lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsmi...@apache.org
Subject svn commit: r1382639 - in /lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial: SpatialStrategy.java prefix/PrefixTreeStrategy.java vector/TwoDoublesStrategy.java
Date Mon, 10 Sep 2012 04:46:14 GMT
Author: dsmiley
Date: Mon Sep 10 04:46:14 2012
New Revision: 1382639

URL: http://svn.apache.org/viewvc?rev=1382639&view=rev
Log:
Aligning with trunk: SpatialStrategy.createFields() returns Field not IndexableField

Modified:
    lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/SpatialStrategy.java
    lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/PrefixTreeStrategy.java
    lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/vector/TwoDoublesStrategy.java

Modified: lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/SpatialStrategy.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/SpatialStrategy.java?rev=1382639&r1=1382638&r2=1382639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/SpatialStrategy.java
(original)
+++ lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/SpatialStrategy.java
Mon Sep 10 04:46:14 2012
@@ -19,6 +19,7 @@ package org.apache.lucene.spatial;
 
 import com.spatial4j.core.context.SpatialContext;
 import com.spatial4j.core.shape.Shape;
+import org.apache.lucene.document.Field;
 import org.apache.lucene.index.IndexableField;
 import org.apache.lucene.queries.function.FunctionQuery;
 import org.apache.lucene.queries.function.ValueSource;
@@ -97,7 +98,7 @@ public abstract class SpatialStrategy {
    *
    * @return Not null nor will it have null elements.
    */
-  public abstract IndexableField[] createIndexableFields(Shape shape);
+  public abstract Field[] createIndexableFields(Shape shape);
 
   /**
    * The value source yields a number that is proportional to the distance between the query
shape and indexed data.

Modified: lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/PrefixTreeStrategy.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/PrefixTreeStrategy.java?rev=1382639&r1=1382638&r2=1382639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/PrefixTreeStrategy.java
(original)
+++ lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/PrefixTreeStrategy.java
Mon Sep 10 04:46:14 2012
@@ -71,12 +71,12 @@ public abstract class PrefixTreeStrategy
   }
 
   @Override
-  public IndexableField[] createIndexableFields(Shape shape) {
+  public Field[] createIndexableFields(Shape shape) {
     double distErr = SpatialArgs.calcDistanceFromErrPct(shape, distErrPct, ctx);
     return createIndexableFields(shape, distErr);
   }
 
-  public IndexableField[] createIndexableFields(Shape shape, double distErr) {
+  public Field[] createIndexableFields(Shape shape, double distErr) {
     int detailLevel = grid.getLevelForDistance(distErr);
     List<Node> cells = grid.getNodes(shape, detailLevel, true);//true=intermediates
cells
     //If shape isn't a point, add a full-resolution center-point so that
@@ -92,7 +92,7 @@ public abstract class PrefixTreeStrategy
     //  http://code.google.com/p/lucene-spatial-playground/issues/detail?id=4
 
     Field field = new Field(getFieldName(), new CellTokenStream(cells.iterator()), FIELD_TYPE);
-    return new IndexableField[]{field};
+    return new Field[]{field};
   }
 
   /* Indexed, tokenized, not stored. */

Modified: lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/vector/TwoDoublesStrategy.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/vector/TwoDoublesStrategy.java?rev=1382639&r1=1382638&r2=1382639&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/vector/TwoDoublesStrategy.java
(original)
+++ lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/vector/TwoDoublesStrategy.java
Mon Sep 10 04:46:14 2012
@@ -24,6 +24,7 @@ import com.spatial4j.core.shape.Point;
 import com.spatial4j.core.shape.Rectangle;
 import com.spatial4j.core.shape.Shape;
 import org.apache.lucene.document.DoubleField;
+import org.apache.lucene.document.Field;
 import org.apache.lucene.document.FieldType;
 import org.apache.lucene.index.IndexableField;
 import org.apache.lucene.queries.function.FunctionQuery;
@@ -77,12 +78,12 @@ public class TwoDoublesStrategy extends 
   }
 
   @Override
-  public IndexableField[] createIndexableFields(Shape shape) {
+  public Field[] createIndexableFields(Shape shape) {
     if( shape instanceof Point ) {
       Point point = (Point)shape;
       FieldType doubleFieldType = new FieldType(DoubleField.TYPE_NOT_STORED);
       doubleFieldType.setNumericPrecisionStep(precisionStep);
-      IndexableField[] f = new IndexableField[2];
+      Field[] f = new Field[2];
       f[0] = new DoubleField(fieldNameX, point.getX(), doubleFieldType);
       f[1] = new DoubleField(fieldNameY, point.getY(), doubleFieldType);
       return f;
@@ -90,7 +91,7 @@ public class TwoDoublesStrategy extends 
     if( !ignoreIncompatibleGeometry ) {
       throw new IllegalArgumentException( "TwoDoublesStrategy can not index: "+shape );
     }
-    return new IndexableField[0]; // nothing (solr does not support null)
+    return new Field[0]; // nothing (solr does not support null)
   }
 
   @Override



Mime
View raw message