diff --git a/buildSrc/version.properties b/buildSrc/version.properties index d3499b0df59..3ade56a6cab 100644 --- a/buildSrc/version.properties +++ b/buildSrc/version.properties @@ -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 diff --git a/modules/lang-expression/licenses/lucene-expressions-9.1.0.jar.sha1 b/modules/lang-expression/licenses/lucene-expressions-9.1.0.jar.sha1 deleted file mode 100644 index c825e197188..00000000000 --- a/modules/lang-expression/licenses/lucene-expressions-9.1.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -2711abb758d101fc738c35a6867ee7559da5308b \ No newline at end of file diff --git a/modules/lang-expression/licenses/lucene-expressions-9.2.0-snapshot-f4f1f70.jar.sha1 b/modules/lang-expression/licenses/lucene-expressions-9.2.0-snapshot-f4f1f70.jar.sha1 new file mode 100644 index 00000000000..c6f95e2bdec --- /dev/null +++ b/modules/lang-expression/licenses/lucene-expressions-9.2.0-snapshot-f4f1f70.jar.sha1 @@ -0,0 +1 @@ +f2a8008e74589f77f1d3da305cf58c88ee01d1c1 \ No newline at end of file diff --git a/plugins/analysis-icu/licenses/lucene-analysis-icu-9.1.0.jar.sha1 b/plugins/analysis-icu/licenses/lucene-analysis-icu-9.1.0.jar.sha1 deleted file mode 100644 index b7733cfa9a0..00000000000 --- a/plugins/analysis-icu/licenses/lucene-analysis-icu-9.1.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -e9b429da553560fa0c363ffc04c774f957c56e14 \ No newline at end of file diff --git a/plugins/analysis-icu/licenses/lucene-analysis-icu-9.2.0-snapshot-f4f1f70.jar.sha1 b/plugins/analysis-icu/licenses/lucene-analysis-icu-9.2.0-snapshot-f4f1f70.jar.sha1 new file mode 100644 index 00000000000..616925e9865 --- /dev/null +++ b/plugins/analysis-icu/licenses/lucene-analysis-icu-9.2.0-snapshot-f4f1f70.jar.sha1 @@ -0,0 +1 @@ +f9569365e80897f1a9161254d5d2f44a44f95db8 \ No newline at end of file diff --git a/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.1.0.jar.sha1 b/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.1.0.jar.sha1 deleted file mode 100644 index f5b818a206e..00000000000 --- a/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.1.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -b247f8a877237b4663e4ab7d86fae21c68a58ea5 \ No newline at end of file diff --git a/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.2.0-snapshot-f4f1f70.jar.sha1 b/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.2.0-snapshot-f4f1f70.jar.sha1 new file mode 100644 index 00000000000..9ddb30158c6 --- /dev/null +++ b/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.2.0-snapshot-f4f1f70.jar.sha1 @@ -0,0 +1 @@ +35c14b39ff522dd6665e74a873035827b865075e \ No newline at end of file diff --git a/plugins/analysis-nori/licenses/lucene-analysis-nori-9.1.0.jar.sha1 b/plugins/analysis-nori/licenses/lucene-analysis-nori-9.1.0.jar.sha1 deleted file mode 100644 index 4d22255d103..00000000000 --- a/plugins/analysis-nori/licenses/lucene-analysis-nori-9.1.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -30e24b42fb0440911e702a531f4373bf397eb8c6 \ No newline at end of file diff --git a/plugins/analysis-nori/licenses/lucene-analysis-nori-9.2.0-snapshot-f4f1f70.jar.sha1 b/plugins/analysis-nori/licenses/lucene-analysis-nori-9.2.0-snapshot-f4f1f70.jar.sha1 new file mode 100644 index 00000000000..3326a5d35ba --- /dev/null +++ b/plugins/analysis-nori/licenses/lucene-analysis-nori-9.2.0-snapshot-f4f1f70.jar.sha1 @@ -0,0 +1 @@ +a84218a1ea0d5c52d6591d417061518b8a8be4e4 \ No newline at end of file diff --git a/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.1.0.jar.sha1 b/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.1.0.jar.sha1 deleted file mode 100644 index a0607e6158c..00000000000 --- a/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.1.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -18a321d93836ea2856a5302d192e9dc99c647c6e \ No newline at end of file diff --git a/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.2.0-snapshot-f4f1f70.jar.sha1 b/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.2.0-snapshot-f4f1f70.jar.sha1 new file mode 100644 index 00000000000..d822d33da98 --- /dev/null +++ b/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.2.0-snapshot-f4f1f70.jar.sha1 @@ -0,0 +1 @@ +057bbd20b15899844b23d2cf034a167b4fe581f0 \ No newline at end of file diff --git a/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.1.0.jar.sha1 b/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.1.0.jar.sha1 deleted file mode 100644 index bff959139a8..00000000000 --- a/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.1.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -41c847f39a15bb8495be8c9d8a098974be15f74b \ No newline at end of file diff --git a/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.2.0-snapshot-f4f1f70.jar.sha1 b/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.2.0-snapshot-f4f1f70.jar.sha1 new file mode 100644 index 00000000000..55ef27aaff8 --- /dev/null +++ b/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.2.0-snapshot-f4f1f70.jar.sha1 @@ -0,0 +1 @@ +6a9a8d49e87b6999560a131e16234e46f21e6b42 \ No newline at end of file diff --git a/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.1.0.jar.sha1 b/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.1.0.jar.sha1 deleted file mode 100644 index 39d25d7872e..00000000000 --- a/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.1.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -ee7995231b181aa0a01f5aef8775562e269f5ef7 \ No newline at end of file diff --git a/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.2.0-snapshot-f4f1f70.jar.sha1 b/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.2.0-snapshot-f4f1f70.jar.sha1 new file mode 100644 index 00000000000..ca0f275f477 --- /dev/null +++ b/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.2.0-snapshot-f4f1f70.jar.sha1 @@ -0,0 +1 @@ +fcad3608779e0b3ab8703903b9d28cdc32767d60 \ No newline at end of file diff --git a/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.1.0.jar.sha1 b/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.1.0.jar.sha1 deleted file mode 100644 index 9f07f122205..00000000000 --- a/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.1.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -575c458431396baa7f01a546173807f27b12a087 \ No newline at end of file diff --git a/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.2.0-snapshot-f4f1f70.jar.sha1 b/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.2.0-snapshot-f4f1f70.jar.sha1 new file mode 100644 index 00000000000..d0f2904e431 --- /dev/null +++ b/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.2.0-snapshot-f4f1f70.jar.sha1 @@ -0,0 +1 @@ +bd28479bdf3c076bc89a0d30864188d444410267 \ No newline at end of file diff --git a/sandbox/plugins/concurrent-search/src/test/java/org/opensearch/search/query/QueryProfilePhaseTests.java b/sandbox/plugins/concurrent-search/src/test/java/org/opensearch/search/query/QueryProfilePhaseTests.java index d2cb77f5297..36c20d029e9 100644 --- a/sandbox/plugins/concurrent-search/src/test/java/org/opensearch/search/query/QueryProfilePhaseTests.java +++ b/sandbox/plugins/concurrent-search/src/test/java/org/opensearch/search/query/QueryProfilePhaseTests.java @@ -153,7 +153,9 @@ public class QueryProfilePhaseTests extends IndexShardTestCase { 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)); @@ -183,7 +185,9 @@ public class QueryProfilePhaseTests extends IndexShardTestCase { 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)); @@ -265,7 +269,9 @@ public class QueryProfilePhaseTests extends IndexShardTestCase { 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)); @@ -413,7 +419,9 @@ public class QueryProfilePhaseTests extends IndexShardTestCase { 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)); @@ -489,27 +497,40 @@ public class QueryProfilePhaseTests extends IndexShardTestCase { 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 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)); @@ -597,7 +618,9 @@ public class QueryProfilePhaseTests extends IndexShardTestCase { 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)); @@ -631,7 +654,9 @@ public class QueryProfilePhaseTests extends IndexShardTestCase { 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)); @@ -649,7 +674,9 @@ public class QueryProfilePhaseTests extends IndexShardTestCase { 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)); @@ -666,7 +693,9 @@ public class QueryProfilePhaseTests extends IndexShardTestCase { 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)); @@ -721,7 +750,9 @@ public class QueryProfilePhaseTests extends IndexShardTestCase { 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)); @@ -829,7 +860,9 @@ public class QueryProfilePhaseTests extends IndexShardTestCase { 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)); diff --git a/server/licenses/lucene-analysis-common-9.1.0.jar.sha1 b/server/licenses/lucene-analysis-common-9.1.0.jar.sha1 deleted file mode 100644 index 4d2a9cf9451..00000000000 --- a/server/licenses/lucene-analysis-common-9.1.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -240e3997fb139ff001e022124c89b686b5a8498d \ No newline at end of file diff --git a/server/licenses/lucene-analysis-common-9.2.0-snapshot-f4f1f70.jar.sha1 b/server/licenses/lucene-analysis-common-9.2.0-snapshot-f4f1f70.jar.sha1 new file mode 100644 index 00000000000..5c667d1aec4 --- /dev/null +++ b/server/licenses/lucene-analysis-common-9.2.0-snapshot-f4f1f70.jar.sha1 @@ -0,0 +1 @@ +1f7c4b91c8ef9f65e85c5190080b3f796076f355 \ No newline at end of file diff --git a/server/licenses/lucene-backward-codecs-9.1.0.jar.sha1 b/server/licenses/lucene-backward-codecs-9.1.0.jar.sha1 deleted file mode 100644 index b6df56db28c..00000000000 --- a/server/licenses/lucene-backward-codecs-9.1.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -de23bdacb09e8b39cbe876ff79c7a5b2ecc1faa6 \ No newline at end of file diff --git a/server/licenses/lucene-backward-codecs-9.2.0-snapshot-f4f1f70.jar.sha1 b/server/licenses/lucene-backward-codecs-9.2.0-snapshot-f4f1f70.jar.sha1 new file mode 100644 index 00000000000..b8e8fc5a9e5 --- /dev/null +++ b/server/licenses/lucene-backward-codecs-9.2.0-snapshot-f4f1f70.jar.sha1 @@ -0,0 +1 @@ +e3ee195405dc0cb249fe2eb3f3a6a848c4686645 \ No newline at end of file diff --git a/server/licenses/lucene-core-9.1.0.jar.sha1 b/server/licenses/lucene-core-9.1.0.jar.sha1 deleted file mode 100644 index 45e7ae47dae..00000000000 --- a/server/licenses/lucene-core-9.1.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -0375603f1dacd8266526404faf0088a2ac8ec2ff \ No newline at end of file diff --git a/server/licenses/lucene-core-9.2.0-snapshot-f4f1f70.jar.sha1 b/server/licenses/lucene-core-9.2.0-snapshot-f4f1f70.jar.sha1 new file mode 100644 index 00000000000..dd6af54584c --- /dev/null +++ b/server/licenses/lucene-core-9.2.0-snapshot-f4f1f70.jar.sha1 @@ -0,0 +1 @@ +f1cb45d20f7f23c420c56a94e9153e96bfdd6e1f \ No newline at end of file diff --git a/server/licenses/lucene-grouping-9.1.0.jar.sha1 b/server/licenses/lucene-grouping-9.1.0.jar.sha1 deleted file mode 100644 index be423fdde04..00000000000 --- a/server/licenses/lucene-grouping-9.1.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -703308505e62fa7dcb0bf64fdb6d95d335941bdc \ No newline at end of file diff --git a/server/licenses/lucene-grouping-9.2.0-snapshot-f4f1f70.jar.sha1 b/server/licenses/lucene-grouping-9.2.0-snapshot-f4f1f70.jar.sha1 new file mode 100644 index 00000000000..3f8cede90a0 --- /dev/null +++ b/server/licenses/lucene-grouping-9.2.0-snapshot-f4f1f70.jar.sha1 @@ -0,0 +1 @@ +29052ac8f5255c8df2bb1d3d0da94e112c181679 \ No newline at end of file diff --git a/server/licenses/lucene-highlighter-9.1.0.jar.sha1 b/server/licenses/lucene-highlighter-9.1.0.jar.sha1 deleted file mode 100644 index c130c27ed4c..00000000000 --- a/server/licenses/lucene-highlighter-9.1.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -7f1925f6ef985000399a277ca17b8f67d3056838 \ No newline at end of file diff --git a/server/licenses/lucene-highlighter-9.2.0-snapshot-f4f1f70.jar.sha1 b/server/licenses/lucene-highlighter-9.2.0-snapshot-f4f1f70.jar.sha1 new file mode 100644 index 00000000000..161099cac2d --- /dev/null +++ b/server/licenses/lucene-highlighter-9.2.0-snapshot-f4f1f70.jar.sha1 @@ -0,0 +1 @@ +d710569c00d561c70d8290de4c4c15fe9735f94f \ No newline at end of file diff --git a/server/licenses/lucene-join-9.1.0.jar.sha1 b/server/licenses/lucene-join-9.1.0.jar.sha1 deleted file mode 100644 index b678051ddaf..00000000000 --- a/server/licenses/lucene-join-9.1.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -e7d39da8e623c99ee8da8bcc0185b2d908aca4b3 \ No newline at end of file diff --git a/server/licenses/lucene-join-9.2.0-snapshot-f4f1f70.jar.sha1 b/server/licenses/lucene-join-9.2.0-snapshot-f4f1f70.jar.sha1 new file mode 100644 index 00000000000..5a256ed582f --- /dev/null +++ b/server/licenses/lucene-join-9.2.0-snapshot-f4f1f70.jar.sha1 @@ -0,0 +1 @@ +0f3081b32664d8ca6318e69dd054befb5f9a334b \ No newline at end of file diff --git a/server/licenses/lucene-memory-9.1.0.jar.sha1 b/server/licenses/lucene-memory-9.1.0.jar.sha1 deleted file mode 100644 index a07b052e9c3..00000000000 --- a/server/licenses/lucene-memory-9.1.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -209166fd48dae3261ccf26990fe600332b8fb373 \ No newline at end of file diff --git a/server/licenses/lucene-memory-9.2.0-snapshot-f4f1f70.jar.sha1 b/server/licenses/lucene-memory-9.2.0-snapshot-f4f1f70.jar.sha1 new file mode 100644 index 00000000000..9504a0e4b2c --- /dev/null +++ b/server/licenses/lucene-memory-9.2.0-snapshot-f4f1f70.jar.sha1 @@ -0,0 +1 @@ +81b63e23b87c054c140ff6a1e2e6696ca750d51c \ No newline at end of file diff --git a/server/licenses/lucene-misc-9.1.0.jar.sha1 b/server/licenses/lucene-misc-9.1.0.jar.sha1 deleted file mode 100644 index 8627e481c62..00000000000 --- a/server/licenses/lucene-misc-9.1.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -905d93b6389060cf4b0cb464ffa8fa2db81b60e7 \ No newline at end of file diff --git a/server/licenses/lucene-misc-9.2.0-snapshot-f4f1f70.jar.sha1 b/server/licenses/lucene-misc-9.2.0-snapshot-f4f1f70.jar.sha1 new file mode 100644 index 00000000000..7011446c479 --- /dev/null +++ b/server/licenses/lucene-misc-9.2.0-snapshot-f4f1f70.jar.sha1 @@ -0,0 +1 @@ +0cdea200c1890b877d26ce58b7d797f122bb8328 \ No newline at end of file diff --git a/server/licenses/lucene-queries-9.1.0.jar.sha1 b/server/licenses/lucene-queries-9.1.0.jar.sha1 deleted file mode 100644 index 9e81da7ca5c..00000000000 --- a/server/licenses/lucene-queries-9.1.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -c50fc971573910ea239ee6f275e9257b6b6bdd48 \ No newline at end of file diff --git a/server/licenses/lucene-queries-9.2.0-snapshot-f4f1f70.jar.sha1 b/server/licenses/lucene-queries-9.2.0-snapshot-f4f1f70.jar.sha1 new file mode 100644 index 00000000000..eac4f3a6abc --- /dev/null +++ b/server/licenses/lucene-queries-9.2.0-snapshot-f4f1f70.jar.sha1 @@ -0,0 +1 @@ +50d8395e3afc502f267cb308399ab783edfabec0 \ No newline at end of file diff --git a/server/licenses/lucene-queryparser-9.1.0.jar.sha1 b/server/licenses/lucene-queryparser-9.1.0.jar.sha1 deleted file mode 100644 index fb04adf2051..00000000000 --- a/server/licenses/lucene-queryparser-9.1.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -383eb69b12f9d9c98c44237155f50c870c9a34b9 \ No newline at end of file diff --git a/server/licenses/lucene-queryparser-9.2.0-snapshot-f4f1f70.jar.sha1 b/server/licenses/lucene-queryparser-9.2.0-snapshot-f4f1f70.jar.sha1 new file mode 100644 index 00000000000..b00bd083b9e --- /dev/null +++ b/server/licenses/lucene-queryparser-9.2.0-snapshot-f4f1f70.jar.sha1 @@ -0,0 +1 @@ +815b394c8be5cbb9673011953da38d39a843b0fa \ No newline at end of file diff --git a/server/licenses/lucene-sandbox-9.1.0.jar.sha1 b/server/licenses/lucene-sandbox-9.1.0.jar.sha1 deleted file mode 100644 index 429a84de46f..00000000000 --- a/server/licenses/lucene-sandbox-9.1.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -0c728684e750a63f881998fbe27afd897f739762 \ No newline at end of file diff --git a/server/licenses/lucene-sandbox-9.2.0-snapshot-f4f1f70.jar.sha1 b/server/licenses/lucene-sandbox-9.2.0-snapshot-f4f1f70.jar.sha1 new file mode 100644 index 00000000000..9f26af782d8 --- /dev/null +++ b/server/licenses/lucene-sandbox-9.2.0-snapshot-f4f1f70.jar.sha1 @@ -0,0 +1 @@ +7bb7c539172dc3513d4f34e7f29d2cd3a0352361 \ No newline at end of file diff --git a/server/licenses/lucene-spatial-extras-9.1.0.jar.sha1 b/server/licenses/lucene-spatial-extras-9.1.0.jar.sha1 deleted file mode 100644 index 7078cbc05ff..00000000000 --- a/server/licenses/lucene-spatial-extras-9.1.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -94d7d107c399cd11d407b94fa62f5677fe86f63b \ No newline at end of file diff --git a/server/licenses/lucene-spatial-extras-9.2.0-snapshot-f4f1f70.jar.sha1 b/server/licenses/lucene-spatial-extras-9.2.0-snapshot-f4f1f70.jar.sha1 new file mode 100644 index 00000000000..8cf21bea020 --- /dev/null +++ b/server/licenses/lucene-spatial-extras-9.2.0-snapshot-f4f1f70.jar.sha1 @@ -0,0 +1 @@ +7bc2f2e37f866e3b376f083e4b7cc89a8cb45fd0 \ No newline at end of file diff --git a/server/licenses/lucene-spatial3d-9.1.0.jar.sha1 b/server/licenses/lucene-spatial3d-9.1.0.jar.sha1 deleted file mode 100644 index 604e8ed054a..00000000000 --- a/server/licenses/lucene-spatial3d-9.1.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -7717b300bc14dfa9eb4b7d5970d8e25a60010e64 \ No newline at end of file diff --git a/server/licenses/lucene-spatial3d-9.2.0-snapshot-f4f1f70.jar.sha1 b/server/licenses/lucene-spatial3d-9.2.0-snapshot-f4f1f70.jar.sha1 new file mode 100644 index 00000000000..1407cc666b3 --- /dev/null +++ b/server/licenses/lucene-spatial3d-9.2.0-snapshot-f4f1f70.jar.sha1 @@ -0,0 +1 @@ +a5f79bb1f8337dbe6fc50fc5abd46d4eaaf4d433 \ No newline at end of file diff --git a/server/licenses/lucene-suggest-9.1.0.jar.sha1 b/server/licenses/lucene-suggest-9.1.0.jar.sha1 deleted file mode 100644 index 4562a197066..00000000000 --- a/server/licenses/lucene-suggest-9.1.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -957fca507eba94dbc3ef0d02377839be49bbe619 \ No newline at end of file diff --git a/server/licenses/lucene-suggest-9.2.0-snapshot-f4f1f70.jar.sha1 b/server/licenses/lucene-suggest-9.2.0-snapshot-f4f1f70.jar.sha1 new file mode 100644 index 00000000000..30772395b4c --- /dev/null +++ b/server/licenses/lucene-suggest-9.2.0-snapshot-f4f1f70.jar.sha1 @@ -0,0 +1 @@ +9e74f66171ea215e8c4936588381c0950c290c80 \ No newline at end of file diff --git a/server/src/main/java/org/opensearch/Version.java b/server/src/main/java/org/opensearch/Version.java index e68305df208..ad3546b2498 100644 --- a/server/src/main/java/org/opensearch/Version.java +++ b/server/src/main/java/org/opensearch/Version.java @@ -83,7 +83,7 @@ public class Version implements Comparable, 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 { diff --git a/server/src/test/java/org/opensearch/common/lucene/uid/VersionsTests.java b/server/src/test/java/org/opensearch/common/lucene/uid/VersionsTests.java index dace484f80c..8b22ff56e9a 100644 --- a/server/src/test/java/org/opensearch/common/lucene/uid/VersionsTests.java +++ b/server/src/test/java/org/opensearch/common/lucene/uid/VersionsTests.java @@ -224,7 +224,7 @@ public class VersionsTests extends OpenSearchTestCase { 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); } } diff --git a/server/src/test/java/org/opensearch/search/query/QueryProfilePhaseTests.java b/server/src/test/java/org/opensearch/search/query/QueryProfilePhaseTests.java index dfa41edb5cf..1b168e7d5b1 100644 --- a/server/src/test/java/org/opensearch/search/query/QueryProfilePhaseTests.java +++ b/server/src/test/java/org/opensearch/search/query/QueryProfilePhaseTests.java @@ -127,7 +127,7 @@ public class QueryProfilePhaseTests extends IndexShardTestCase { QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers()); assertEquals(1, context.queryResult().topDocs().topDocs.totalHits.value); - assertProfileData(context, "MatchAllDocsQuery", query -> { + 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)); @@ -157,7 +157,7 @@ public class QueryProfilePhaseTests extends IndexShardTestCase { assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); }, (query) -> { - assertThat(query.getQueryName(), equalTo("MatchAllDocsQuery")); + 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)); @@ -239,7 +239,9 @@ public class QueryProfilePhaseTests extends IndexShardTestCase { context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers()); 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)); @@ -387,7 +389,9 @@ public class QueryProfilePhaseTests extends IndexShardTestCase { 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)); @@ -463,27 +467,40 @@ public class QueryProfilePhaseTests extends IndexShardTestCase { 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 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)); @@ -571,7 +588,9 @@ public class QueryProfilePhaseTests extends IndexShardTestCase { 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)); @@ -605,7 +624,9 @@ public class QueryProfilePhaseTests extends IndexShardTestCase { 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)); @@ -623,7 +644,9 @@ public class QueryProfilePhaseTests extends IndexShardTestCase { 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)); @@ -640,7 +663,9 @@ public class QueryProfilePhaseTests extends IndexShardTestCase { 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)); @@ -695,7 +720,9 @@ public class QueryProfilePhaseTests extends IndexShardTestCase { 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)); @@ -806,7 +833,9 @@ public class QueryProfilePhaseTests extends IndexShardTestCase { 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));