diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2d3c8fa81cc75..3d371b56e930b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -89,6 +89,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- OpenJDK Update (January 2023 Patch releases) ([#6074](https://github.com/opensearch-project/OpenSearch/pull/6074))
- Bumps `Mockito` from 4.7.0 to 5.1.0, `ByteBuddy` from 1.12.18 to 1.12.22 ([#6076](https://github.com/opensearch-project/OpenSearch/pull/6076))
- Bumps `joda` from 2.10.13 to 2.12.2 ([#6083](https://github.com/opensearch-project/OpenSearch/pull/6083))
+- Upgrade to Lucene 9.5.0 ([#5878](https://github.com/opensearch-project/OpenSearch/pull/6078))
### Changed
- Use ReplicationFailedException instead of OpensearchException in ReplicationTarget ([#4725](https://github.com/opensearch-project/OpenSearch/pull/4725))
diff --git a/buildSrc/version.properties b/buildSrc/version.properties
index 58fb0074d11f2..2599c38dbcb2f 100644
--- a/buildSrc/version.properties
+++ b/buildSrc/version.properties
@@ -1,5 +1,5 @@
opensearch = 3.0.0
-lucene = 9.5.0-snapshot-0878271
+lucene = 9.5.0
bundled_jdk_vendor = adoptium
bundled_jdk = 19.0.2+7
diff --git a/modules/analysis-common/src/test/java/org/opensearch/analysis/common/HighlighterWithAnalyzersTests.java b/modules/analysis-common/src/test/java/org/opensearch/analysis/common/HighlighterWithAnalyzersTests.java
index 74ed3cd79e753..8d39258d31cd6 100644
--- a/modules/analysis-common/src/test/java/org/opensearch/analysis/common/HighlighterWithAnalyzersTests.java
+++ b/modules/analysis-common/src/test/java/org/opensearch/analysis/common/HighlighterWithAnalyzersTests.java
@@ -50,6 +50,7 @@
import static org.opensearch.client.Requests.searchRequest;
import static org.opensearch.common.xcontent.XContentFactory.jsonBuilder;
import static org.opensearch.index.query.QueryBuilders.boolQuery;
+import static org.opensearch.index.query.QueryBuilders.matchAllQuery;
import static org.opensearch.index.query.QueryBuilders.matchPhrasePrefixQuery;
import static org.opensearch.index.query.QueryBuilders.matchPhraseQuery;
import static org.opensearch.index.query.QueryBuilders.matchQuery;
@@ -61,6 +62,7 @@
import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.startsWith;
+import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertHitCount;
public class HighlighterWithAnalyzersTests extends OpenSearchIntegTestCase {
@Override
@@ -270,9 +272,13 @@ public void testPhrasePrefix() throws IOException {
refresh();
logger.info("--> highlighting and searching on field0");
- SearchSourceBuilder source = searchSource().query(matchPhrasePrefixQuery("field0", "bro"))
- .highlighter(highlight().field("field0").order("score").preTags("").postTags(""));
+ SearchSourceBuilder source = searchSource().query(matchAllQuery());
SearchResponse searchResponse = client().search(searchRequest("first_test_index").source(source)).actionGet();
+ assertHitCount(searchResponse, 2);
+
+ source = searchSource().query(matchPhrasePrefixQuery("field0", "bro"))
+ .highlighter(highlight().field("field0").order("score").preTags("").postTags(""));
+ searchResponse = client().search(searchRequest("first_test_index").source(source)).actionGet();
assertHighlight(searchResponse, 0, "field0", 0, 1, equalTo("The quick brown fox jumps over the lazy dog"));
@@ -415,6 +421,7 @@ public void testPhrasePrefix() throws IOException {
public static XContentBuilder type1TermVectorMapping() throws IOException {
return XContentFactory.jsonBuilder()
.startObject()
+ .startObject("_doc")
.startObject("properties")
.startObject("field1")
.field("type", "text")
@@ -425,6 +432,7 @@ public static XContentBuilder type1TermVectorMapping() throws IOException {
.field("term_vector", "with_positions_offsets")
.endObject()
.endObject()
+ .endObject()
.endObject();
}
}
diff --git a/modules/lang-expression/licenses/lucene-expressions-9.5.0-snapshot-0878271.jar.sha1 b/modules/lang-expression/licenses/lucene-expressions-9.5.0-snapshot-0878271.jar.sha1
deleted file mode 100644
index 7b246b88ba5a8..0000000000000
--- a/modules/lang-expression/licenses/lucene-expressions-9.5.0-snapshot-0878271.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-6912f9f9ceebbe5a54795035984709a4ada115e8
\ No newline at end of file
diff --git a/modules/lang-expression/licenses/lucene-expressions-9.5.0.jar.sha1 b/modules/lang-expression/licenses/lucene-expressions-9.5.0.jar.sha1
new file mode 100644
index 0000000000000..c1340a55815e5
--- /dev/null
+++ b/modules/lang-expression/licenses/lucene-expressions-9.5.0.jar.sha1
@@ -0,0 +1 @@
+62f3d3630ecc14069d5c24b9693df5a2787f8202
\ No newline at end of file
diff --git a/plugins/analysis-icu/licenses/lucene-analysis-icu-9.5.0-snapshot-0878271.jar.sha1 b/plugins/analysis-icu/licenses/lucene-analysis-icu-9.5.0-snapshot-0878271.jar.sha1
deleted file mode 100644
index e906bd304e64f..0000000000000
--- a/plugins/analysis-icu/licenses/lucene-analysis-icu-9.5.0-snapshot-0878271.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-477512b093aa1dd55ea9340c3a16128f6722161b
\ No newline at end of file
diff --git a/plugins/analysis-icu/licenses/lucene-analysis-icu-9.5.0.jar.sha1 b/plugins/analysis-icu/licenses/lucene-analysis-icu-9.5.0.jar.sha1
new file mode 100644
index 0000000000000..1d3eb41aab0a1
--- /dev/null
+++ b/plugins/analysis-icu/licenses/lucene-analysis-icu-9.5.0.jar.sha1
@@ -0,0 +1 @@
+11c816250e4ff106151fd8cb69e61ead4fb4a8dd
\ No newline at end of file
diff --git a/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.5.0-snapshot-0878271.jar.sha1 b/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.5.0-snapshot-0878271.jar.sha1
deleted file mode 100644
index fcdd55305387f..0000000000000
--- a/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.5.0-snapshot-0878271.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-89e9389e166bbd5e774d4b62acd75bf37481062e
\ No newline at end of file
diff --git a/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.5.0.jar.sha1 b/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.5.0.jar.sha1
new file mode 100644
index 0000000000000..31f1eb3991d5a
--- /dev/null
+++ b/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.5.0.jar.sha1
@@ -0,0 +1 @@
+4555fc64ce9d63c6c1f4983e816526f896606e9f
\ No newline at end of file
diff --git a/plugins/analysis-nori/licenses/lucene-analysis-nori-9.5.0-snapshot-0878271.jar.sha1 b/plugins/analysis-nori/licenses/lucene-analysis-nori-9.5.0-snapshot-0878271.jar.sha1
deleted file mode 100644
index d1a86508da090..0000000000000
--- a/plugins/analysis-nori/licenses/lucene-analysis-nori-9.5.0-snapshot-0878271.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-928c3eb74edf7ab62ea7d0948703f2867299cb56
\ No newline at end of file
diff --git a/plugins/analysis-nori/licenses/lucene-analysis-nori-9.5.0.jar.sha1 b/plugins/analysis-nori/licenses/lucene-analysis-nori-9.5.0.jar.sha1
new file mode 100644
index 0000000000000..47bfe0e4b667d
--- /dev/null
+++ b/plugins/analysis-nori/licenses/lucene-analysis-nori-9.5.0.jar.sha1
@@ -0,0 +1 @@
+2fd55607da8adf8234169d9f4120119c05a8175c
\ No newline at end of file
diff --git a/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.5.0-snapshot-0878271.jar.sha1 b/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.5.0-snapshot-0878271.jar.sha1
deleted file mode 100644
index 8b8986ee07ab2..0000000000000
--- a/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.5.0-snapshot-0878271.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-2d5640fe3a99b9af4c469243032b89dba32f7ab2
\ No newline at end of file
diff --git a/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.5.0.jar.sha1 b/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.5.0.jar.sha1
new file mode 100644
index 0000000000000..99ce9a0a4cb9a
--- /dev/null
+++ b/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.5.0.jar.sha1
@@ -0,0 +1 @@
+c97163035f1d46249505d15fbdc427b6ae03549a
\ No newline at end of file
diff --git a/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.5.0-snapshot-0878271.jar.sha1 b/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.5.0-snapshot-0878271.jar.sha1
deleted file mode 100644
index 20f4c39f40ebf..0000000000000
--- a/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.5.0-snapshot-0878271.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-44c3ceefd4999b046b935d8737c26c1a835c8d5a
\ No newline at end of file
diff --git a/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.5.0.jar.sha1 b/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.5.0.jar.sha1
new file mode 100644
index 0000000000000..e63db9c407a77
--- /dev/null
+++ b/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.5.0.jar.sha1
@@ -0,0 +1 @@
+a08ae3e2212837c98d5e1174cf1a293a5c8c0373
\ No newline at end of file
diff --git a/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.5.0-snapshot-0878271.jar.sha1 b/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.5.0-snapshot-0878271.jar.sha1
deleted file mode 100644
index 899575f029626..0000000000000
--- a/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.5.0-snapshot-0878271.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-6da2070b19949a397e45f2b54a739cef403d0c94
\ No newline at end of file
diff --git a/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.5.0.jar.sha1 b/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.5.0.jar.sha1
new file mode 100644
index 0000000000000..d2f956a296f96
--- /dev/null
+++ b/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.5.0.jar.sha1
@@ -0,0 +1 @@
+483906d2ebad0ff910d52382c2f027b511788b58
\ No newline at end of file
diff --git a/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.5.0-snapshot-0878271.jar.sha1 b/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.5.0-snapshot-0878271.jar.sha1
deleted file mode 100644
index 49000d3e4b151..0000000000000
--- a/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.5.0-snapshot-0878271.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-1803e928dd330599048b71386456fb90acbed5c1
\ No newline at end of file
diff --git a/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.5.0.jar.sha1 b/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.5.0.jar.sha1
new file mode 100644
index 0000000000000..d28a2fa06fe28
--- /dev/null
+++ b/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.5.0.jar.sha1
@@ -0,0 +1 @@
+cb00cd193e2f927e6357cf33e0880034571ea528
\ No newline at end of file
diff --git a/server/licenses/lucene-analysis-common-9.5.0-snapshot-0878271.jar.sha1 b/server/licenses/lucene-analysis-common-9.5.0-snapshot-0878271.jar.sha1
deleted file mode 100644
index de9ad9baf756b..0000000000000
--- a/server/licenses/lucene-analysis-common-9.5.0-snapshot-0878271.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-92c380f063c5b75efd6b3c48dffc942bfe21360f
\ No newline at end of file
diff --git a/server/licenses/lucene-analysis-common-9.5.0.jar.sha1 b/server/licenses/lucene-analysis-common-9.5.0.jar.sha1
new file mode 100644
index 0000000000000..bcd78036b0c99
--- /dev/null
+++ b/server/licenses/lucene-analysis-common-9.5.0.jar.sha1
@@ -0,0 +1 @@
+f68660102455a466f98cac0501723bed7e7c6407
\ No newline at end of file
diff --git a/server/licenses/lucene-backward-codecs-9.5.0-snapshot-0878271.jar.sha1 b/server/licenses/lucene-backward-codecs-9.5.0-snapshot-0878271.jar.sha1
deleted file mode 100644
index 77aa7df611354..0000000000000
--- a/server/licenses/lucene-backward-codecs-9.5.0-snapshot-0878271.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-2f0f211b1ed0447135f84a36935625e9a33a98e5
\ No newline at end of file
diff --git a/server/licenses/lucene-backward-codecs-9.5.0.jar.sha1 b/server/licenses/lucene-backward-codecs-9.5.0.jar.sha1
new file mode 100644
index 0000000000000..4000ee7fc0e93
--- /dev/null
+++ b/server/licenses/lucene-backward-codecs-9.5.0.jar.sha1
@@ -0,0 +1 @@
+66be22239d5058b0b8a8aeba03dc047a276efafa
\ No newline at end of file
diff --git a/server/licenses/lucene-core-9.5.0-snapshot-0878271.jar.sha1 b/server/licenses/lucene-core-9.5.0-snapshot-0878271.jar.sha1
deleted file mode 100644
index f10ba49ec6dd7..0000000000000
--- a/server/licenses/lucene-core-9.5.0-snapshot-0878271.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-1f8895d068b5d98c16d48f267a772d0243148040
\ No newline at end of file
diff --git a/server/licenses/lucene-core-9.5.0.jar.sha1 b/server/licenses/lucene-core-9.5.0.jar.sha1
new file mode 100644
index 0000000000000..bca72d4375dab
--- /dev/null
+++ b/server/licenses/lucene-core-9.5.0.jar.sha1
@@ -0,0 +1 @@
+bba4ba5d30e71a5f0017e45e8469db8cff8ad102
\ No newline at end of file
diff --git a/server/licenses/lucene-grouping-9.5.0-snapshot-0878271.jar.sha1 b/server/licenses/lucene-grouping-9.5.0-snapshot-0878271.jar.sha1
deleted file mode 100644
index ab153ccb80f0b..0000000000000
--- a/server/licenses/lucene-grouping-9.5.0-snapshot-0878271.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-f12819e51f145624ef7b1fd93aaa543cec13e3aa
\ No newline at end of file
diff --git a/server/licenses/lucene-grouping-9.5.0.jar.sha1 b/server/licenses/lucene-grouping-9.5.0.jar.sha1
new file mode 100644
index 0000000000000..08ed52d3379ec
--- /dev/null
+++ b/server/licenses/lucene-grouping-9.5.0.jar.sha1
@@ -0,0 +1 @@
+b15fe0a55a82168c810d0447ec2e244d16d94f01
\ No newline at end of file
diff --git a/server/licenses/lucene-highlighter-9.5.0-snapshot-0878271.jar.sha1 b/server/licenses/lucene-highlighter-9.5.0-snapshot-0878271.jar.sha1
deleted file mode 100644
index 0885f1fda24bf..0000000000000
--- a/server/licenses/lucene-highlighter-9.5.0-snapshot-0878271.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-ed88cca26580a32234e3f605cf963703ea99eb60
\ No newline at end of file
diff --git a/server/licenses/lucene-highlighter-9.5.0.jar.sha1 b/server/licenses/lucene-highlighter-9.5.0.jar.sha1
new file mode 100644
index 0000000000000..0df6615e43c66
--- /dev/null
+++ b/server/licenses/lucene-highlighter-9.5.0.jar.sha1
@@ -0,0 +1 @@
+8b5e3cea3370838bda1d730cf55176c24a763d2e
\ No newline at end of file
diff --git a/server/licenses/lucene-join-9.5.0-snapshot-0878271.jar.sha1 b/server/licenses/lucene-join-9.5.0-snapshot-0878271.jar.sha1
deleted file mode 100644
index afdba4c231926..0000000000000
--- a/server/licenses/lucene-join-9.5.0-snapshot-0878271.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-f51934b2362e827d9f467507624b773153f0ca01
\ No newline at end of file
diff --git a/server/licenses/lucene-join-9.5.0.jar.sha1 b/server/licenses/lucene-join-9.5.0.jar.sha1
new file mode 100644
index 0000000000000..d441e3215820a
--- /dev/null
+++ b/server/licenses/lucene-join-9.5.0.jar.sha1
@@ -0,0 +1 @@
+85a4208614a5660297effce441883687b010073b
\ No newline at end of file
diff --git a/server/licenses/lucene-memory-9.5.0-snapshot-0878271.jar.sha1 b/server/licenses/lucene-memory-9.5.0-snapshot-0878271.jar.sha1
deleted file mode 100644
index 29d894a978024..0000000000000
--- a/server/licenses/lucene-memory-9.5.0-snapshot-0878271.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-54744097c6882a498c08ffd8a42b54da00c9420c
\ No newline at end of file
diff --git a/server/licenses/lucene-memory-9.5.0.jar.sha1 b/server/licenses/lucene-memory-9.5.0.jar.sha1
new file mode 100644
index 0000000000000..0fb289af21987
--- /dev/null
+++ b/server/licenses/lucene-memory-9.5.0.jar.sha1
@@ -0,0 +1 @@
+d632e63d08837be715046c8ccb4fb804acd3d7e4
\ No newline at end of file
diff --git a/server/licenses/lucene-misc-9.5.0-snapshot-0878271.jar.sha1 b/server/licenses/lucene-misc-9.5.0-snapshot-0878271.jar.sha1
deleted file mode 100644
index b09c965d042b3..0000000000000
--- a/server/licenses/lucene-misc-9.5.0-snapshot-0878271.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-b9061dea1178e0cac86147d7b69fc53bf2f8ee58
\ No newline at end of file
diff --git a/server/licenses/lucene-misc-9.5.0.jar.sha1 b/server/licenses/lucene-misc-9.5.0.jar.sha1
new file mode 100644
index 0000000000000..985fbb18ea6d0
--- /dev/null
+++ b/server/licenses/lucene-misc-9.5.0.jar.sha1
@@ -0,0 +1 @@
+64773801b8ba8141f4256d22da598de40d6f3033
\ No newline at end of file
diff --git a/server/licenses/lucene-queries-9.5.0-snapshot-0878271.jar.sha1 b/server/licenses/lucene-queries-9.5.0-snapshot-0878271.jar.sha1
deleted file mode 100644
index 604edd3b00842..0000000000000
--- a/server/licenses/lucene-queries-9.5.0-snapshot-0878271.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-eca07717c0ee563c5337222fd1a1b7ef5f03f34f
\ No newline at end of file
diff --git a/server/licenses/lucene-queries-9.5.0.jar.sha1 b/server/licenses/lucene-queries-9.5.0.jar.sha1
new file mode 100644
index 0000000000000..4ac6d8161fc58
--- /dev/null
+++ b/server/licenses/lucene-queries-9.5.0.jar.sha1
@@ -0,0 +1 @@
+ae7930fa0ea91198905d695a222ef7f09de1c2dd
\ No newline at end of file
diff --git a/server/licenses/lucene-queryparser-9.5.0-snapshot-0878271.jar.sha1 b/server/licenses/lucene-queryparser-9.5.0-snapshot-0878271.jar.sha1
deleted file mode 100644
index 11ba3ca14d028..0000000000000
--- a/server/licenses/lucene-queryparser-9.5.0-snapshot-0878271.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-4d1ed21bc62940c4545778dc5f6249b67d08b095
\ No newline at end of file
diff --git a/server/licenses/lucene-queryparser-9.5.0.jar.sha1 b/server/licenses/lucene-queryparser-9.5.0.jar.sha1
new file mode 100644
index 0000000000000..45b6229e713c2
--- /dev/null
+++ b/server/licenses/lucene-queryparser-9.5.0.jar.sha1
@@ -0,0 +1 @@
+b3e3d9434bcfce242e242364c64eab0888d285e2
\ No newline at end of file
diff --git a/server/licenses/lucene-sandbox-9.5.0-snapshot-0878271.jar.sha1 b/server/licenses/lucene-sandbox-9.5.0-snapshot-0878271.jar.sha1
deleted file mode 100644
index 6bbb3be0bd801..0000000000000
--- a/server/licenses/lucene-sandbox-9.5.0-snapshot-0878271.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-c564c73080cff226a131847b4361bc9c2155f00c
\ No newline at end of file
diff --git a/server/licenses/lucene-sandbox-9.5.0.jar.sha1 b/server/licenses/lucene-sandbox-9.5.0.jar.sha1
new file mode 100644
index 0000000000000..d43ebd2d27119
--- /dev/null
+++ b/server/licenses/lucene-sandbox-9.5.0.jar.sha1
@@ -0,0 +1 @@
+408be287b0f421cf8afd655579a0cc65aba61b28
\ No newline at end of file
diff --git a/server/licenses/lucene-spatial-extras-9.5.0-snapshot-0878271.jar.sha1 b/server/licenses/lucene-spatial-extras-9.5.0-snapshot-0878271.jar.sha1
deleted file mode 100644
index a4def52c3788e..0000000000000
--- a/server/licenses/lucene-spatial-extras-9.5.0-snapshot-0878271.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-7a654fcc671e0372a9becd7c7cbd9a1f43569106
\ No newline at end of file
diff --git a/server/licenses/lucene-spatial-extras-9.5.0.jar.sha1 b/server/licenses/lucene-spatial-extras-9.5.0.jar.sha1
new file mode 100644
index 0000000000000..b44f49f3601ba
--- /dev/null
+++ b/server/licenses/lucene-spatial-extras-9.5.0.jar.sha1
@@ -0,0 +1 @@
+4960c09365d20f024bf668f60d7c3b4e54f03750
\ No newline at end of file
diff --git a/server/licenses/lucene-spatial3d-9.5.0-snapshot-0878271.jar.sha1 b/server/licenses/lucene-spatial3d-9.5.0-snapshot-0878271.jar.sha1
deleted file mode 100644
index 9b782e4eda598..0000000000000
--- a/server/licenses/lucene-spatial3d-9.5.0-snapshot-0878271.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-33c9c43eac6b4924155eeff03d2231c2bed9b169
\ No newline at end of file
diff --git a/server/licenses/lucene-spatial3d-9.5.0.jar.sha1 b/server/licenses/lucene-spatial3d-9.5.0.jar.sha1
new file mode 100644
index 0000000000000..369e569ee754f
--- /dev/null
+++ b/server/licenses/lucene-spatial3d-9.5.0.jar.sha1
@@ -0,0 +1 @@
+01ed55dd384e654076b76d7083feee6ac3efe02b
\ No newline at end of file
diff --git a/server/licenses/lucene-suggest-9.5.0-snapshot-0878271.jar.sha1 b/server/licenses/lucene-suggest-9.5.0-snapshot-0878271.jar.sha1
deleted file mode 100644
index 5e3e9cebdc35c..0000000000000
--- a/server/licenses/lucene-suggest-9.5.0-snapshot-0878271.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-95a69fd51377d964d16057a4a9501665a2ca9a7a
\ No newline at end of file
diff --git a/server/licenses/lucene-suggest-9.5.0.jar.sha1 b/server/licenses/lucene-suggest-9.5.0.jar.sha1
new file mode 100644
index 0000000000000..c44ac0ec028f4
--- /dev/null
+++ b/server/licenses/lucene-suggest-9.5.0.jar.sha1
@@ -0,0 +1 @@
+195624eb3a09b3dc37cc5fa51ae2f7bd61553985
\ No newline at end of file
diff --git a/server/src/main/java/org/opensearch/common/lucene/search/MultiPhrasePrefixQuery.java b/server/src/main/java/org/opensearch/common/lucene/search/MultiPhrasePrefixQuery.java
index 6986bd8504f84..a1ab761ec8034 100644
--- a/server/src/main/java/org/opensearch/common/lucene/search/MultiPhrasePrefixQuery.java
+++ b/server/src/main/java/org/opensearch/common/lucene/search/MultiPhrasePrefixQuery.java
@@ -325,6 +325,20 @@ private boolean termArraysEquals(List termArrays1, List termArra
@Override
public void visit(QueryVisitor visitor) {
- visitor.visitLeaf(this);
+ if (visitor.acceptField(field)) {
+ // set by the subvisitor because the default returns, *this*, unless MUST_NOT is used which returns
+ // an ideal EMPTY_VISITOR
+ visitor = visitor.getSubVisitor(BooleanClause.Occur.MUST, this);
+ for (int i = 0; i < termArrays.size() - 1; ++i) {
+ if (termArrays.get(i).length == 1) {
+ visitor.consumeTerms(this, termArrays.get(i)[0]); // use a must if we only have a single phrase
+ } else {
+ // if more than one sub-phrase
+ // we should match at least one
+ QueryVisitor subVisitor = visitor.getSubVisitor(BooleanClause.Occur.SHOULD, this);
+ subVisitor.consumeTerms(this, termArrays.get(i));
+ }
+ }
+ }
}
}
diff --git a/server/src/main/java/org/opensearch/index/engine/TranslogLeafReader.java b/server/src/main/java/org/opensearch/index/engine/TranslogLeafReader.java
index 258674a096e52..5efafb562df74 100644
--- a/server/src/main/java/org/opensearch/index/engine/TranslogLeafReader.java
+++ b/server/src/main/java/org/opensearch/index/engine/TranslogLeafReader.java
@@ -32,10 +32,12 @@
package org.opensearch.index.engine;
import org.apache.lucene.index.BinaryDocValues;
+import org.apache.lucene.index.ByteVectorValues;
import org.apache.lucene.index.DocValuesType;
import org.apache.lucene.index.FieldInfo;
import org.apache.lucene.index.FieldInfos;
import org.apache.lucene.index.Fields;
+import org.apache.lucene.index.FloatVectorValues;
import org.apache.lucene.index.IndexOptions;
import org.apache.lucene.index.LeafMetaData;
import org.apache.lucene.index.LeafReader;
@@ -50,7 +52,6 @@
import org.apache.lucene.index.Terms;
import org.apache.lucene.index.VectorEncoding;
import org.apache.lucene.index.VectorSimilarityFunction;
-import org.apache.lucene.index.VectorValues;
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.util.Bits;
import org.apache.lucene.util.BytesRef;
@@ -255,8 +256,13 @@ public CacheHelper getReaderCacheHelper() {
}
@Override
- public VectorValues getVectorValues(String field) throws IOException {
- return getVectorValues(field);
+ public FloatVectorValues getFloatVectorValues(String field) throws IOException {
+ return getFloatVectorValues(field);
+ }
+
+ @Override
+ public ByteVectorValues getByteVectorValues(String field) throws IOException {
+ return getByteVectorValues(field);
}
@Override
@@ -265,7 +271,7 @@ public TopDocs searchNearestVectors(String field, float[] target, int k, Bits ac
}
@Override
- public TopDocs searchNearestVectors(String field, BytesRef target, int k, Bits acceptDocs, int visitedLimit) throws IOException {
+ public TopDocs searchNearestVectors(String field, byte[] target, int k, Bits acceptDocs, int visitedLimit) throws IOException {
throw new UnsupportedOperationException();
}
}
diff --git a/server/src/main/java/org/opensearch/index/mapper/DateFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/DateFieldMapper.java
index 4b19fe4c5de79..1669c14d00c2a 100644
--- a/server/src/main/java/org/opensearch/index/mapper/DateFieldMapper.java
+++ b/server/src/main/java/org/opensearch/index/mapper/DateFieldMapper.java
@@ -37,7 +37,7 @@
import org.apache.lucene.document.StoredField;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.PointValues;
-import org.apache.lucene.sandbox.search.IndexSortSortedNumericDocValuesRangeQuery;
+import org.apache.lucene.search.IndexSortSortedNumericDocValuesRangeQuery;
import org.apache.lucene.search.BoostQuery;
import org.apache.lucene.search.IndexOrDocValuesQuery;
import org.apache.lucene.search.Query;
diff --git a/server/src/main/java/org/opensearch/index/mapper/NumberFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/NumberFieldMapper.java
index 92b970895837f..449d6569ef700 100644
--- a/server/src/main/java/org/opensearch/index/mapper/NumberFieldMapper.java
+++ b/server/src/main/java/org/opensearch/index/mapper/NumberFieldMapper.java
@@ -42,7 +42,7 @@
import org.apache.lucene.document.SortedNumericDocValuesField;
import org.apache.lucene.document.StoredField;
import org.apache.lucene.sandbox.document.HalfFloatPoint;
-import org.apache.lucene.sandbox.search.IndexSortSortedNumericDocValuesRangeQuery;
+import org.apache.lucene.search.IndexSortSortedNumericDocValuesRangeQuery;
import org.apache.lucene.search.BoostQuery;
import org.apache.lucene.search.IndexOrDocValuesQuery;
import org.apache.lucene.search.MatchNoDocsQuery;
diff --git a/server/src/test/java/org/opensearch/index/mapper/DateFieldTypeTests.java b/server/src/test/java/org/opensearch/index/mapper/DateFieldTypeTests.java
index 490966c5c48e5..2300d3cceab65 100644
--- a/server/src/test/java/org/opensearch/index/mapper/DateFieldTypeTests.java
+++ b/server/src/test/java/org/opensearch/index/mapper/DateFieldTypeTests.java
@@ -40,7 +40,7 @@
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.index.MultiReader;
import org.apache.lucene.index.SortedNumericDocValues;
-import org.apache.lucene.sandbox.search.IndexSortSortedNumericDocValuesRangeQuery;
+import org.apache.lucene.search.IndexSortSortedNumericDocValuesRangeQuery;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.IndexOrDocValuesQuery;
import org.apache.lucene.search.Query;
diff --git a/server/src/test/java/org/opensearch/index/mapper/NumberFieldTypeTests.java b/server/src/test/java/org/opensearch/index/mapper/NumberFieldTypeTests.java
index 868261130135c..ca5e8d0c6e08d 100644
--- a/server/src/test/java/org/opensearch/index/mapper/NumberFieldTypeTests.java
+++ b/server/src/test/java/org/opensearch/index/mapper/NumberFieldTypeTests.java
@@ -43,7 +43,7 @@
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.sandbox.document.HalfFloatPoint;
-import org.apache.lucene.sandbox.search.IndexSortSortedNumericDocValuesRangeQuery;
+import org.apache.lucene.search.IndexSortSortedNumericDocValuesRangeQuery;
import org.apache.lucene.search.IndexOrDocValuesQuery;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.MatchNoDocsQuery;