Skip to content

Commit 3cf742e

Browse files
committed
Add comments
1 parent 37b540c commit 3cf742e

File tree

2 files changed

+4
-0
lines changed
  • x-pack/plugin/esql

2 files changed

+4
-0
lines changed

x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/KnnSemanticTextTestCase.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
import static org.hamcrest.Matchers.is;
2828
import static org.hamcrest.core.StringContains.containsString;
2929

30+
/**
31+
* Tests kNN queries on semantic_text fields. Mostly checks errors on the data node that can't be checked in other tests.
32+
*/
3033
public class KnnSemanticTextTestCase extends ESRestTestCase {
3134

3235
@Rule(order = Integer.MIN_VALUE)

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/vector/Knn.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ protected TypeResolution resolveParams() {
213213

214214
private TypeResolution resolveField() {
215215
return isNotNull(field(), sourceText(), FIRST).and(
216+
// It really should be semantic_text instead of text, but field_caps retrieves semantic_text fields as text
216217
isType(field(), dt -> dt == TEXT, sourceText(), FIRST, ACCEPTED_FIELD_TYPES).or(
217218
isType(field(), dt -> dt == DENSE_VECTOR, sourceText(), FIRST, ACCEPTED_FIELD_TYPES)
218219
)

0 commit comments

Comments
 (0)