@@ -42,6 +42,8 @@ public abstract class AbstractGeoBucketAggregationIntegTest extends GeoModulePlu
42
42
43
43
protected static final int MAX_PRECISION_FOR_GEO_SHAPES_AGG_TESTING = 4 ;
44
44
45
+ protected static final int MIN_PRECISION_WITHOUT_BB_AGGS = 2 ;
46
+
45
47
protected static final int NUM_DOCS = 100 ;
46
48
47
49
protected static final String GEO_SHAPE_INDEX_NAME = "geoshape_index" ;
@@ -88,14 +90,13 @@ protected void prepareGeoShapeIndexForAggregations(final Random random) throws E
88
90
final Geometry geometry = RandomGeoGeometryGenerator .randomGeometry (random );
89
91
final GeoShapeDocValue geometryDocValue = GeoShapeDocValue .createGeometryDocValue (geometry );
90
92
// make sure that there is 1 shape is intersecting with the bounding box
91
- if (!isShapeIntersectingBB ) {
92
- isShapeIntersectingBB = geometryDocValue .isIntersectingRectangle (boundingRectangleForGeoShapesAgg );
93
- if (!isShapeIntersectingBB && i == NUM_DOCS - 1 ) {
94
- continue ;
95
- }
93
+ isShapeIntersectingBB = geometryDocValue .isIntersectingRectangle (boundingRectangleForGeoShapesAgg );
94
+ if (!isShapeIntersectingBB && i == NUM_DOCS - 1 ) {
95
+ continue ;
96
96
}
97
+
97
98
i ++;
98
- final Set <String > values = generateBucketsForGeometry (geometry , geometryDocValue );
99
+ final Set <String > values = generateBucketsForGeometry (geometry , geometryDocValue , isShapeIntersectingBB );
99
100
geoshapes .add (indexGeoShape (GEO_SHAPE_INDEX_NAME , geometry ));
100
101
for (final String hash : values ) {
101
102
expectedDocsCountForGeoShapes .put (hash , expectedDocsCountForGeoShapes .getOrDefault (hash , 0 ) + 1 );
@@ -109,11 +110,14 @@ protected void prepareGeoShapeIndexForAggregations(final Random random) throws E
109
110
* Returns a set of buckets for the shape at different precision level. Override this method for different bucket
110
111
* aggregations.
111
112
*
112
- * @param geometry {@link Geometry}
113
- * @param geoShapeDocValue {@link GeoShapeDocValue}
113
+ * @param geometry {@link Geometry}
114
+ * @param geoShapeDocValue {@link GeoShapeDocValue}
115
+ * @param intersectingWithBB boolean
114
116
* @return A {@link Set} of {@link String} which represents the buckets.
115
117
*/
116
- protected abstract Set <String > generateBucketsForGeometry (final Geometry geometry , final GeoShapeDocValue geoShapeDocValue );
118
+ protected abstract Set <String > generateBucketsForGeometry (final Geometry geometry ,
119
+ final GeoShapeDocValue geoShapeDocValue ,
120
+ final boolean intersectingWithBB );
117
121
118
122
/**
119
123
* Prepares a GeoPoint index for testing the GeoPoint bucket aggregations. Different bucket aggregations can use
0 commit comments