From 65ad62296b1939d9bd6110393c21886ba3501d61 Mon Sep 17 00:00:00 2001 From: Aurelien FOUCRET Date: Wed, 17 Jul 2024 11:30:09 +0200 Subject: [PATCH] Fix test compilation error. --- .../index/mapper/BooleanScriptFieldTypeTests.java | 10 ++++++++++ .../index/mapper/DateScriptFieldTypeTests.java | 5 +++++ .../index/mapper/DoubleScriptFieldTypeTests.java | 5 +++++ .../index/mapper/GeoPointScriptFieldTypeTests.java | 5 +++++ .../index/mapper/IpScriptFieldTypeTests.java | 5 +++++ .../index/mapper/KeywordScriptFieldTypeTests.java | 5 +++++ .../index/mapper/LongScriptFieldTypeTests.java | 5 +++++ .../subphase/highlight/PlainHighlighterTests.java | 5 +++++ .../search/query/ScriptScoreQueryTests.java | 5 +++++ 9 files changed, 50 insertions(+) diff --git a/server/src/test/java/org/elasticsearch/index/mapper/BooleanScriptFieldTypeTests.java b/server/src/test/java/org/elasticsearch/index/mapper/BooleanScriptFieldTypeTests.java index 0cdc9568f1fac..1b4329a37297a 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/BooleanScriptFieldTypeTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/BooleanScriptFieldTypeTests.java @@ -142,6 +142,11 @@ public boolean needs_score() { return false; } + @Override + public boolean needs_termStatistics() { + return randomBoolean(); + } + @Override public ScoreScript newInstance(DocReader docReader) { return new ScoreScript(Map.of(), searchContext.lookup(), docReader) { @@ -165,6 +170,11 @@ public boolean needs_score() { return false; } + @Override + public boolean needs_termStatistics() { + return randomBoolean(); + } + @Override public ScoreScript newInstance(DocReader docReader) { return new ScoreScript(Map.of(), searchContext.lookup(), docReader) { diff --git a/server/src/test/java/org/elasticsearch/index/mapper/DateScriptFieldTypeTests.java b/server/src/test/java/org/elasticsearch/index/mapper/DateScriptFieldTypeTests.java index 3728943cae418..c25fd4a647eda 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/DateScriptFieldTypeTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/DateScriptFieldTypeTests.java @@ -233,6 +233,11 @@ public boolean needs_score() { return false; } + @Override + public boolean needs_termStatistics() { + return randomBoolean(); + } + @Override public ScoreScript newInstance(DocReader docReader) throws IOException { return new ScoreScript(Map.of(), searchContext.lookup(), docReader) { diff --git a/server/src/test/java/org/elasticsearch/index/mapper/DoubleScriptFieldTypeTests.java b/server/src/test/java/org/elasticsearch/index/mapper/DoubleScriptFieldTypeTests.java index 9547b4f9cb9a3..a11337f8ef9d5 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/DoubleScriptFieldTypeTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/DoubleScriptFieldTypeTests.java @@ -141,6 +141,11 @@ public boolean needs_score() { return false; } + @Override + public boolean needs_termStatistics() { + return randomBoolean(); + } + @Override public ScoreScript newInstance(DocReader docReader) { return new ScoreScript(Map.of(), searchContext.lookup(), docReader) { diff --git a/server/src/test/java/org/elasticsearch/index/mapper/GeoPointScriptFieldTypeTests.java b/server/src/test/java/org/elasticsearch/index/mapper/GeoPointScriptFieldTypeTests.java index 3289e46941a45..a70570e774eed 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/GeoPointScriptFieldTypeTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/GeoPointScriptFieldTypeTests.java @@ -150,6 +150,11 @@ public boolean needs_score() { return false; } + @Override + public boolean needs_termStatistics() { + return randomBoolean(); + } + @Override public ScoreScript newInstance(DocReader docReader) { return new ScoreScript(Map.of(), searchContext.lookup(), docReader) { diff --git a/server/src/test/java/org/elasticsearch/index/mapper/IpScriptFieldTypeTests.java b/server/src/test/java/org/elasticsearch/index/mapper/IpScriptFieldTypeTests.java index 4726424ada5f2..44f537c4b28ae 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/IpScriptFieldTypeTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/IpScriptFieldTypeTests.java @@ -155,6 +155,11 @@ public boolean needs_score() { return false; } + @Override + public boolean needs_termStatistics() { + return randomBoolean(); + } + @Override public ScoreScript newInstance(DocReader docReader) { return new ScoreScript(Map.of(), searchContext.lookup(), docReader) { diff --git a/server/src/test/java/org/elasticsearch/index/mapper/KeywordScriptFieldTypeTests.java b/server/src/test/java/org/elasticsearch/index/mapper/KeywordScriptFieldTypeTests.java index 6912194625bb7..a68e556e5d48f 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/KeywordScriptFieldTypeTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/KeywordScriptFieldTypeTests.java @@ -136,6 +136,11 @@ public boolean needs_score() { return false; } + @Override + public boolean needs_termStatistics() { + return randomBoolean(); + } + @Override public ScoreScript newInstance(DocReader docReader) { return new ScoreScript(Map.of(), searchContext.lookup(), docReader) { diff --git a/server/src/test/java/org/elasticsearch/index/mapper/LongScriptFieldTypeTests.java b/server/src/test/java/org/elasticsearch/index/mapper/LongScriptFieldTypeTests.java index 83b3dbe858471..b624d3a743957 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/LongScriptFieldTypeTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/LongScriptFieldTypeTests.java @@ -177,6 +177,11 @@ public boolean needs_score() { return false; } + @Override + public boolean needs_termStatistics() { + return randomBoolean(); + } + @Override public ScoreScript newInstance(DocReader docReader) { return new ScoreScript(Map.of(), searchContext.lookup(), docReader) { diff --git a/server/src/test/java/org/elasticsearch/search/fetch/subphase/highlight/PlainHighlighterTests.java b/server/src/test/java/org/elasticsearch/search/fetch/subphase/highlight/PlainHighlighterTests.java index a6c95efef9c46..415867d962ab0 100644 --- a/server/src/test/java/org/elasticsearch/search/fetch/subphase/highlight/PlainHighlighterTests.java +++ b/server/src/test/java/org/elasticsearch/search/fetch/subphase/highlight/PlainHighlighterTests.java @@ -134,6 +134,11 @@ public boolean needs_score() { return true; } + @Override + public boolean needs_termStatistics() { + return randomBoolean(); + } + @Override public ScoreScript newInstance(DocReader reader) throws IOException { return new ScoreScript(params, lookup, reader) { diff --git a/server/src/test/java/org/elasticsearch/search/query/ScriptScoreQueryTests.java b/server/src/test/java/org/elasticsearch/search/query/ScriptScoreQueryTests.java index 6fff108cfb5ce..728b9f3297684 100644 --- a/server/src/test/java/org/elasticsearch/search/query/ScriptScoreQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/query/ScriptScoreQueryTests.java @@ -177,6 +177,11 @@ public boolean needs_score() { return needsScore; } + @Override + public boolean needs_termStatistics() { + return randomBoolean(); + } + @Override public ScoreScript newInstance(DocReader docReader) { return new ScoreScript(script.getParams(), lookup, docReader) {