mirror of https://github.com/apache/lucene.git
LUCENE-9244: In 2D, a point can be shared by four leaves (#1279)
Adjust TestLucene60PointsFormat#testEstimatePointCount2Dims so it does not fail when a point is shared by multiple leaves
This commit is contained in:
parent
9b6e072909
commit
f018c4c813
|
@ -174,6 +174,9 @@ Other
|
||||||
|
|
||||||
* LUCENE-9275: Make TestLatLonMultiPolygonShapeQueries more resilient for CONTAINS queries. (Ignacio Vera)
|
* LUCENE-9275: Make TestLatLonMultiPolygonShapeQueries more resilient for CONTAINS queries. (Ignacio Vera)
|
||||||
|
|
||||||
|
* LUCENE-9244: Adjust TestLucene60PointsFormat#testEstimatePointCount2Dims so it does not fail when a point
|
||||||
|
is shared by multiple leaves. (Ignacio Vera)
|
||||||
|
|
||||||
======================= Lucene 8.5.0 =======================
|
======================= Lucene 8.5.0 =======================
|
||||||
|
|
||||||
API Changes
|
API Changes
|
||||||
|
|
|
@ -299,12 +299,13 @@ public class TestLucene60PointsFormat extends BasePointsFormatTestCase {
|
||||||
return Relation.CELL_CROSSES_QUERY;
|
return Relation.CELL_CROSSES_QUERY;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// If only one point matches, then the point count is (actualMaxPointsInLeafNode + 1) / 2
|
|
||||||
// in general, or maybe 2x that if the point is a split value
|
|
||||||
final long pointCount = points.estimatePointCount(onePointMatchVisitor);
|
final long pointCount = points.estimatePointCount(onePointMatchVisitor);
|
||||||
assertTrue(""+pointCount,
|
// The number of matches needs to be multiple of count per leaf
|
||||||
pointCount == (actualMaxPointsInLeafNode + 1) / 2 || // common case
|
final long countPerLeaf = (actualMaxPointsInLeafNode + 1) / 2;
|
||||||
pointCount == 2*((actualMaxPointsInLeafNode + 1) / 2)); // if the point is a split value
|
assertTrue(""+pointCount, pointCount % countPerLeaf == 0);
|
||||||
|
// in extreme cases, a point can be be shared by 4 leaves
|
||||||
|
assertTrue(""+pointCount, pointCount / countPerLeaf <= 4 && pointCount / countPerLeaf >= 1);
|
||||||
|
|
||||||
final long docCount = points.estimateDocCount(onePointMatchVisitor);
|
final long docCount = points.estimateDocCount(onePointMatchVisitor);
|
||||||
if (multiValues) {
|
if (multiValues) {
|
||||||
|
|
Loading…
Reference in New Issue