Skip to content

Commit edd7749

Browse files
authored
Upgrade to lucene-9.5.0-snapshot-d19c3e2e0ed (#92957)
9.5 will include several changes related to vector search. An extensive list is available at https://github.com/apache/lucene/milestone/4 .
1 parent 6ff081b commit edd7749

File tree

59 files changed

+3657
-2089
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+3657
-2089
lines changed

build-tools-internal/version.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
elasticsearch = 8.7.0
2-
lucene = 9.4.2
2+
lucene = 9.5.0-snapshot-d19c3e2e0ed
33

44
bundled_jdk_vendor = openjdk
55
bundled_jdk = 19.0.1+10@afdd2e245b014143b62ccb916125e3ce
@@ -21,12 +21,12 @@ netty = 4.1.86.Final
2121

2222
commons_lang3 = 3.9
2323

24+
antlr4 = 4.11.1
2425
# when updating this version, you need to ensure compatibility with:
2526
# - modules/ingest-attachment (transitive dependency, check the upstream POM)
2627
# - distribution/tools/plugin-cli
2728
# - x-pack/plugin/security
2829
bouncycastle=1.64
29-
3030
# used by security and idp (need to be in sync due to cross-dependency in testing)
3131
opensaml = 4.0.1
3232

distribution/src/config/jvm.options

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,6 @@
7373

7474
## GC logging
7575
-Xlog:gc*,gc+age=trace,safepoint:file=@loggc@:utctime,level,pid,tags:filecount=32,filesize=64m
76+
77+
# temporarily disable the Panama-based MMapDirectory
78+
-Dorg.apache.lucene.store.MMapDirectory.enableMemorySegments=false

docs/Versions.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
include::{docs-root}/shared/versions/stack/{source_branch}.asciidoc[]
33

4-
:lucene_version: 9.4.2
5-
:lucene_version_path: 9_4_2
4+
:lucene_version: 9.5.0
5+
:lucene_version_path: 9_5_0
66
:jdk: 11.0.2
77
:jdk_major: 11
88
:build_type: tar

docs/changelog/92957.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 92957
2+
summary: Upgrade to lucene-9.5.0-snapshot-d19c3e2e0ed
3+
area: Search
4+
type: upgrade
5+
issues: []

gradle/verification-metadata.xml

Lines changed: 254 additions & 81 deletions
Large diffs are not rendered by default.

libs/h3/src/test/java/org/elasticsearch/h3/ParentChildNavigationTests.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import com.carrotsearch.randomizedtesting.generators.RandomPicks;
2222

2323
import org.apache.lucene.geo.Point;
24-
import org.apache.lucene.spatial3d.geom.GeoArea;
2524
import org.apache.lucene.spatial3d.geom.GeoPoint;
2625
import org.apache.lucene.spatial3d.geom.GeoPolygon;
2726
import org.apache.lucene.spatial3d.geom.GeoPolygonFactory;
@@ -133,23 +132,13 @@ private void assertHexRing(int res, String h3Address, String[] children) {
133132
public void testNoChildrenIntersecting() {
134133
String[] h3Addresses = H3.getStringRes0Cells();
135134
String h3Address = RandomPicks.randomFrom(random(), h3Addresses);
136-
// Once testIssue91915 is fixed, put upper limit of the loop to H3.MAX_H3_RES
137-
for (int i = 1; i <= 10; i++) {
135+
for (int i = 1; i <= H3.MAX_H3_RES; i++) {
138136
h3Addresses = H3.h3ToChildren(h3Address);
139137
assertIntersectingChildren(h3Address, h3Addresses);
140138
h3Address = RandomPicks.randomFrom(random(), h3Addresses);
141139
}
142140
}
143141

144-
public void testIssue91915() {
145-
GeoPolygon polygon1 = getGeoPolygon("8ec82ea0650155f");
146-
GeoPolygon polygon2 = getGeoPolygon("8ec82ea06501447");
147-
// these polygons are disjoint but due to https://github.com/apache/lucene/issues/11883
148-
// they are reported as intersects. Once this is fixed this test will fail, we should adjust
149-
// testNoChildrenIntersecting
150-
assertEquals("see https://github.com/elastic/elasticsearch/issues/91915", GeoArea.OVERLAPS, polygon1.getRelationship(polygon2));
151-
}
152-
153142
private void assertIntersectingChildren(String h3Address, String[] children) {
154143
int size = H3.h3ToNotIntersectingChildrenSize(h3Address);
155144
for (int i = 0; i < size; i++) {

libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentBuilder.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,22 @@ public XContentBuilder value(byte value) throws IOException {
435435
return this;
436436
}
437437

438+
public XContentBuilder array(String name, byte[] values) throws IOException {
439+
return field(name).values(values);
440+
}
441+
442+
private XContentBuilder values(byte[] values) throws IOException {
443+
if (values == null) {
444+
return nullValue();
445+
}
446+
startArray();
447+
for (byte b : values) {
448+
value(b);
449+
}
450+
endArray();
451+
return this;
452+
}
453+
438454
////////////////////////////////////////////////////////////////////////////
439455
// Double
440456
//////////////////////////////////

modules/lang-expression/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ esplugin {
1717
dependencies {
1818
api "org.apache.lucene:lucene-expressions:${versions.lucene}"
1919
runtimeOnly "org.apache.lucene:lucene-codecs:${versions.lucene}"
20-
runtimeOnly 'org.antlr:antlr4-runtime:4.5.1-1'
20+
runtimeOnly "org.antlr:antlr4-runtime:${versions.antlr4}"
2121
runtimeOnly 'org.ow2.asm:asm:7.2'
2222
runtimeOnly 'org.ow2.asm:asm-commons:7.2'
2323
runtimeOnly 'org.ow2.asm:asm-tree:7.2'

modules/lang-painless/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ configurations {
3434
}
3535

3636
dependencies {
37-
api 'org.antlr:antlr4-runtime:4.5.3'
37+
api "org.antlr:antlr4-runtime:${versions.antlr4}"
3838
api 'org.ow2.asm:asm-util:7.2'
3939
api 'org.ow2.asm:asm-tree:7.2'
4040
api 'org.ow2.asm:asm-commons:7.2'
@@ -174,7 +174,7 @@ configurations {
174174
}
175175

176176
dependencies {
177-
regenerate 'org.antlr:antlr4:4.5.3'
177+
regenerate "org.antlr:antlr4:${versions.antlr4}"
178178
}
179179

180180
String grammarPath = 'src/main/antlr'
@@ -274,7 +274,7 @@ configurations {
274274
}
275275

276276
dependencies {
277-
regenerate 'org.antlr:antlr4:4.5.3'
277+
regenerate "org.antlr:antlr4:${versions.antlr4}"
278278
}
279279

280280
String suggestGrammarPath = 'src/main/antlr'

modules/lang-painless/src/main/java/module-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
requires org.elasticsearch.server;
1414
requires org.elasticsearch.xcontent;
1515

16-
requires antlr4.runtime;
16+
requires org.antlr.antlr4.runtime;
1717
requires org.apache.lucene.core;
1818
requires org.objectweb.asm;
1919
requires org.objectweb.asm.commons;

0 commit comments

Comments
 (0)