Skip to content

Upgrade Lucene 8.5 to latest snapshot #52520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion buildSrc/version.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
elasticsearch = 8.0.0
lucene = 8.5.0-snapshot-d62f6307658
lucene = 8.5.0-snapshot-b01d7cb

bundled_jdk_vendor = adoptopenjdk
bundled_jdk = 13.0.2+8
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b3d969d1d63fe9500fe5308b1a0c60d84d7bfa92

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void testDefaults() throws Exception {
IndexableField[] fields = doc.rootDoc().getFields("field");
assertEquals(2, fields.length);
IndexableField pointField = fields[0];
assertEquals(1, pointField.fieldType().pointDataDimensionCount());
assertEquals(1, pointField.fieldType().pointDimensionCount());
assertFalse(pointField.fieldType().stored());
assertEquals(1230, pointField.numericValue().longValue());
IndexableField dvField = fields[1];
Expand Down Expand Up @@ -151,7 +151,7 @@ public void testNoDocValues() throws Exception {
IndexableField[] fields = doc.rootDoc().getFields("field");
assertEquals(1, fields.length);
IndexableField pointField = fields[0];
assertEquals(1, pointField.fieldType().pointDataDimensionCount());
assertEquals(1, pointField.fieldType().pointDimensionCount());
assertEquals(1230, pointField.numericValue().longValue());
}

Expand All @@ -175,7 +175,7 @@ public void testStore() throws Exception {
IndexableField[] fields = doc.rootDoc().getFields("field");
assertEquals(3, fields.length);
IndexableField pointField = fields[0];
assertEquals(1, pointField.fieldType().pointDataDimensionCount());
assertEquals(1, pointField.fieldType().pointDimensionCount());
assertEquals(1230, pointField.numericValue().doubleValue(), 0d);
IndexableField dvField = fields[1];
assertEquals(DocValuesType.SORTED_NUMERIC, dvField.fieldType().docValuesType());
Expand Down Expand Up @@ -204,7 +204,7 @@ public void testCoerce() throws Exception {
IndexableField[] fields = doc.rootDoc().getFields("field");
assertEquals(2, fields.length);
IndexableField pointField = fields[0];
assertEquals(1, pointField.fieldType().pointDataDimensionCount());
assertEquals(1, pointField.fieldType().pointDimensionCount());
assertEquals(1230, pointField.numericValue().longValue());
IndexableField dvField = fields[1];
assertEquals(DocValuesType.SORTED_NUMERIC, dvField.fieldType().docValuesType());
Expand Down Expand Up @@ -319,7 +319,7 @@ public void testNullValue() throws IOException {
IndexableField[] fields = doc.rootDoc().getFields("field");
assertEquals(2, fields.length);
IndexableField pointField = fields[0];
assertEquals(1, pointField.fieldType().pointDataDimensionCount());
assertEquals(1, pointField.fieldType().pointDimensionCount());
assertFalse(pointField.fieldType().stored());
assertEquals(25, pointField.numericValue().longValue());
IndexableField dvField = fields[1];
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d81b8f0ecdc67ba74049e65702582fcb8b605cfd

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
13e9fd71cb3992b148728fe4884b7a6d0e26ee78

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
58638e06cd1221b1d4de01705882922936ad69c9

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
346c87ed2ef2c6af49a434c568635a50cce64f2e

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
82ab2570c88053439912c5de5ed81cbe4337e450

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ef0703ff5dc1b704ea3e58596b91e4b08c326d4c

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9cf8ce62436a3768e18c431cf3be43f5e2672b24

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4d358d392a9825c1502499d0a649730208f03777

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
17a0b6597c5bbe6cc2fc6d46003cdf9bc937c593

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9c54e267bfa2cd1ef904dc6e35b38bbedda4c4b1

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a14fb545a10fcead07fbb0d801fdebce88192211

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
25314c94f5cbcd8e360b74fb9980fc42e3641c94

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
efe41313b6733a0d2764052972c4e27a7ca7636f

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
f19fb11eb40f9d1bf77272de1cbd8c83e6463829

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4295e60e1079c32dc19d1b070db3e62e04f07232

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1555f90440c10250e084d36c27e0da0b760d0296

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4fd374ffc3ec3c82d62d0811d78b044833a8dfa1

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9e47dbe97818dd6caccf03e2ead6282d5e86bd3c

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bb9fa551d6d0929d5fd37c524c8c284de3f6786e

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
28c935b5eb84a85ac24432c8c630fa4b47f5fd54

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
25089b0f516df58e95f345504607853e7ba0a35d

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ protected final void failIfNoDocValues() {
}

protected final void failIfNotIndexed() {
if (indexOptions() == IndexOptions.NONE && pointDataDimensionCount() == 0) {
if (indexOptions() == IndexOptions.NONE && pointDimensionCount() == 0) {
// we throw an IAE rather than an ISE so that it translates to a 4xx code rather than 5xx code on the http layer
throw new IllegalArgumentException("Cannot search on field [" + name() + "] since it is not indexed.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ private RewriteCachingLeafReader(LeafReader original) throws IOException {
if (pointValues != null) { // might not be in this reader
byte[] minPackedValue = pointValues.getMinPackedValue();
byte[] maxPackedValue = pointValues.getMaxPackedValue();
int numDimensions = pointValues.getNumIndexDimensions();
int numIndexDimensions = pointValues.getNumIndexDimensions();
int bytesPerDimension = pointValues.getBytesPerDimension();
int numDataDimensions = pointValues.getNumDataDimensions();
int numDimensions = pointValues.getNumDimensions();
long size = pointValues.size();
int docCount = pointValues.getDocCount();
valuesMap.put(info.name, new PointValues() {
Expand All @@ -141,13 +141,13 @@ public byte[] getMaxPackedValue() {
}

@Override
public int getNumDataDimensions() {
return numDataDimensions;
public int getNumDimensions() {
return numDimensions;
}

@Override
public int getNumIndexDimensions() {
return numDimensions;
return numIndexDimensions;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ public static XYPolygon nextPolygon() {
private static XYPolygon trianglePolygon(XYRectangle box) {
final float[] polyX = new float[4];
final float[] polyY = new float[4];
polyX[0] = (float)box.minX;
polyY[0] = (float)box.minY;
polyX[1] = (float)box.minX;
polyY[1] = (float)box.minY;
polyX[2] = (float)box.minX;
polyY[2] = (float)box.minY;
polyX[3] = (float)box.minX;
polyY[3] = (float)box.minY;
polyX[0] = box.minX;
polyY[0] = box.minY;
polyX[1] = box.minX;
polyY[1] = box.minY;
polyX[2] = box.minX;
polyY[2] = box.minY;
polyX[3] = box.minX;
polyY[3] = box.minY;
return new XYPolygon(polyX, polyY);
}

Expand All @@ -75,26 +75,26 @@ public static XYRectangle nextBox() {

private static XYRectangle nextBoxInternal() {
// prevent lines instead of boxes
double x0 = nextDouble();
double x1 = nextDouble();
float x0 = nextFloat();
float x1 = nextFloat();
while (x0 == x1) {
x1 = nextDouble();
x1 = nextFloat();
}
// prevent lines instead of boxes
double y0 = nextDouble();
double y1 = nextDouble();
float y0 = nextFloat();
float y1 = nextFloat();
while (y0 == y1) {
y1 = nextDouble();
y1 = nextFloat();
}

if (x1 < x0) {
double x = x0;
float x = x0;
x0 = x1;
x1 = x;
}

if (y1 < y0) {
double y = y0;
float y = y0;
y0 = y1;
y1 = y;
}
Expand All @@ -105,16 +105,16 @@ private static XYRectangle nextBoxInternal() {
private static XYPolygon boxPolygon(XYRectangle box) {
final float[] polyX = new float[5];
final float[] polyY = new float[5];
polyX[0] = (float)box.minX;
polyY[0] = (float)box.minY;
polyX[1] = (float)box.minX;
polyY[1] = (float)box.minY;
polyX[2] = (float)box.minX;
polyY[2] = (float)box.minY;
polyX[3] = (float)box.minX;
polyY[3] = (float)box.minY;
polyX[4] = (float)box.minX;
polyY[4] = (float)box.minY;
polyX[0] = box.minX;
polyY[0] = box.minY;
polyX[1] = box.minX;
polyY[1] = box.minY;
polyX[2] = box.minX;
polyY[2] = box.minY;
polyX[3] = box.minX;
polyY[3] = box.minY;
polyX[4] = box.minX;
polyY[4] = box.minY;
return new XYPolygon(polyX, polyY);
}

Expand Down Expand Up @@ -201,6 +201,10 @@ public static double nextDouble() {
return BiasedNumbers.randomDoubleBetween(random(), -Float.MAX_VALUE, Float.MAX_VALUE);
}

public static float nextFloat() {
return BiasedNumbers.randomFloatBetween(random(), -Float.MAX_VALUE, Float.MAX_VALUE);
}

/** Keep it simple, we don't need to take arbitrary Random for geo tests */
private static Random random() {
return RandomizedContext.current().getRandom();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,22 @@ public static Polygon randomPolygon(boolean hasAlt) {
List<LinearRing> holes = new ArrayList<>();
for (int i = 0; i < lucenePolygon.numHoles(); i++) {
XYPolygon poly = luceneHoles[i];
holes.add(linearRing(poly.getPolyX(), poly.getPolyY(), hasAlt));
holes.add(linearRing(floatsToDoubles(poly.getPolyX()), floatsToDoubles(poly.getPolyY()), hasAlt));
}
return new Polygon(linearRing(lucenePolygon.getPolyX(), lucenePolygon.getPolyY(), hasAlt), holes);
return new Polygon(linearRing(floatsToDoubles(lucenePolygon.getPolyX()), floatsToDoubles(lucenePolygon.getPolyY()), hasAlt),
holes);
}
return new Polygon(linearRing(lucenePolygon.getPolyX(), lucenePolygon.getPolyY(), hasAlt));
return new Polygon(linearRing(floatsToDoubles(lucenePolygon.getPolyX()), floatsToDoubles(lucenePolygon.getPolyY()), hasAlt));
}

static double[] floatsToDoubles(float[] f) {
double[] d = new double[f.length];
for (int i = 0; i < f.length; i++) {
d[i] = f[i];
}
return d;
}


public static Rectangle randomRectangle() {
org.apache.lucene.geo.XYRectangle rectangle = XShapeTestUtil.nextBox();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9c54e267bfa2cd1ef904dc6e35b38bbedda4c4b1

This file was deleted.