Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,6 @@ tests:
- class: org.elasticsearch.xpack.esql.expression.function.fulltext.ScoreTests
method: testSerializationOfSimple {TestCase=<boolean>}
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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\" ")
);
Expand Down Expand Up @@ -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(
Expand All @@ -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" : "")
)
);
}
}
Expand Down