You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ds...@apache.org on 2012/09/22 23:15:32 UTC

svn commit: r1388900 - in /lucene/dev/trunk: lucene/spatial/src/java/org/apache/lucene/spatial/vector/ lucene/spatial/src/test/org/apache/lucene/spatial/ lucene/spatial/src/test/org/apache/lucene/spatial/vector/ lucene/tools/junit4/ solr/core/src/java/...

Author: dsmiley
Date: Sat Sep 22 21:15:31 2012
New Revision: 1388900

URL: http://svn.apache.org/viewvc?rev=1388900&view=rev
Log:
LUCENE-4374 Rename TwoDoubles to PointVector

Added:
    lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/vector/PointVectorStrategy.java
      - copied, changed from r1388872, lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/vector/TwoDoublesStrategy.java
    lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/vector/TestPointVectorStrategy.java
      - copied, changed from r1388872, lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/vector/TestTwoDoublesStrategy.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/SpatialPointVectorFieldType.java
      - copied, changed from r1388852, lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/SpatialTwoDoublesFieldType.java
Removed:
    lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/vector/TwoDoublesStrategy.java
    lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/vector/TestTwoDoublesStrategy.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/SpatialTwoDoublesFieldType.java
Modified:
    lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/vector/DistanceValueSource.java
    lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/DistanceStrategyTest.java
    lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/PortedSolr3Test.java
    lucene/dev/trunk/lucene/tools/junit4/cached-timehints.txt
    lucene/dev/trunk/solr/core/src/test-files/solr/collection1/conf/schema-spatial.xml
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial.java

Modified: lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/vector/DistanceValueSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/vector/DistanceValueSource.java?rev=1388900&r1=1388899&r2=1388900&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/vector/DistanceValueSource.java (original)
+++ lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/vector/DistanceValueSource.java Sat Sep 22 21:15:31 2012
@@ -36,13 +36,13 @@ import java.util.Map;
  */
 public class DistanceValueSource extends ValueSource {
 
-  private TwoDoublesStrategy strategy;
+  private PointVectorStrategy strategy;
   private final Point from;
 
   /**
    * Constructor.
    */
-  public DistanceValueSource(TwoDoublesStrategy strategy, Point from) {
+  public DistanceValueSource(PointVectorStrategy strategy, Point from) {
     this.strategy = strategy;
     this.from = from;
   }

Copied: lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/vector/PointVectorStrategy.java (from r1388872, lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/vector/TwoDoublesStrategy.java)
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/vector/PointVectorStrategy.java?p2=lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/vector/PointVectorStrategy.java&p1=lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/vector/TwoDoublesStrategy.java&r1=1388872&r2=1388900&rev=1388900&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/vector/TwoDoublesStrategy.java (original)
+++ lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/vector/PointVectorStrategy.java Sat Sep 22 21:15:31 2012
@@ -55,7 +55,7 @@ import org.apache.lucene.spatial.util.Va
  *
  * @lucene.experimental
  */
-public class TwoDoublesStrategy extends SpatialStrategy {
+public class PointVectorStrategy extends SpatialStrategy {
 
   public static final String SUFFIX_X = "__x";
   public static final String SUFFIX_Y = "__y";
@@ -65,7 +65,7 @@ public class TwoDoublesStrategy extends 
 
   public int precisionStep = 8; // same as solr default
 
-  public TwoDoublesStrategy(SpatialContext ctx, String fieldNamePrefix) {
+  public PointVectorStrategy(SpatialContext ctx, String fieldNamePrefix) {
     super(ctx, fieldNamePrefix);
     this.fieldNameX = fieldNamePrefix+SUFFIX_X;
     this.fieldNameY = fieldNamePrefix+SUFFIX_Y;

Modified: lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/DistanceStrategyTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/DistanceStrategyTest.java?rev=1388900&r1=1388899&r2=1388900&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/DistanceStrategyTest.java (original)
+++ lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/DistanceStrategyTest.java Sat Sep 22 21:15:31 2012
@@ -29,7 +29,7 @@ import org.apache.lucene.spatial.prefix.
 import org.apache.lucene.spatial.prefix.tree.GeohashPrefixTree;
 import org.apache.lucene.spatial.prefix.tree.QuadPrefixTree;
 import org.apache.lucene.spatial.prefix.tree.SpatialPrefixTree;
-import org.apache.lucene.spatial.vector.TwoDoublesStrategy;
+import org.apache.lucene.spatial.vector.PointVectorStrategy;
 import org.junit.Test;
 
 import java.io.IOException;
@@ -54,7 +54,7 @@ public class DistanceStrategyTest extend
     strategy = new TermQueryPrefixTreeStrategy(grid, "termquery_geohash");
     ctorArgs.add(new Object[]{new Param(strategy)});
 
-    strategy = new TwoDoublesStrategy(ctx, "twodoubles");
+    strategy = new PointVectorStrategy(ctx, "pointvector");
     ctorArgs.add(new Object[]{new Param(strategy)});
 
     strategy = new BBoxStrategy(ctx, "bbox");

Modified: lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/PortedSolr3Test.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/PortedSolr3Test.java?rev=1388900&r1=1388899&r2=1388900&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/PortedSolr3Test.java (original)
+++ lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/PortedSolr3Test.java Sat Sep 22 21:15:31 2012
@@ -34,7 +34,7 @@ import org.apache.lucene.spatial.prefix.
 import org.apache.lucene.spatial.prefix.tree.SpatialPrefixTree;
 import org.apache.lucene.spatial.query.SpatialArgs;
 import org.apache.lucene.spatial.query.SpatialOperation;
-import org.apache.lucene.spatial.vector.TwoDoublesStrategy;
+import org.apache.lucene.spatial.vector.PointVectorStrategy;
 import org.junit.Test;
 
 import java.io.IOException;
@@ -68,7 +68,7 @@ public class PortedSolr3Test extends Str
     strategy = new TermQueryPrefixTreeStrategy(grid, "termquery_geohash");
     ctorArgs.add(new Object[]{new Param(strategy)});
 
-    strategy = new TwoDoublesStrategy(ctx, "twodoubles");
+    strategy = new PointVectorStrategy(ctx, "pointvector");
     ctorArgs.add(new Object[]{new Param(strategy)});
 
     return ctorArgs;

Copied: lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/vector/TestPointVectorStrategy.java (from r1388872, lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/vector/TestTwoDoublesStrategy.java)
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/vector/TestPointVectorStrategy.java?p2=lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/vector/TestPointVectorStrategy.java&p1=lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/vector/TestTwoDoublesStrategy.java&r1=1388872&r2=1388900&rev=1388900&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/vector/TestTwoDoublesStrategy.java (original)
+++ lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/vector/TestPointVectorStrategy.java Sat Sep 22 21:15:31 2012
@@ -30,14 +30,14 @@ import org.junit.Test;
 
 import java.io.IOException;
 
-public class TestTwoDoublesStrategy extends StrategyTestCase {
+public class TestPointVectorStrategy extends StrategyTestCase {
 
   @Before
   @Override
   public void setUp() throws Exception {
     super.setUp();
     this.ctx = SpatialContext.GEO;
-    this.strategy = new TwoDoublesStrategy(ctx, getClass().getSimpleName());
+    this.strategy = new PointVectorStrategy(ctx, getClass().getSimpleName());
   }
 
   @Test

Modified: lucene/dev/trunk/lucene/tools/junit4/cached-timehints.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/tools/junit4/cached-timehints.txt?rev=1388900&r1=1388899&r2=1388900&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/tools/junit4/cached-timehints.txt (original)
+++ lucene/dev/trunk/lucene/tools/junit4/cached-timehints.txt Sat Sep 22 21:15:31 2012
@@ -561,7 +561,7 @@ org.apache.lucene.spatial.prefix.TestRec
 org.apache.lucene.spatial.prefix.TestSpatialPrefixField=36,285,194,52,200,213,199,280,201,233,195,81,202,289,209,35,249,225
 org.apache.lucene.spatial.prefix.TestTermQueryPrefixGridStrategy=381,94,60,568,93,81,60,98,77,94,262,506,127,82,82,422,84,108
 org.apache.lucene.spatial.prefix.tree.SpatialPrefixTreeTest=239,52,50,201,72,41,59,56,58,50,75,243,50,58,75,285,66,59
-org.apache.lucene.spatial.vector.TestTwoDoublesStrategy=3717,3129,2399,2794,3135,3154,2813,3657,2500,3682,3621,3363,3430,2567,3481,2450,3663,3450
+org.apache.lucene.spatial.vector.TestPointVectorStrategy=3717,3129,2399,2794,3135,3154,2813,3657,2500,3682,3621,3363,3430,2567,3481,2450,3663,3450
 org.apache.lucene.store.TestBufferedIndexInput=1663,1777,1692,2301,2365,1896,2247,3707,1837,2544,1663,1823,2109,2229,1991,2361,1768,2452
 org.apache.lucene.store.TestByteArrayDataInput=29,52,205,56,65,39,49,23,57,40,48,38,29,33,56,29,56,31
 org.apache.lucene.store.TestCopyBytes=265,380,414,338,340,339,428,647,315,399,291,232,398,468,730,1265,514,323

Copied: lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/SpatialPointVectorFieldType.java (from r1388852, lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/SpatialTwoDoublesFieldType.java)
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/SpatialPointVectorFieldType.java?p2=lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/SpatialPointVectorFieldType.java&p1=lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/SpatialTwoDoublesFieldType.java&r1=1388852&r2=1388900&rev=1388900&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/SpatialTwoDoublesFieldType.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/SpatialPointVectorFieldType.java Sat Sep 22 21:15:31 2012
@@ -17,14 +17,14 @@ package org.apache.solr.schema;
  * limitations under the License.
  */
 
-import org.apache.lucene.spatial.vector.TwoDoublesStrategy;
+import org.apache.lucene.spatial.vector.PointVectorStrategy;
 
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
 
-public class SpatialTwoDoublesFieldType extends AbstractSpatialFieldType<TwoDoublesStrategy> implements SchemaAware {
+public class SpatialPointVectorFieldType extends AbstractSpatialFieldType<PointVectorStrategy> implements SchemaAware {
 
   protected String numberFieldName = "tdouble";//in example schema defaults to non-zero precision step -- a good choice
   private int precisionStep;
@@ -58,8 +58,8 @@ public class SpatialTwoDoublesFieldType 
     for( SchemaField sf : schema.getFields().values() ) {
       if( sf.getType() == this ) {
         String name = sf.getName();
-        newFields.add(new SchemaField(name + TwoDoublesStrategy.SUFFIX_X, fieldType, p, null));
-        newFields.add(new SchemaField(name + TwoDoublesStrategy.SUFFIX_Y, fieldType, p, null));
+        newFields.add(new SchemaField(name + PointVectorStrategy.SUFFIX_X, fieldType, p, null));
+        newFields.add(new SchemaField(name + PointVectorStrategy.SUFFIX_Y, fieldType, p, null));
       }
     }
     for (SchemaField newField : newFields) {
@@ -68,8 +68,8 @@ public class SpatialTwoDoublesFieldType 
   }
 
   @Override
-  protected TwoDoublesStrategy newSpatialStrategy(String fieldName) {
-    TwoDoublesStrategy strategy = new TwoDoublesStrategy(ctx, fieldName);
+  protected PointVectorStrategy newSpatialStrategy(String fieldName) {
+    PointVectorStrategy strategy = new PointVectorStrategy(ctx, fieldName);
     strategy.setPrecisionStep(precisionStep);
     return strategy;
   }

Modified: lucene/dev/trunk/solr/core/src/test-files/solr/collection1/conf/schema-spatial.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test-files/solr/collection1/conf/schema-spatial.xml?rev=1388900&r1=1388899&r2=1388900&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test-files/solr/collection1/conf/schema-spatial.xml (original)
+++ lucene/dev/trunk/solr/core/src/test-files/solr/collection1/conf/schema-spatial.xml Sat Sep 22 21:15:31 2012
@@ -41,7 +41,7 @@
     <fieldType name="stqpt_u"  class="solr.SpatialTermQueryPrefixTreeFieldType"
         geo="false" distCalculator="cartesian^2" worldBounds="0 0 1000 1000" units="degrees"/>
 
-    <fieldType name="twodoubles" class="solr.SpatialTwoDoublesFieldType"
+    <fieldType name="pointVector" class="solr.SpatialPointVectorFieldType"
                numberType="tdouble" units="degrees"/>
 
   </types>
@@ -54,7 +54,7 @@
     <field name="srpt_geohash" type="srpt_geohash" multiValued="true" />
     <field name="srpt_quad" type="srpt_quad" multiValued="true" />
     <field name="stqpt_geohash" type="stqpt_geohash" multiValued="true" />
-    <field name="twodoubles" type="twodoubles" />
+    <field name="pointvector" type="pointvector" />
 
   </fields>
 

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial.java?rev=1388900&r1=1388899&r2=1388900&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial.java Sat Sep 22 21:15:31 2012
@@ -43,7 +43,7 @@ public class TestSolr4Spatial extends So
   @ParametersFactory
   public static Iterable<Object[]> parameters() {
     return Arrays.asList(new Object[][]{
-        {"srpt_geohash"}, {"srpt_quad"}, {"stqpt_geohash"}, {"twodoubles"}
+        {"srpt_geohash"}, {"srpt_quad"}, {"stqpt_geohash"}, {"pointvector"}
     });
   }
 
@@ -262,7 +262,7 @@ public class TestSolr4Spatial extends So
 
   @Test
   public void testSortMultiVal() throws Exception {
-    RandomizedTest.assumeFalse("Multivalue not supported for this field", fieldName.equals("twodoubles"));
+    RandomizedTest.assumeFalse("Multivalue not supported for this field", fieldName.equals("pointvector"));
 
     assertU(adoc("id", "100", fieldName, "1,2"));//1 point
     assertU(adoc("id", "101", fieldName, "4,-1", fieldName, "3,5"));//2 points, 2nd is pretty close to query point