Skip to content

Commit a34fc89

Browse files
committed
Fix merge
1 parent e114453 commit a34fc89

File tree

1 file changed

+5
-25
lines changed

1 file changed

+5
-25
lines changed

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/VerifierTests.java

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,7 @@ public void testFullTextFunctionsOnlyAllowedInWhere() throws Exception {
13641364
checkFullTextFunctionsOnlyAllowedInWhere("MultiMatch", "multi_match(\"Meditation\", title, body)", "function");
13651365
}
13661366
if (EsqlCapabilities.Cap.KNN_FUNCTION.isEnabled()) {
1367-
checkFullTextFunctionsOnlyAllowedInWhere("KNN", "multi_match(\"Meditation\", title, body)", "function");
1367+
checkFullTextFunctionsOnlyAllowedInWhere("KNN", "knn(vector, [0, 1, 2])", "function");
13681368
}
13691369
}
13701370

@@ -2148,7 +2148,7 @@ public void testFullTextFunctionsNullArgs() throws Exception {
21482148
checkFullTextFunctionNullArgs("term(title, null)", "second");
21492149
}
21502150
if (EsqlCapabilities.Cap.KNN_FUNCTION.isEnabled()) {
2151-
checkFullTextFunctionNullArgs("knn(null, [0, 1, 2]])", "first");
2151+
checkFullTextFunctionNullArgs("knn(null, [0, 1, 2])", "first");
21522152
checkFullTextFunctionNullArgs("knn(vector, null)", "second");
21532153
}
21542154
}
@@ -2160,29 +2160,6 @@ private void checkFullTextFunctionNullArgs(String functionInvocation, String arg
21602160
);
21612161
}
21622162

2163-
public void testFullTextFunctionsConstantQuery() throws Exception {
2164-
testFullTextFunctionsConstantQuery("match(title, category)", "second");
2165-
testFullTextFunctionsConstantQuery("qstr(title)", "");
2166-
testFullTextFunctionsConstantQuery("kql(title)", "");
2167-
if (EsqlCapabilities.Cap.MULTI_MATCH_FUNCTION.isEnabled()) {
2168-
testFullTextFunctionsConstantQuery("multi_match(category, body)", "first");
2169-
testFullTextFunctionsConstantQuery("multi_match(concat(title, \"world\"), title)", "first");
2170-
}
2171-
if (EsqlCapabilities.Cap.TERM_FUNCTION.isEnabled()) {
2172-
testFullTextFunctionsConstantQuery("term(title, tags)", "second");
2173-
}
2174-
if (EsqlCapabilities.Cap.KNN_FUNCTION.isEnabled()) {
2175-
testFullTextFunctionsConstantQuery("knn(vector, vector)", "second");
2176-
}
2177-
}
2178-
2179-
private void testFullTextFunctionsConstantQuery(String functionInvocation, String argOrdinal) throws Exception {
2180-
assertThat(
2181-
error("from test | where " + functionInvocation, fullTextAnalyzer),
2182-
containsString(argOrdinal + " argument of [" + functionInvocation + "] must be a constant")
2183-
);
2184-
}
2185-
21862163
public void testFullTextFunctionsConstantQuery() throws Exception {
21872164
checkFullTextFunctionsConstantQuery("match(title, category)", "second");
21882165
checkFullTextFunctionsConstantQuery("qstr(title)", "");
@@ -2194,6 +2171,9 @@ public void testFullTextFunctionsConstantQuery() throws Exception {
21942171
if (EsqlCapabilities.Cap.TERM_FUNCTION.isEnabled()) {
21952172
checkFullTextFunctionsConstantQuery("term(title, tags)", "second");
21962173
}
2174+
if (EsqlCapabilities.Cap.KNN_FUNCTION.isEnabled()) {
2175+
checkFullTextFunctionsConstantQuery("knn(vector, vector)", "second");
2176+
}
21972177
}
21982178

21992179
private void checkFullTextFunctionsConstantQuery(String functionInvocation, String argOrdinal) throws Exception {

0 commit comments

Comments
 (0)