lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r931080 - in /lucene/java/branches/flex_1458: ./ backwards/src/ backwards/src/java/org/apache/lucene/search/ backwards/src/test/org/apache/lucene/analysis/ backwards/src/test/org/apache/lucene/document/ backwards/src/test/org/apache/lucene/...
Date Tue, 06 Apr 2010 10:45:21 GMT
Author: uschindler
Date: Tue Apr  6 10:45:20 2010
New Revision: 931080

URL: http://svn.apache.org/viewvc?rev=931080&view=rev
Log:
Merge flex up to trunk rev 930932

Added:
    lucene/java/branches/flex_1458/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/utils/
      - copied from r930932, lucene/dev/trunk/lucene/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/utils/
    lucene/java/branches/flex_1458/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/utils/TestConfig.java
      - copied unchanged from r930932, lucene/dev/trunk/lucene/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/utils/TestConfig.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestNewestSegment.java
      - copied unchanged from r930932, lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestNewestSegment.java
Removed:
    lucene/java/branches/flex_1458/contrib/spatial/src/test/org/apache/lucene/spatial/tier/PolyShape.java
Modified:
    lucene/java/branches/flex_1458/   (props changed)
    lucene/java/branches/flex_1458/CHANGES.txt
    lucene/java/branches/flex_1458/backwards/src/   (props changed)
    lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java
  (props changed)
    lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java
  (props changed)
    lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/document/TestDateTools.java
  (props changed)
    lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/document/TestNumberTools.java
  (props changed)
    lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
  (props changed)
    lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/util/TestAttributeSource.java
  (props changed)
    lucene/java/branches/flex_1458/build.xml   (props changed)
    lucene/java/branches/flex_1458/contrib/   (props changed)
    lucene/java/branches/flex_1458/contrib/CHANGES.txt   (contents, props changed)
    lucene/java/branches/flex_1458/contrib/benchmark/CHANGES.txt
    lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Config.java
    lucene/java/branches/flex_1458/contrib/highlighter/src/test/   (props changed)
    lucene/java/branches/flex_1458/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java
  (props changed)
    lucene/java/branches/flex_1458/contrib/spatial/src/java/org/apache/lucene/spatial/tier/CartesianPolyFilterBuilder.java
    lucene/java/branches/flex_1458/contrib/spatial/src/java/org/apache/lucene/spatial/tier/DistanceQueryBuilder.java
    lucene/java/branches/flex_1458/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/Tokenizer.java   (props
changed)
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/ByteBlockPool.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocumentsWriter.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexWriter.java
    lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java
  (props changed)
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java
  (props changed)
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/document/TestDateTools.java
  (props changed)
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/document/TestNumberTools.java
  (props changed)
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
  (props changed)
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestByteSlices.java
    lucene/java/branches/flex_1458/src/test/org/apache/lucene/util/TestAttributeSource.java
  (props changed)

Propchange: lucene/java/branches/flex_1458/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr  6 10:45:20 2010
@@ -1,4 +1,4 @@
-/lucene/dev/trunk/lucene:926653,926791,926948-928243,928255
+/lucene/dev/trunk/lucene:926653,926791,926948-928243,928255,928846-930932
 /lucene/java/branches/lucene_2_4:748824
 /lucene/java/branches/lucene_2_9:817269-818600,829134,829881,831036,896850,909334
 /lucene/java/branches/lucene_2_9_back_compat_tests:818601-821336

Modified: lucene/java/branches/flex_1458/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/CHANGES.txt?rev=931080&r1=931079&r2=931080&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/CHANGES.txt (original)
+++ lucene/java/branches/flex_1458/CHANGES.txt Tue Apr  6 10:45:20 2010
@@ -231,6 +231,10 @@ Bug fixes
 * LUCENE-2328: Index files fsync tracking moved from
   IndexWriter/IndexReader to Directory, and it no longer leaks memory.
   (Earwin Burrfoot via Mike McCandless)
+
+* LUCENE-2365: IndexWriter.newestSegment (used normally for testing)
+  is fixed to return null if there are no segments.  (Karthick
+  Sankarachary via Mike McCandless)
   
 New features
 

Propchange: lucene/java/branches/flex_1458/backwards/src/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr  6 10:45:20 2010
@@ -1,4 +1,4 @@
-/lucene/dev/trunk/lucene/backwards/src:926653,926791,926948-928243,928255
+/lucene/dev/trunk/lucene/backwards/src:926653,926791,926948-928243,928255,928846-930932
 /lucene/java/branches/lucene_2_4/src:748824
 /lucene/java/branches/lucene_2_9/src:817269-818600,825998,829134,829881,831036
 /lucene/java/branches/lucene_2_9_back_compat_tests/src:818601-821336

Propchange: lucene/java/branches/flex_1458/backwards/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr  6 10:45:20 2010
@@ -1,4 +1,4 @@
-/lucene/dev/trunk/lucene/backwards/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:926653,926791,926948-928243,928255
+/lucene/dev/trunk/lucene/backwards/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:926653,926791,926948-928243,928255,928846-930932
 /lucene/java/branches/lucene_2_4/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:748824
 /lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:817269-818600,825998,829134,829881,831036
 /lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:818601-821336

Propchange: lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr  6 10:45:20 2010
@@ -1,4 +1,4 @@
-/lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:926653,926791,926948-928243,928255
+/lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:926653,926791,926948-928243,928255,928846-930932
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:748824
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:825998,829134,829881,831036
 /lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080,912383

Propchange: lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/document/TestDateTools.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr  6 10:45:20 2010
@@ -1,4 +1,4 @@
-/lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/document/TestDateTools.java:926653,926791,926948-928243,928255
+/lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/document/TestDateTools.java:926653,926791,926948-928243,928255,928846-930932
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/document/TestDateTools.java:748824
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/document/TestDateTools.java:825998,829134,829881,831036
 /lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/document/TestDateTools.java:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080,912383

Propchange: lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/document/TestNumberTools.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr  6 10:45:20 2010
@@ -1,4 +1,4 @@
-/lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/document/TestNumberTools.java:926653,926791,926948-928243,928255
+/lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/document/TestNumberTools.java:926653,926791,926948-928243,928255,928846-930932
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/document/TestNumberTools.java:748824
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/document/TestNumberTools.java:825998,829134,829881,831036
 /lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/document/TestNumberTools.java:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080,912383

Propchange: lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr  6 10:45:20 2010
@@ -1,4 +1,4 @@
-/lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:926653,926791,926948-928243,928255
+/lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:926653,926791,926948-928243,928255,928846-930932
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:748824
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:825998,829134,829881,831036
 /lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080,912383

Propchange: lucene/java/branches/flex_1458/backwards/src/test/org/apache/lucene/util/TestAttributeSource.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr  6 10:45:20 2010
@@ -1,4 +1,4 @@
-/lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/util/TestAttributeSource.java:926653,926791,926948-928243,928255
+/lucene/dev/trunk/lucene/backwards/src/test/org/apache/lucene/util/TestAttributeSource.java:926653,926791,926948-928243,928255,928846-930932
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/util/TestAttributeSource.java:748824
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/util/TestAttributeSource.java:817269-818600,825998,829134,829881,831036
 /lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/util/TestAttributeSource.java:818601-821336

Propchange: lucene/java/branches/flex_1458/build.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr  6 10:45:20 2010
@@ -1,4 +1,4 @@
-/lucene/dev/trunk/lucene/build.xml:926653,926791,926948-928243,928255
+/lucene/dev/trunk/lucene/build.xml:926653,926791,926948-928243,928255,928846-930932
 /lucene/java/branches/lucene_2_9/build.xml:909334
 /lucene/java/trunk/build.xml:916596,916685,916755,916769,917019,917148,917154,917161,917203-917204,919060,919119,919718,919731,919869,920237-920499,922013,922277,922525,922528,922583,922593,922602,922624,922797,922799,922806,922886-922887,923112,923238,924151,924207,924286,924321-924731,924781,925176-925462
 /lucene/solr/branches/newtrunk/lucene/build.xml:926020-926289

Propchange: lucene/java/branches/flex_1458/contrib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr  6 10:45:20 2010
@@ -1,4 +1,4 @@
-/lucene/dev/trunk/lucene/contrib:926653,926791,926948-928243,928255
+/lucene/dev/trunk/lucene/contrib:926653,926791,926948-928243,928255,928846-930932
 /lucene/java/branches/lucene_2_4/contrib:748824
 /lucene/java/branches/lucene_2_9/contrib:817269-818600,825998,829134,829816,829881,831036,896850,909334
 /lucene/java/branches/lucene_2_9_back_compat_tests/contrib:818601-821336

Modified: lucene/java/branches/flex_1458/contrib/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/CHANGES.txt?rev=931080&r1=931079&r2=931080&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/CHANGES.txt (original)
+++ lucene/java/branches/flex_1458/contrib/CHANGES.txt Tue Apr  6 10:45:20 2010
@@ -57,6 +57,12 @@ Bug fixes
 
  * LUCENE-2277: QueryNodeImpl threw ConcurrentModificationException on 
    add(List<QueryNode>). (Frank Wesemann via Robert Muir)
+
+ * LUCENE-2184: Fixed bug with handling best fit value when the proper best fit value is
+		not an indexed field.  Note, this change affects the APIs. (Grant Ingersoll)
+   
+ * LUCENE-2359: Fix bug in CartesianPolyFilterBuilder related to handling of behavior around
+		the 180th meridian (Grant Ingersoll)
    
 API Changes
 

Propchange: lucene/java/branches/flex_1458/contrib/CHANGES.txt
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr  6 10:45:20 2010
@@ -1,4 +1,4 @@
-/lucene/dev/trunk/lucene/contrib/CHANGES.txt:926653,926791,926948-928243,928255
+/lucene/dev/trunk/lucene/contrib/CHANGES.txt:926653,926791,926948-928243,928255,928846-930932
 /lucene/java/branches/lucene_2_4/contrib/CHANGES.txt:748824
 /lucene/java/branches/lucene_2_9/contrib/CHANGES.txt:817269-818600,825998,826775,829134,829816,829881,831036,896850
 /lucene/java/branches/lucene_2_9_back_compat_tests/contrib/CHANGES.txt:818601-821336

Modified: lucene/java/branches/flex_1458/contrib/benchmark/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/CHANGES.txt?rev=931080&r1=931079&r2=931080&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/CHANGES.txt (original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/CHANGES.txt Tue Apr  6 10:45:20 2010
@@ -2,6 +2,10 @@ Lucene Benchmark Contrib Change Log
 
 The Benchmark contrib package contains code for benchmarking Lucene in a variety of ways.
 
+3/28/2010
+  LUCENE-2353: Fixed bug in Config where Windows absolute path property values 
+  were incorrectly handled (Shai Erera)
+  
 3/24/2010
   LUCENE-2343: Added support for benchmarking collectors. (Grant Ingersoll, Shai Erera)
 

Modified: lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Config.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Config.java?rev=931080&r1=931079&r2=931080&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Config.java
(original)
+++ lucene/java/branches/flex_1458/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/utils/Config.java
Tue Apr  6 10:45:20 2010
@@ -139,6 +139,10 @@ public class Config {
     }
     if (sval.indexOf(":") < 0) {
       return sval;
+    } else if (sval.indexOf(":\\") >= 0 || sval.indexOf(":/") >= 0) {
+      // this previously messed up absolute path names on Windows. Assuming
+      // there is no real value that starts with \ or /
+      return sval;
     }
     // first time this prop is extracted by round
     int k = sval.indexOf(":");

Propchange: lucene/java/branches/flex_1458/contrib/highlighter/src/test/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr  6 10:45:20 2010
@@ -1,4 +1,4 @@
-/lucene/dev/trunk/lucene/contrib/highlighter/src/test:926653,926791,926948-928243,928255
+/lucene/dev/trunk/lucene/contrib/highlighter/src/test:926653,926791,926948-928243,928255,928846-930932
 /lucene/java/branches/lucene_2_4/contrib/highlighter/src/test:748824
 /lucene/java/branches/lucene_2_9/contrib/highlighter/src/test:817269-818600,825998,826775,829134,829816,829881,831036,896850,909334
 /lucene/java/branches/lucene_2_9_back_compat_tests/contrib/highlighter/src/test:818601-821336

Propchange: lucene/java/branches/flex_1458/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr  6 10:45:20 2010
@@ -1,4 +1,4 @@
-/lucene/dev/trunk/lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java:926653,926791,926948-928243,928255
+/lucene/dev/trunk/lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java:926653,926791,926948-928243,928255,928846-930932
 /lucene/java/branches/lucene_2_9/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java:909334
 /lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java:916596,916685,916755,916769,917019,917148,917154,917161,917203-917204,919060,919119,919718,919731,919869,920237-920499,922013,922277,922525,922528,922583,922593,922602,922624,922797,922799,922806,922886-922887,923112,923238,924151,924207,924286,924321-924731,924781,925176-925462
 /lucene/solr/branches/newtrunk/lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java:926020-926289

Modified: lucene/java/branches/flex_1458/contrib/spatial/src/java/org/apache/lucene/spatial/tier/CartesianPolyFilterBuilder.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/spatial/src/java/org/apache/lucene/spatial/tier/CartesianPolyFilterBuilder.java?rev=931080&r1=931079&r2=931080&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/spatial/src/java/org/apache/lucene/spatial/tier/CartesianPolyFilterBuilder.java
(original)
+++ lucene/java/branches/flex_1458/contrib/spatial/src/java/org/apache/lucene/spatial/tier/CartesianPolyFilterBuilder.java
Tue Apr  6 10:45:20 2010
@@ -44,9 +44,18 @@ public class CartesianPolyFilterBuilder 
 
   private IProjector projector = new SinusoidalProjector();
   private final String tierPrefix;
-  
-  public CartesianPolyFilterBuilder( String tierPrefix ) {
+	private int minTier;
+	private int maxTier;
+  /**
+   * 
+   * @param tierPrefix The prefix for the name of the fields containing the tier info
+   * @param minTierIndexed The minimum tier level indexed
+   * @param maxTierIndexed The maximum tier level indexed
+   */
+  public CartesianPolyFilterBuilder( String tierPrefix, int minTierIndexed, int maxTierIndexed
) {
     this.tierPrefix = tierPrefix;
+	this.minTier = minTierIndexed;
+	this.maxTier = maxTierIndexed;
   }
   
   public Shape getBoxShape(double latitude, double longitude, double miles)
@@ -63,11 +72,15 @@ public class CartesianPolyFilterBuilder 
     double longY = ur.getLng();
     double longX = ll.getLng();
     double longX2 = 0.0;
-
+	//These two if checks setup us up to deal with issues around the prime meridian and the
180th meridian
+	//In these two cases, we need to get tiles (tiers) from the lower left up to the meridian
and then 
+	//from the meridan to the upper right
+	//Are we crossing the 180 deg. longitude, if so, we need to do some special things
     if (ur.getLng() < 0.0 && ll.getLng() > 0.0) {
 	longX2 = ll.getLng();
  	longX = -180.0;	
     }
+	//are we crossing the prime meridian (0 degrees)?  If so, we need to account for it and
boxes on both sides
     if (ur.getLng() > 0.0 && ll.getLng() < 0.0) {
 	longX2 = ll.getLng();
  	longX = 0.0;	
@@ -77,6 +90,11 @@ public class CartesianPolyFilterBuilder 
     //System.err.println("getBoxShape:"+latX+"," + longX);
     CartesianTierPlotter ctp = new CartesianTierPlotter(2, projector,tierPrefix);
     int bestFit = ctp.bestFit(miles);
+	if (bestFit < minTier){
+		bestFit = minTier;
+	} else if (bestFit > maxTier){
+		bestFit = maxTier;
+	}
     
     ctp = new CartesianTierPlotter(bestFit, projector,tierPrefix);
     Shape shape = new Shape(ctp.getTierFieldName());
@@ -85,24 +103,27 @@ public class CartesianPolyFilterBuilder 
     // iterate from startX->endX
     //     iterate from startY -> endY
     //      shape.add(currentLat.currentLong);
-
+	//for the edge cases (prime meridian and the 180th meridian), this call handles all tiles
East of the meridian
+    //for all other cases, it handles the whole set of tiles
     shape = getShapeLoop(shape,ctp,latX,longX,latY,longY);
     if (longX2 != 0.0) {
-	if (longX2 != 0.0) {
 		if (longX == 0.0) {
 			longX = longX2;
 			longY = 0.0;
-        		shape = getShapeLoop(shape,ctp,latX,longX,latY,longY);
+	        //handles the lower left longitude to the prime meridian
+	        //shape = getShapeLoop(shape, ctp, latX, longX, latY, longY);
 		} else {
+	        //this clause handles the lower left longitude up to the 180 meridian
 			longX = longX2;
-			longY = -180.0;
-        		shape = getShapeLoop(shape,ctp,latY,longY,latX,longX);
+	        longY = 180.0;
 		}
-	}
+	      shape = getShapeLoop(shape, ctp, latX, longX, latY, longY);
+
         //System.err.println("getBoxShape2:"+latY+"," + longY);
         //System.err.println("getBoxShape2:"+latX+"," + longX);
     }
  
+ 
     return shape; 
   } 
   
@@ -113,7 +134,11 @@ public class CartesianPolyFilterBuilder 
     //System.err.println("getShapeLoop:"+latX+"," + longX);
     double beginAt = ctp.getTierBoxId(latX, longX);
     double endAt = ctp.getTierBoxId(latY, longY);
-    
+    if (beginAt > endAt){
+	      double tmp = beginAt;
+	      beginAt = endAt;
+	      endAt = tmp;
+	}
     double tierVert = ctp.getTierVerticalPosDivider();
     //System.err.println(" | "+ beginAt+" | "+ endAt);
     

Modified: lucene/java/branches/flex_1458/contrib/spatial/src/java/org/apache/lucene/spatial/tier/DistanceQueryBuilder.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/spatial/src/java/org/apache/lucene/spatial/tier/DistanceQueryBuilder.java?rev=931080&r1=931079&r2=931080&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/spatial/src/java/org/apache/lucene/spatial/tier/DistanceQueryBuilder.java
(original)
+++ lucene/java/branches/flex_1458/contrib/spatial/src/java/org/apache/lucene/spatial/tier/DistanceQueryBuilder.java
Tue Apr  6 10:45:20 2010
@@ -44,18 +44,24 @@ public class DistanceQueryBuilder {
    * a boundary box wrapper around a more precise
    * DistanceFilter.
    * 
-   * @param lat
-   * @param lng
-   * @param miles
+   * @param lat The latitude to search around
+   * @param lng the Longitude to search around
+   * @param miles The radius to search within
+   * @param latField The name of the field containing the latitude
+   * @param lngField The name of the field containing the longitude
+   * @param tierFieldPrefix The prefix of the tier
+   * @param needPrecise if true, then distance is calculated in addition to tier info
+   * @param minTierIndexed The minimum tier level indexed
+   * @param maxTierIndexed The maximum tier level indexed
    */
   public DistanceQueryBuilder (double lat, double lng, double miles, 
-      String latField, String lngField, String tierFieldPrefix, boolean needPrecise) {
+      String latField, String lngField, String tierFieldPrefix, boolean needPrecise, int
minTierIndexed, int maxTierIndexed) {
 
     this.lat = lat;
     this.lng = lng;
     this.miles = miles;
     
-    CartesianPolyFilterBuilder cpf = new CartesianPolyFilterBuilder(tierFieldPrefix);
+    CartesianPolyFilterBuilder cpf = new CartesianPolyFilterBuilder(tierFieldPrefix, minTierIndexed,
maxTierIndexed);
     Filter cartesianFilter = cpf.getBoundingArea(lat, lng, miles);
 
     /* create precise distance filter */
@@ -77,13 +83,13 @@ public class DistanceQueryBuilder {
    * @param miles
    */
   public DistanceQueryBuilder (double lat, double lng, double miles, 
-      String geoHashFieldPrefix, String tierFieldPrefix, boolean needPrecise){
+      String geoHashFieldPrefix, String tierFieldPrefix, boolean needPrecise,  int minTierIndexed,
int maxTierIndexed){
 
     this.lat = lat;
     this.lng = lng;
     this.miles = miles;
     
-    CartesianPolyFilterBuilder cpf = new CartesianPolyFilterBuilder(tierFieldPrefix);
+    CartesianPolyFilterBuilder cpf = new CartesianPolyFilterBuilder(tierFieldPrefix, minTierIndexed,
maxTierIndexed);
     Filter cartesianFilter = cpf.getBoundingArea(lat, lng, miles);
 
     /* create precise distance filter */

Modified: lucene/java/branches/flex_1458/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java?rev=931080&r1=931079&r2=931080&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java
(original)
+++ lucene/java/branches/flex_1458/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java
Tue Apr  6 10:45:20 2010
@@ -138,6 +138,7 @@ public class TestCartesian extends Lucen
     addPoint(writer,"Hilton Washington Embassy Row",38.9103000,-77.0451000);
     addPoint(writer,"HorseFeathers, Bar & Grill", 39.01220000000001, -77.3942);
     addPoint(writer,"Marshall Island Airfield",7.06, 171.2);
+    addPoint(writer, "Wonga Wongue Reserve, Gabon", -0.546562,9.459229);
     addPoint(writer,"Midway Island",25.7, -171.7);
     addPoint(writer,"North Pole Way",55.0, 4.0);
    
@@ -162,19 +163,48 @@ public class TestCartesian extends Lucen
     assertEquals(3474.331719997617, miles); 
   }
 
+  /*public void testCartesianPolyFilterBuilder() throws Exception {
+    CartesianPolyFilterBuilder cpfb = new CartesianPolyFilterBuilder(CartesianTierPlotter.DEFALT_FIELD_PREFIX,
2, 15);
+    //try out some shapes
+    final double miles = 20.0;
+        // Hawaii
+        // 2300 miles to Marshall Island Airfield
+    //Hawaii to Midway is 911 miles
+    lat = 0;
+    lng = -179.9;
+    Shape shape;
+    shape = cpfb.getBoxShape(lat, lng, miles);
+    System.out.println("Tier: " + shape.getTierLevel());
+    System.out.println("area: " + shape.getArea().size());
+    lat = 30;
+    lng = -100;
+    shape = cpfb.getBoxShape(lat, lng, miles);
+    System.out.println("Tier: " + shape.getTierLevel());
+    System.out.println("area: " + shape.getArea().size());
+
+    lat = 30;
+    lng = 100;
+    shape = cpfb.getBoxShape(lat, lng, miles);
+    System.out.println("Tier: " + shape.getTierLevel());
+    System.out.println("area: " + shape.getArea().size());
+  }
+*/
+
+
   public void testAntiM() throws IOException, InvalidGeoException {
     searcher = new IndexSearcher(directory, true);
 
     final double miles = 2800.0;
         // Hawaii
         // 2300 miles to Marshall Island Airfield
+    //Hawaii to Midway is 911 miles
     lat = 21.6032207;
     lng = -158.0;
 
     if (VERBOSE) System.out.println("testAntiM");
     // create a distance query
     final DistanceQueryBuilder dq = new DistanceQueryBuilder(lat, lng, miles,
-        latField, lngField, CartesianTierPlotter.DEFALT_FIELD_PREFIX, true);
+        latField, lngField, CartesianTierPlotter.DEFALT_FIELD_PREFIX, true, 2, 15);
 
     if (VERBOSE) System.out.println(dq);
     //create a term query to search against all documents
@@ -269,7 +299,7 @@ public class TestCartesian extends Lucen
 
     // create a distance query
     final DistanceQueryBuilder dq = new DistanceQueryBuilder(lat, lng, miles,
-        latField, lngField, CartesianTierPlotter.DEFALT_FIELD_PREFIX, true);
+        latField, lngField, CartesianTierPlotter.DEFALT_FIELD_PREFIX, true, 2, 15);
 
     if (VERBOSE) System.out.println(dq);
     //create a term query to search against all documents
@@ -366,7 +396,7 @@ public class TestCartesian extends Lucen
     
       // create a distance query
       final DistanceQueryBuilder dq = new DistanceQueryBuilder(lat, lng, miles, 
-                                                               latField, lngField, CartesianTierPlotter.DEFALT_FIELD_PREFIX,
true);
+                                                               latField, lngField, CartesianTierPlotter.DEFALT_FIELD_PREFIX,
true, 2, 15);
      
       if (VERBOSE) System.out.println(dq);
       //create a term query to search against all documents
@@ -461,7 +491,7 @@ public class TestCartesian extends Lucen
 	    
       // create a distance query
       final DistanceQueryBuilder dq = new DistanceQueryBuilder(lat, lng, miles, 
-                                                               geoHashPrefix, CartesianTierPlotter.DEFALT_FIELD_PREFIX,
true);
+                                                               geoHashPrefix, CartesianTierPlotter.DEFALT_FIELD_PREFIX,
true, 2, 15);
 	     
       if (VERBOSE) System.out.println(dq);
       //create a term query to search against all documents

Propchange: lucene/java/branches/flex_1458/src/java/org/apache/lucene/analysis/Tokenizer.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr  6 10:45:20 2010
@@ -1,4 +1,4 @@
-/lucene/dev/trunk/lucene/src/java/org/apache/lucene/analysis/Tokenizer.java:926653,926791,926948-928243,928255
+/lucene/dev/trunk/lucene/src/java/org/apache/lucene/analysis/Tokenizer.java:926653,926791,926948-928243,928255,928846-930932
 /lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/analysis/Tokenizer.java:909334
 /lucene/java/trunk/src/java/org/apache/lucene/analysis/Tokenizer.java:916596,916685,916755,916769,917019,917148,917154,917161,917203-917204,919060,919119,919718,919731,919869,920237-920499,922013,922277,922525,922528,922583,922593,922602,922624,922797,922799,922806,922886-922887,923112,923238,924151,924207,924286,924321-924731,924781,925176-925462
 /lucene/solr/branches/newtrunk/lucene/src/java/org/apache/lucene/analysis/Tokenizer.java:926020-926289

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/ByteBlockPool.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/ByteBlockPool.java?rev=931080&r1=931079&r2=931080&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/ByteBlockPool.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/ByteBlockPool.java Tue
Apr  6 10:45:20 2010
@@ -35,6 +35,7 @@ package org.apache.lucene.index;
 
 import java.util.Arrays;
 import org.apache.lucene.util.BytesRef;
+import java.util.List;
 import static org.apache.lucene.util.RamUsageEstimator.NUM_BYTES_OBJECT_REF;
 import org.apache.lucene.util.ArrayUtil;
 
@@ -42,6 +43,7 @@ final class ByteBlockPool {
 
   abstract static class Allocator {
     abstract void recycleByteBlocks(byte[][] blocks, int start, int end);
+    abstract void recycleByteBlocks(List<byte[]> blocks);
     abstract byte[] getByteBlock(boolean trackAllocations);
   }
 

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocumentsWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocumentsWriter.java?rev=931080&r1=931079&r2=931080&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocumentsWriter.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/DocumentsWriter.java Tue
Apr  6 10:45:20 2010
@@ -209,8 +209,7 @@ final class DocumentsWriter {
         // Recycle the blocks
         final int blockCount = buffers.size();
         
-        final byte[][] blocks = buffers.toArray( new byte[blockCount][] );
-        perDocAllocator.recycleByteBlocks(blocks, 0, blockCount);
+        perDocAllocator.recycleByteBlocks(buffers);
         buffers.clear();
         sizeInBytes = 0;
         
@@ -1321,6 +1320,15 @@ final class DocumentsWriter {
           freeByteBlocks.add(blocks[i]);
       }
     }
+
+    @Override
+    void recycleByteBlocks(List<byte[]> blocks) {
+      synchronized(DocumentsWriter.this) {
+        final int size = blocks.size();
+        for(int i=0;i<size;i++)
+          freeByteBlocks.add(blocks.get(i));
+  }
+    }
   }
 
   /* Initial chunks size of the shared int[] blocks used to

Modified: lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexWriter.java?rev=931080&r1=931079&r2=931080&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexWriter.java (original)
+++ lucene/java/branches/flex_1458/src/java/org/apache/lucene/index/IndexWriter.java Tue Apr
 6 10:45:20 2010
@@ -4607,7 +4607,7 @@ public class IndexWriter implements Clos
 
   // utility routines for tests
   SegmentInfo newestSegment() {
-    return segmentInfos.info(segmentInfos.size()-1);
+    return segmentInfos.size() > 0 ? segmentInfos.info(segmentInfos.size()-1) : null;
   }
 
   public synchronized String segString() {

Propchange: lucene/java/branches/flex_1458/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr  6 10:45:20 2010
@@ -1,4 +1,4 @@
-/lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:926653,926791,926948-928243,928255
+/lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:926653,926791,926948-928243,928255,928846-930932
 /lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:909334
 /lucene/java/trunk/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:916596,916685,916755,916769,917019,917148,917154,917161,917203-917204,919060,919119,919718,919731,919869,920237-920499,922013,922277,922525,922528,922583,922593,922602,922624,922797,922799,922806,922886-922887,923112,923238,924151,924207,924286,924321-924731,924781,925176-925462
 /lucene/solr/branches/newtrunk/lucene/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:926020-926289

Propchange: lucene/java/branches/flex_1458/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr  6 10:45:20 2010
@@ -1,4 +1,4 @@
-/lucene/dev/trunk/lucene/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:926653,926791,926948-928243,928255
+/lucene/dev/trunk/lucene/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:926653,926791,926948-928243,928255,928846-930932
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:748824
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:829134,829881,831036,896850,909334
 /lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:880793,896906

Propchange: lucene/java/branches/flex_1458/src/test/org/apache/lucene/document/TestDateTools.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr  6 10:45:20 2010
@@ -1,4 +1,4 @@
-/lucene/dev/trunk/lucene/src/test/org/apache/lucene/document/TestDateTools.java:926653,926791,926948-928243,928255
+/lucene/dev/trunk/lucene/src/test/org/apache/lucene/document/TestDateTools.java:926653,926791,926948-928243,928255,928846-930932
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/document/TestDateTools.java:748824
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/document/TestDateTools.java:829134,829881,831036,896850,909334
 /lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/document/TestDateTools.java:880793,896906

Propchange: lucene/java/branches/flex_1458/src/test/org/apache/lucene/document/TestNumberTools.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr  6 10:45:20 2010
@@ -1,4 +1,4 @@
-/lucene/dev/trunk/lucene/src/test/org/apache/lucene/document/TestNumberTools.java:926653,926791,926948-928243,928255
+/lucene/dev/trunk/lucene/src/test/org/apache/lucene/document/TestNumberTools.java:926653,926791,926948-928243,928255,928846-930932
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/document/TestNumberTools.java:748824
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/document/TestNumberTools.java:829134,829881,831036,896850,909334
 /lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/document/TestNumberTools.java:880793,896906

Propchange: lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr  6 10:45:20 2010
@@ -1,4 +1,4 @@
-/lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:926653,926791,926948-928243,928255
+/lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:926653,926791,926948-928243,928255,928846-930932
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:748824
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:829134,829881,831036,896850,909334
 /lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:880793,896906,928290

Modified: lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestByteSlices.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestByteSlices.java?rev=931080&r1=931079&r2=931080&view=diff
==============================================================================
--- lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestByteSlices.java (original)
+++ lucene/java/branches/flex_1458/src/test/org/apache/lucene/index/TestByteSlices.java Tue
Apr  6 10:45:20 2010
@@ -16,6 +16,7 @@ package org.apache.lucene.index;
 
 import java.util.Random;
 import java.util.ArrayList;
+import java.util.List;
 import org.apache.lucene.util.LuceneTestCase;
 
 public class TestByteSlices extends LuceneTestCase {
@@ -41,6 +42,13 @@ public class TestByteSlices extends Luce
       for(int i=start;i<end;i++)
         freeByteBlocks.add(blocks[i]);
     }
+
+    @Override
+    synchronized void recycleByteBlocks(List<byte[]> blocks) {
+      final int size = blocks.size();
+      for(int i=0;i<size;i++)
+        freeByteBlocks.add(blocks.get(i));
+  }
   }
 
   public void testBasic() throws Throwable {

Propchange: lucene/java/branches/flex_1458/src/test/org/apache/lucene/util/TestAttributeSource.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr  6 10:45:20 2010
@@ -1,4 +1,4 @@
-/lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/TestAttributeSource.java:926653,926791,926948-928243,928255
+/lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/TestAttributeSource.java:926653,926791,926948-928243,928255,928846-930932
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/util/TestAttributeSource.java:909334
 /lucene/java/trunk/src/test/org/apache/lucene/util/TestAttributeSource.java:916596,916685,916755,916769,917019,917148,917154,917161,917203-917204,919060,919119,919718,919731,919869,920237-920499,922013,922277,922525,922528,922583,922593,922602,922624,922797,922799,922806,922886-922887,923112,923238,924151,924207,924286,924321-924731,924781,925176-925462
 /lucene/solr/branches/newtrunk/lucene/src/test/org/apache/lucene/util/TestAttributeSource.java:926020-926289



Mime
View raw message