Skip to content

Commit 56fcea6

Browse files
committed
Add a dense_vector_text CSV datasets.
1 parent a6ba5c6 commit 56fcea6

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

x-pack/plugin/esql/qa/testFixtures/src/main/java/org/elasticsearch/xpack/esql/CsvTestsDataLoader.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ public class CsvTestsDataLoader {
170170
private static final TestDataset BOOKS = new TestDataset("books").withSetting("books-settings.json");
171171
private static final TestDataset SEMANTIC_TEXT = new TestDataset("semantic_text").withInferenceEndpoint(true);
172172
private static final TestDataset LOGS = new TestDataset("logs");
173+
private static final TestDataset DENSE_VECTOR_TEXT = new TestDataset("dense_vector_text");
173174
private static final TestDataset MV_TEXT = new TestDataset("mv_text");
174175
private static final TestDataset DENSE_VECTOR = new TestDataset("dense_vector");
175176
private static final TestDataset COLORS = new TestDataset("colors");
@@ -243,6 +244,7 @@ public class CsvTestsDataLoader {
243244
Map.entry(BOOKS.indexName, BOOKS),
244245
Map.entry(SEMANTIC_TEXT.indexName, SEMANTIC_TEXT),
245246
Map.entry(LOGS.indexName, LOGS),
247+
Map.entry(DENSE_VECTOR_TEXT.indexName, DENSE_VECTOR_TEXT),
246248
Map.entry(MV_TEXT.indexName, MV_TEXT),
247249
Map.entry(DENSE_VECTOR.indexName, DENSE_VECTOR),
248250
Map.entry(COLORS.indexName, COLORS),
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
_id:keyword,text_field:semantic_text,text_embedding_field:dense_vector
2+
1,live long and prosper,[50.0, 57.0, 56.0]
3+
2,all we have to decide is what to do with the time that is given to us, [45.0, 49.0, 57.0]
4+
3,be excellent to each other,[45.0, 55.0, 54.0]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"properties": {
3+
"text_field": {
4+
"type": "text"
5+
},
6+
"text_embedding_field": {
7+
"type": "dense_vector",
8+
"dims": 3,
9+
"similarity": "l2_norm"
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)