Skip to content

Commit

Permalink
[Upgrade] Lucene-9.2-snapshot (opensearch-project#2924)
Browse files Browse the repository at this point in the history
  • Loading branch information
nknize authored Apr 21, 2022
1 parent 0cbd47c commit 3d49cce
Show file tree
Hide file tree
Showing 49 changed files with 125 additions and 63 deletions.
2 changes: 1 addition & 1 deletion buildSrc/version.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
opensearch = 3.0.0
lucene = 9.1.0
lucene = 9.2.0-snapshot-f4f1f70

bundled_jdk_vendor = adoptium
bundled_jdk = 17.0.2+8
Expand Down

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bd28479bdf3c076bc89a0d30864188d444410267
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ public void testPostFilterDisablesCountOptimization() throws Exception {

QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers(), queryPhaseSearcher);
assertEquals(1, context.queryResult().topDocs().topDocs.totalHits.value);
assertProfileData(context, "MatchAllDocsQuery", query -> {
// IndexSearcher#rewrite optimizes by rewriting non-scoring queries to ConstantScoreQuery
// see: https://github.com/apache/lucene/pull/672
assertProfileData(context, "ConstantScoreQuery", query -> {
assertThat(query.getTimeBreakdown().keySet(), not(empty()));
assertThat(query.getTimeBreakdown().get("score"), equalTo(0L));
assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L));
Expand Down Expand Up @@ -183,7 +185,9 @@ public void testPostFilterDisablesCountOptimization() throws Exception {
assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L));
assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L));
}, (query) -> {
assertThat(query.getQueryName(), equalTo("MatchAllDocsQuery"));
// IndexSearcher#rewrite optimizes by rewriting non-scoring queries to ConstantScoreQuery
// see: https://github.com/apache/lucene/pull/672
assertThat(query.getQueryName(), equalTo("ConstantScoreQuery"));
assertThat(query.getTimeBreakdown().keySet(), not(empty()));
assertThat(query.getTimeBreakdown().get("score"), equalTo(0L));
assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L));
Expand Down Expand Up @@ -265,7 +269,9 @@ public void testMinScoreDisablesCountOptimization() throws Exception {
context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap()));
QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers(), queryPhaseSearcher);
assertEquals(1, context.queryResult().topDocs().topDocs.totalHits.value);
assertProfileData(context, "MatchAllDocsQuery", query -> {
// IndexSearcher#rewrite optimizes by rewriting non-scoring queries to ConstantScoreQuery
// see: https://github.com/apache/lucene/pull/672
assertProfileData(context, "ConstantScoreQuery", query -> {
assertThat(query.getTimeBreakdown().keySet(), not(empty()));
assertThat(query.getTimeBreakdown().get("score"), equalTo(0L));
assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L));
Expand Down Expand Up @@ -413,7 +419,9 @@ public void testTerminateAfterEarlyTermination() throws Exception {
assertTrue(context.queryResult().terminatedEarly());
assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(1L));
assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(0));
assertProfileData(context, "MatchAllDocsQuery", query -> {
// IndexSearcher#rewrite optimizes by rewriting non-scoring queries to ConstantScoreQuery
// see: https://github.com/apache/lucene/pull/672
assertProfileData(context, "ConstantScoreQuery", query -> {
assertThat(query.getTimeBreakdown().keySet(), not(empty()));
assertThat(query.getTimeBreakdown().get("score"), equalTo(0L));
assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L));
Expand Down Expand Up @@ -489,27 +497,40 @@ public void testTerminateAfterEarlyTermination() throws Exception {
assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(1L));
assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(0));

assertProfileData(context, "BooleanQuery", query -> {
// IndexSearcher#rewrite optimizes by rewriting non-scoring queries to ConstantScoreQuery
// see: https://github.com/apache/lucene/pull/672
assertProfileData(context, "ConstantScoreQuery", query -> {
assertThat(query.getTimeBreakdown().keySet(), not(empty()));
assertThat(query.getTimeBreakdown().get("score"), equalTo(0L));
assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L));
assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L));
assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L));

assertThat(query.getProfiledChildren(), hasSize(2));
assertThat(query.getProfiledChildren().get(0).getQueryName(), equalTo("TermQuery"));
// rewritten as a ConstantScoreQuery wrapping the original BooleanQuery
// see: https://github.com/apache/lucene/pull/672
assertThat(query.getProfiledChildren(), hasSize(1));
assertThat(query.getProfiledChildren().get(0).getQueryName(), equalTo("BooleanQuery"));
assertThat(query.getProfiledChildren().get(0).getTime(), greaterThan(0L));
assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight"), greaterThan(0L));
assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight_count"), equalTo(1L));
assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("score"), equalTo(0L));
assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("score_count"), equalTo(0L));

assertThat(query.getProfiledChildren().get(1).getQueryName(), equalTo("TermQuery"));
assertThat(query.getProfiledChildren().get(1).getTime(), greaterThan(0L));
assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("create_weight"), greaterThan(0L));
assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("create_weight_count"), equalTo(1L));
assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("score"), equalTo(0L));
assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("score_count"), equalTo(0L));
List<ProfileResult> children = query.getProfiledChildren().get(0).getProfiledChildren();
assertThat(children, hasSize(2));
assertThat(children.get(0).getQueryName(), equalTo("TermQuery"));
assertThat(children.get(0).getTime(), greaterThan(0L));
assertThat(children.get(0).getTimeBreakdown().get("create_weight"), greaterThan(0L));
assertThat(children.get(0).getTimeBreakdown().get("create_weight_count"), equalTo(1L));
assertThat(children.get(0).getTimeBreakdown().get("score"), equalTo(0L));
assertThat(children.get(0).getTimeBreakdown().get("score_count"), equalTo(0L));

assertThat(children.get(1).getQueryName(), equalTo("TermQuery"));
assertThat(children.get(1).getTime(), greaterThan(0L));
assertThat(children.get(1).getTimeBreakdown().get("create_weight"), greaterThan(0L));
assertThat(children.get(1).getTimeBreakdown().get("create_weight_count"), equalTo(1L));
assertThat(children.get(1).getTimeBreakdown().get("score"), equalTo(0L));
assertThat(children.get(1).getTimeBreakdown().get("score_count"), equalTo(0L));
}, collector -> {
assertThat(collector.getReason(), equalTo("search_terminate_after_count"));
assertThat(collector.getTime(), greaterThan(0L));
Expand Down Expand Up @@ -597,7 +618,9 @@ public void testIndexSortingEarlyTermination() throws Exception {
assertThat(context.queryResult().topDocs().topDocs.scoreDocs[0], instanceOf(FieldDoc.class));
FieldDoc fieldDoc = (FieldDoc) context.queryResult().topDocs().topDocs.scoreDocs[0];
assertThat(fieldDoc.fields[0], equalTo(1));
assertProfileData(context, "MatchAllDocsQuery", query -> {
// IndexSearcher#rewrite optimizes by rewriting non-scoring queries to ConstantScoreQuery
// see: https://github.com/apache/lucene/pull/672
assertProfileData(context, "ConstantScoreQuery", query -> {
assertThat(query.getTimeBreakdown().keySet(), not(empty()));
assertThat(query.getTimeBreakdown().get("score"), equalTo(0L));
assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L));
Expand Down Expand Up @@ -631,7 +654,9 @@ public void testIndexSortingEarlyTermination() throws Exception {
assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L));
assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L));
}, (query) -> {
assertThat(query.getQueryName(), equalTo("MatchAllDocsQuery"));
// IndexSearcher#rewrite optimizes by rewriting non-scoring queries to ConstantScoreQuery
// see: https://github.com/apache/lucene/pull/672
assertThat(query.getQueryName(), equalTo("ConstantScoreQuery"));
assertThat(query.getTimeBreakdown().keySet(), not(empty()));
assertThat(query.getTimeBreakdown().get("score"), equalTo(0L));
assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L));
Expand All @@ -649,7 +674,9 @@ public void testIndexSortingEarlyTermination() throws Exception {
assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1));
assertThat(context.queryResult().topDocs().topDocs.scoreDocs[0], instanceOf(FieldDoc.class));
assertThat(fieldDoc.fields[0], anyOf(equalTo(1), equalTo(2)));
assertProfileData(context, "MatchAllDocsQuery", query -> {
// IndexSearcher#rewrite optimizes by rewriting non-scoring queries to ConstantScoreQuery
// see: https://github.com/apache/lucene/pull/672
assertProfileData(context, "ConstantScoreQuery", query -> {
assertThat(query.getTimeBreakdown().keySet(), not(empty()));
assertThat(query.getTimeBreakdown().get("score"), equalTo(0L));
assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L));
Expand All @@ -666,7 +693,9 @@ public void testIndexSortingEarlyTermination() throws Exception {
assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1));
assertThat(context.queryResult().topDocs().topDocs.scoreDocs[0], instanceOf(FieldDoc.class));
assertThat(fieldDoc.fields[0], anyOf(equalTo(1), equalTo(2)));
assertProfileData(context, "MatchAllDocsQuery", query -> {
// IndexSearcher#rewrite optimizes by rewriting non-scoring queries to ConstantScoreQuery
// see: https://github.com/apache/lucene/pull/672
assertProfileData(context, "ConstantScoreQuery", query -> {
assertThat(query.getTimeBreakdown().keySet(), not(empty()));
assertThat(query.getTimeBreakdown().get("score"), equalTo(0L));
assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L));
Expand Down Expand Up @@ -721,7 +750,9 @@ public void testIndexSortScrollOptimization() throws Exception {
assertNull(context.queryResult().terminatedEarly());
assertThat(context.terminateAfter(), equalTo(0));
assertThat(context.queryResult().getTotalHits().value, equalTo((long) numDocs));
assertProfileData(context, "MatchAllDocsQuery", query -> {
// IndexSearcher#rewrite optimizes by rewriting non-scoring queries to ConstantScoreQuery
// see: https://github.com/apache/lucene/pull/672
assertProfileData(context, "ConstantScoreQuery", query -> {
assertThat(query.getTimeBreakdown().keySet(), not(empty()));
assertThat(query.getTimeBreakdown().get("score"), equalTo(0L));
assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L));
Expand Down Expand Up @@ -829,7 +860,9 @@ public void testDisableTopScoreCollection() throws Exception {
assertEquals(numDocs / 2, context.queryResult().topDocs().topDocs.totalHits.value);
assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(3));
assertEquals(context.queryResult().topDocs().topDocs.totalHits.relation, TotalHits.Relation.GREATER_THAN_OR_EQUAL_TO);
assertProfileData(context, "SpanNearQuery", query -> {
// IndexSearcher#rewrite optimizes by rewriting non-scoring queries to ConstantScoreQuery
// see: https://github.com/apache/lucene/pull/672
assertProfileData(context, "ConstantScoreQuery", query -> {
assertThat(query.getTimeBreakdown().keySet(), not(empty()));
assertThat(query.getTimeBreakdown().get("score"), equalTo(0L));
assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L));
Expand Down
1 change: 0 additions & 1 deletion server/licenses/lucene-analysis-common-9.1.0.jar.sha1

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1f7c4b91c8ef9f65e85c5190080b3f796076f355
1 change: 0 additions & 1 deletion server/licenses/lucene-backward-codecs-9.1.0.jar.sha1

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e3ee195405dc0cb249fe2eb3f3a6a848c4686645
1 change: 0 additions & 1 deletion server/licenses/lucene-core-9.1.0.jar.sha1

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
f1cb45d20f7f23c420c56a94e9153e96bfdd6e1f
1 change: 0 additions & 1 deletion server/licenses/lucene-grouping-9.1.0.jar.sha1

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
29052ac8f5255c8df2bb1d3d0da94e112c181679
1 change: 0 additions & 1 deletion server/licenses/lucene-highlighter-9.1.0.jar.sha1

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d710569c00d561c70d8290de4c4c15fe9735f94f
1 change: 0 additions & 1 deletion server/licenses/lucene-join-9.1.0.jar.sha1

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0f3081b32664d8ca6318e69dd054befb5f9a334b
1 change: 0 additions & 1 deletion server/licenses/lucene-memory-9.1.0.jar.sha1

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
81b63e23b87c054c140ff6a1e2e6696ca750d51c
1 change: 0 additions & 1 deletion server/licenses/lucene-misc-9.1.0.jar.sha1

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0cdea200c1890b877d26ce58b7d797f122bb8328
1 change: 0 additions & 1 deletion server/licenses/lucene-queries-9.1.0.jar.sha1

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
50d8395e3afc502f267cb308399ab783edfabec0
1 change: 0 additions & 1 deletion server/licenses/lucene-queryparser-9.1.0.jar.sha1

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
815b394c8be5cbb9673011953da38d39a843b0fa
1 change: 0 additions & 1 deletion server/licenses/lucene-sandbox-9.1.0.jar.sha1

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7bb7c539172dc3513d4f34e7f29d2cd3a0352361
1 change: 0 additions & 1 deletion server/licenses/lucene-spatial-extras-9.1.0.jar.sha1

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7bc2f2e37f866e3b376f083e4b7cc89a8cb45fd0
1 change: 0 additions & 1 deletion server/licenses/lucene-spatial3d-9.1.0.jar.sha1

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a5f79bb1f8337dbe6fc50fc5abd46d4eaaf4d433
1 change: 0 additions & 1 deletion server/licenses/lucene-suggest-9.1.0.jar.sha1

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9e74f66171ea215e8c4936588381c0950c290c80
2 changes: 1 addition & 1 deletion server/src/main/java/org/opensearch/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public class Version implements Comparable<Version>, ToXContentFragment {
public static final Version V_1_3_2 = new Version(1030299, org.apache.lucene.util.Version.LUCENE_8_10_1);
public static final Version V_2_0_0 = new Version(2000099, org.apache.lucene.util.Version.LUCENE_9_1_0);
public static final Version V_2_1_0 = new Version(2010099, org.apache.lucene.util.Version.LUCENE_9_1_0);
public static final Version V_3_0_0 = new Version(3000099, org.apache.lucene.util.Version.LUCENE_9_1_0);
public static final Version V_3_0_0 = new Version(3000099, org.apache.lucene.util.Version.LUCENE_9_2_0);
public static final Version CURRENT = V_3_0_0;

public static Version readVersion(StreamInput in) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public void testLuceneVersionOnUnknownVersions() {
assertEquals(VersionUtils.getFirstVersion().luceneVersion.major - 1, version.luceneVersion.major);

// future version, should be the same version as today
version = Version.fromString("2.77.1");
version = Version.fromString(Version.CURRENT.major + ".77.1");
assertEquals(Version.CURRENT.luceneVersion, version.luceneVersion);
}
}
Loading

0 comments on commit 3d49cce

Please sign in to comment.