Skip to content

Commit 75ed988

Browse files
committed
More CSV tests 🎉
1 parent 1d1cc3a commit 75ed988

File tree

1 file changed

+43
-2
lines changed

1 file changed

+43
-2
lines changed

x-pack/plugin/esql/qa/testFixtures/src/main/resources/text-embedding.csv-spec

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
text_embedding using a ROW source operator
1+
text_embedding using a row source operator
22
required_capability: text_embedding_function
33
required_capability: dense_vector_field_type
44

@@ -11,7 +11,7 @@ Who is Victor Hugo? | [56.0, 50.0, 48.0]
1111
;
1212

1313

14-
text_embedding using a ROW source operator with query build using CONCAT
14+
text_embedding using a row source operator with query build using CONCAT
1515
required_capability: text_embedding_function
1616
required_capability: dense_vector_field_type
1717

@@ -22,3 +22,44 @@ ROW input="Who is Victor Hugo?"
2222
input:keyword | embedding:dense_vector
2323
Who is Victor Hugo? | [56.0, 50.0, 48.0]
2424
;
25+
26+
27+
text_embedding with knn on semantic_text_dense_field
28+
required_capability: text_embedding_function
29+
required_capability: dense_vector_field_type
30+
required_capability: knn_function_v5
31+
required_capability: semantic_text_field_caps
32+
33+
FROM semantic_text METADATA _score
34+
| EVAL query_embedding = TEXT_EMBEDDING("be excellent to each other", "test_dense_inference")
35+
| WHERE KNN(semantic_text_dense_field, query_embedding)
36+
| KEEP semantic_text_field, query_embedding, _score
37+
| EVAL _score = ROUND(_score, 4)
38+
| SORT _score DESC
39+
| LIMIT 10
40+
;
41+
42+
semantic_text_field:text | query_embedding:dense_vector | _score:double
43+
be excellent to each other | [45.0, 55.0, 54.0] | 1.0
44+
live long and prosper | [45.0, 55.0, 54.0] | 0.0295
45+
all we have to decide is what to do with the time that is given to us | [45.0, 55.0, 54.0] | 0.0214
46+
47+
text_embedding with knn (inline) on semantic_text_dense_field
48+
required_capability: text_embedding_function
49+
required_capability: dense_vector_field_type
50+
required_capability: knn_function_v5
51+
required_capability: semantic_text_field_caps
52+
53+
FROM semantic_text METADATA _score
54+
| WHERE KNN(semantic_text_dense_field, TEXT_EMBEDDING("be excellent to each other", "test_dense_inference"))
55+
| KEEP semantic_text_field, _score
56+
| EVAL _score = ROUND(_score, 4)
57+
| SORT _score DESC
58+
| LIMIT 10
59+
;
60+
61+
semantic_text_field:text | _score:double
62+
be excellent to each other | 1.0
63+
live long and prosper | 0.0295
64+
all we have to decide is what to do with the time that is given to us | 0.0214
65+
;

0 commit comments

Comments
 (0)