mirror of
https://github.com/apache/lucene.git
synced 2025-02-08 02:58:58 +00:00
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-9244: Adjust TestLucene60PointsFormat#testEstimatePointCount2Dims so it does not fail when a point
|
||||
is shared by multiple leaves. (Ignacio Vera)
|
||||
|
||||
======================= Lucene 8.5.0 =======================
|
||||
|
||||
API Changes
|
||||
|
@ -299,12 +299,13 @@ public class TestLucene60PointsFormat extends BasePointsFormatTestCase {
|
||||
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);
|
||||
assertTrue(""+pointCount,
|
||||
pointCount == (actualMaxPointsInLeafNode + 1) / 2 || // common case
|
||||
pointCount == 2*((actualMaxPointsInLeafNode + 1) / 2)); // if the point is a split value
|
||||
// The number of matches needs to be multiple of count per leaf
|
||||
final long countPerLeaf = (actualMaxPointsInLeafNode + 1) / 2;
|
||||
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);
|
||||
if (multiValues) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user