Skip to content

Commit aa55b16

Browse files
committed
iter
1 parent bdc68f6 commit aa55b16

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

server/src/test/java/org/elasticsearch/search/vectors/KnnSearchBuilderTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ protected KnnSearchBuilder createTestInstance() {
113113

114114
@Override
115115
protected KnnSearchBuilder mutateInstance(KnnSearchBuilder instance) {
116-
return switch (random().nextInt(9)) {
116+
return switch (IVF_FORMAT.isEnabled() ? random().nextInt(9) : random().nextInt(8)) {
117117
case 0 -> {
118118
String newField = randomValueOtherThan(instance.field, () -> randomAlphaOfLength(5));
119119
yield new KnnSearchBuilder(

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ public class KnnSemanticTextTestCase extends ESRestTestCase {
3737

3838
@Before
3939
public void checkCapability() {
40-
assumeTrue("knn with semantic text not available", EsqlCapabilities.Cap.KNN_FUNCTION_V5.isEnabled());
40+
// TODO: not sure why this doesn't work??
41+
// assumeTrue("knn with semantic text not available", EsqlCapabilities.Cap.KNN_FUNCTION_V5.isEnabled());
4142
}
4243

4344
@SuppressWarnings("unchecked")
4445
public void testKnnQueryWithSemanticText() throws IOException {
46+
assumeTrue("knn with semantic text not available", EsqlCapabilities.Cap.KNN_FUNCTION_V5.isEnabled());
4547
String knnQuery = """
4648
FROM semantic-test METADATA _score
4749
| WHERE knn(dense_semantic, [0, 1, 2])
@@ -63,6 +65,7 @@ public void testKnnQueryWithSemanticText() throws IOException {
6365
}
6466

6567
public void testKnnQueryOnTextField() throws IOException {
68+
assumeTrue("knn with semantic text not available", EsqlCapabilities.Cap.KNN_FUNCTION_V5.isEnabled());
6669
String knnQuery = """
6770
FROM semantic-test METADATA _score
6871
| WHERE knn(text, [0, 1, 2])
@@ -77,6 +80,7 @@ public void testKnnQueryOnTextField() throws IOException {
7780
}
7881

7982
public void testKnnQueryOnSparseSemanticTextField() throws IOException {
83+
assumeTrue("knn with semantic text not available", EsqlCapabilities.Cap.KNN_FUNCTION_V5.isEnabled());
8084
String knnQuery = """
8185
FROM semantic-test METADATA _score
8286
| WHERE knn(sparse_semantic, [0, 1, 2])

0 commit comments

Comments
 (0)