summaryrefslogtreecommitdiffstats
path: root/container-search/src/test/java/com/yahoo/search/searchers/ValidateNearestNeighborTestCase.java
diff options
context:
space:
mode:
Diffstat (limited to 'container-search/src/test/java/com/yahoo/search/searchers/ValidateNearestNeighborTestCase.java')
-rw-r--r--container-search/src/test/java/com/yahoo/search/searchers/ValidateNearestNeighborTestCase.java19
1 files changed, 15 insertions, 4 deletions
diff --git a/container-search/src/test/java/com/yahoo/search/searchers/ValidateNearestNeighborTestCase.java b/container-search/src/test/java/com/yahoo/search/searchers/ValidateNearestNeighborTestCase.java
index b8be0b3dd43..9a7e3915d19 100644
--- a/container-search/src/test/java/com/yahoo/search/searchers/ValidateNearestNeighborTestCase.java
+++ b/container-search/src/test/java/com/yahoo/search/searchers/ValidateNearestNeighborTestCase.java
@@ -33,7 +33,7 @@ public class ValidateNearestNeighborTestCase {
searcher = new ValidateNearestNeighborSearcher(
ConfigGetter.getConfig(AttributesConfig.class,
"raw:" +
- "attribute[5]\n" +
+ "attribute[9]\n" +
"attribute[0].name simple\n" +
"attribute[0].datatype INT32\n" +
"attribute[1].name dvector\n" +
@@ -56,7 +56,10 @@ public class ValidateNearestNeighborTestCase {
"attribute[6].tensortype tensor(x[3])\n" +
"attribute[7].name threetypes\n" +
"attribute[7].datatype TENSOR\n" +
- "attribute[7].tensortype tensor(x{})\n"
+ "attribute[7].tensortype tensor(x{})\n" +
+ "attribute[8].name mixeddvector\n" +
+ "attribute[8].datatype TENSOR\n" +
+ "attribute[8].tensortype tensor(a{},x[3])\n"
));
}
@@ -134,6 +137,14 @@ public class ValidateNearestNeighborTestCase {
assertNull(r.hits().getError());
}
+ @Test
+ void testvalidQueryMixedFieldTensor() {
+ String q = makeQuery("mixeddvector", "qvector");
+ Tensor t = makeTensor(tt_dense_dvector_3);
+ Result r = doSearch(searcher, q, t);
+ assertNull(r.hits().getError());
+ }
+
private static void assertErrMsg(String message, Result r) {
assertEquals(ErrorMessage.createIllegalQuery(message), r.hits().getError());
}
@@ -210,7 +221,7 @@ public class ValidateNearestNeighborTestCase {
String q = makeQuery("sparse", "qvector");
Tensor t = makeTensor(tt_sparse_vector_x);
Result r = doSearch(searcher, q, t);
- assertErrMsg(desc("sparse", "qvector", 1, "tensor type tensor(x{}) is not a dense vector"), r);
+ assertErrMsg(desc("sparse", "qvector", 1, "field type tensor(x{}) is not supported by nearest neighbor searcher"), r);
}
@Test
@@ -218,7 +229,7 @@ public class ValidateNearestNeighborTestCase {
String q = makeQuery("matrix", "qvector");
Tensor t = makeMatrix(tt_dense_matrix_xy);
Result r = doSearch(searcher, q, t);
- assertErrMsg(desc("matrix", "qvector", 1, "tensor type tensor(x[3],y[1]) is not a dense vector"), r);
+ assertErrMsg(desc("matrix", "qvector", 1, "field type tensor(x[3],y[1]) is not supported by nearest neighbor searcher"), r);
}
private static Result doSearch(ValidateNearestNeighborSearcher searcher, String yqlQuery, Tensor qTensor) {