diff --git a/muted-tests.yml b/muted-tests.yml index 7d23f9da16ec1..37fe718875ac6 100644 --- a/muted-tests.yml +++ b/muted-tests.yml @@ -427,9 +427,6 @@ tests: - class: org.elasticsearch.xpack.esql.expression.function.fulltext.ScoreTests method: testSerializationOfSimple {TestCase=} issue: https://github.com/elastic/elasticsearch/issues/131334 -- class: org.elasticsearch.xpack.esql.analysis.VerifierTests - method: testFullTextFunctionsOnlyAllowedInWhere - issue: https://github.com/elastic/elasticsearch/issues/131335 - class: org.elasticsearch.xpack.esql.analysis.VerifierTests method: testMatchInsideEval issue: https://github.com/elastic/elasticsearch/issues/131336 diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/VerifierTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/VerifierTests.java index b44e7e8c990d0..4951479514b72 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/VerifierTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/VerifierTests.java @@ -1213,7 +1213,9 @@ public void testWeightedAvg() { public void testMatchInsideEval() throws Exception { assertEquals( - "1:36: [:] operator is only supported in WHERE and STATS commands, or in EVAL within score(.) function\n" + "1:36: [:] operator is only supported in WHERE and STATS commands" + + (EsqlCapabilities.Cap.SCORE_FUNCTION.isEnabled() ? ", or in EVAL within score(.) function" : "") + + "\n" + "line 1:36: [:] operator cannot operate on [title], which is not a field from an index mapping", error("row title = \"brown fox\" | eval x = title:\"fox\" ") ); @@ -1385,7 +1387,8 @@ private void checkFullTextFunctionsOnlyAllowedInWhere(String functionName, Strin + functionName + "] " + functionType - + " is only supported in WHERE and STATS commands, or in EVAL within score(.) function" + + " is only supported in WHERE and STATS commands" + + (EsqlCapabilities.Cap.SCORE_FUNCTION.isEnabled() ? ", or in EVAL within score(.) function" : "") ) ); assertThat( @@ -1400,7 +1403,14 @@ private void checkFullTextFunctionsOnlyAllowedInWhere(String functionName, Strin if ("KQL".equals(functionName) || "QSTR".equals(functionName)) { assertThat( error("row a = " + functionInvocation, fullTextAnalyzer), - containsString("[" + functionName + "] " + functionType + " is only supported in WHERE and STATS commands") + containsString( + "[" + + functionName + + "] " + + functionType + + " is only supported in WHERE and STATS commands" + + (EsqlCapabilities.Cap.SCORE_FUNCTION.isEnabled() ? ", or in EVAL within score(.) function" : "") + ) ); } }