|
@@ -1762,7 +1762,7 @@ class MilvusServiceClientTest {
|
|
|
.withCollectionName("collection1")
|
|
|
.withPartitionNames(partitions)
|
|
|
.addPartitionName("p2")
|
|
|
- .withParams("dummy")
|
|
|
+ .withParams("{}")
|
|
|
.withOutFields(outputFields)
|
|
|
.withVectorFieldName("field1")
|
|
|
.withMetricType(MetricType.IP)
|
|
@@ -1777,7 +1777,7 @@ class MilvusServiceClientTest {
|
|
|
.withCollectionName("collection1")
|
|
|
.withPartitionNames(partitions)
|
|
|
.addPartitionName("p2")
|
|
|
- .withParams("dummy")
|
|
|
+ .withParams("{}")
|
|
|
.withOutFields(outputFields)
|
|
|
.withVectorFieldName("field1")
|
|
|
.withMetricType(MetricType.IP)
|
|
@@ -1793,7 +1793,7 @@ class MilvusServiceClientTest {
|
|
|
.withCollectionName("collection1")
|
|
|
.withPartitionNames(partitions)
|
|
|
.addPartitionName("p2")
|
|
|
- .withParams("dummy")
|
|
|
+ .withParams("{}")
|
|
|
.withOutFields(outputFields)
|
|
|
.withVectorFieldName("field1")
|
|
|
.withMetricType(MetricType.IP)
|
|
@@ -1810,7 +1810,7 @@ class MilvusServiceClientTest {
|
|
|
assertThrows(ParamException.class, () -> SearchParam.newBuilder()
|
|
|
.withCollectionName("")
|
|
|
.withPartitionNames(partitions)
|
|
|
- .withParams("dummy")
|
|
|
+ .withParams("{}")
|
|
|
.withOutFields(outputFields)
|
|
|
.withVectorFieldName("field1")
|
|
|
.withMetricType(MetricType.IP)
|
|
@@ -1824,7 +1824,7 @@ class MilvusServiceClientTest {
|
|
|
assertThrows(ParamException.class, () -> SearchParam.newBuilder()
|
|
|
.withCollectionName("collection1")
|
|
|
.withPartitionNames(partitions)
|
|
|
- .withParams("dummy")
|
|
|
+ .withParams("{}")
|
|
|
.withOutFields(outputFields)
|
|
|
.withVectorFieldName("")
|
|
|
.withMetricType(MetricType.IP)
|
|
@@ -1838,7 +1838,7 @@ class MilvusServiceClientTest {
|
|
|
assertThrows(ParamException.class, () -> SearchParam.newBuilder()
|
|
|
.withCollectionName("collection1")
|
|
|
.withPartitionNames(partitions)
|
|
|
- .withParams("dummy")
|
|
|
+ .withParams("{}")
|
|
|
.withOutFields(outputFields)
|
|
|
.withVectorFieldName("field1")
|
|
|
.withMetricType(MetricType.INVALID)
|
|
@@ -1852,7 +1852,7 @@ class MilvusServiceClientTest {
|
|
|
assertThrows(ParamException.class, () -> SearchParam.newBuilder()
|
|
|
.withCollectionName("collection1")
|
|
|
.withPartitionNames(partitions)
|
|
|
- .withParams("dummy")
|
|
|
+ .withParams("{}")
|
|
|
.withOutFields(outputFields)
|
|
|
.withVectorFieldName("field1")
|
|
|
.withMetricType(MetricType.IP)
|
|
@@ -1867,7 +1867,7 @@ class MilvusServiceClientTest {
|
|
|
assertThrows(ParamException.class, () -> SearchParam.newBuilder()
|
|
|
.withCollectionName("collection1")
|
|
|
.withPartitionNames(partitions)
|
|
|
- .withParams("dummy")
|
|
|
+ .withParams("{}")
|
|
|
.withOutFields(outputFields)
|
|
|
.withVectorFieldName("field1")
|
|
|
.withMetricType(MetricType.IP)
|
|
@@ -1882,7 +1882,7 @@ class MilvusServiceClientTest {
|
|
|
assertThrows(ParamException.class, () -> SearchParam.newBuilder()
|
|
|
.withCollectionName("collection1")
|
|
|
.withPartitionNames(partitions)
|
|
|
- .withParams("dummy")
|
|
|
+ .withParams("{}")
|
|
|
.withOutFields(outputFields)
|
|
|
.withVectorFieldName("field1")
|
|
|
.withMetricType(MetricType.IP)
|
|
@@ -1898,7 +1898,7 @@ class MilvusServiceClientTest {
|
|
|
assertThrows(ParamException.class, () -> SearchParam.newBuilder()
|
|
|
.withCollectionName("collection1")
|
|
|
.withPartitionNames(partitions)
|
|
|
- .withParams("dummy")
|
|
|
+ .withParams("{}")
|
|
|
.withOutFields(outputFields)
|
|
|
.withVectorFieldName("field1")
|
|
|
.withMetricType(MetricType.IP)
|
|
@@ -1918,7 +1918,7 @@ class MilvusServiceClientTest {
|
|
|
assertThrows(ParamException.class, () -> SearchParam.newBuilder()
|
|
|
.withCollectionName("collection1")
|
|
|
.withPartitionNames(partitions)
|
|
|
- .withParams("dummy")
|
|
|
+ .withParams("{}")
|
|
|
.withOutFields(outputFields)
|
|
|
.withVectorFieldName("field1")
|
|
|
.withMetricType(MetricType.HAMMING)
|
|
@@ -1933,7 +1933,7 @@ class MilvusServiceClientTest {
|
|
|
assertThrows(ParamException.class, () -> SearchParam.newBuilder()
|
|
|
.withCollectionName("collection1")
|
|
|
.withPartitionNames(partitions)
|
|
|
- .withParams("dummy")
|
|
|
+ .withParams("{}")
|
|
|
.withOutFields(outputFields)
|
|
|
.withVectorFieldName("field1")
|
|
|
.withMetricType(MetricType.JACCARD)
|
|
@@ -1948,7 +1948,7 @@ class MilvusServiceClientTest {
|
|
|
assertThrows(ParamException.class, () -> SearchParam.newBuilder()
|
|
|
.withCollectionName("collection1")
|
|
|
.withPartitionNames(partitions)
|
|
|
- .withParams("dummy")
|
|
|
+ .withParams("{}")
|
|
|
.withOutFields(outputFields)
|
|
|
.withVectorFieldName("field1")
|
|
|
.withMetricType(MetricType.IP)
|
|
@@ -1962,7 +1962,7 @@ class MilvusServiceClientTest {
|
|
|
assertDoesNotThrow(() -> SearchParam.newBuilder()
|
|
|
.withCollectionName("collection1")
|
|
|
.withPartitionNames(partitions)
|
|
|
- .withParams("dummy")
|
|
|
+ .withParams("{}")
|
|
|
.withOutFields(outputFields)
|
|
|
.withVectorFieldName("field1")
|
|
|
.withMetricType(MetricType.L2)
|
|
@@ -1976,7 +1976,7 @@ class MilvusServiceClientTest {
|
|
|
assertDoesNotThrow(() -> SearchParam.newBuilder()
|
|
|
.withCollectionName("collection1")
|
|
|
.withPartitionNames(partitions)
|
|
|
- .withParams("dummy")
|
|
|
+ .withParams("{}")
|
|
|
.withOutFields(outputFields)
|
|
|
.withVectorFieldName("field1")
|
|
|
.withMetricType(MetricType.HAMMING)
|
|
@@ -1985,6 +1985,20 @@ class MilvusServiceClientTest {
|
|
|
.withExpr("dummy")
|
|
|
.build()
|
|
|
);
|
|
|
+
|
|
|
+ // param is not json format
|
|
|
+ assertDoesNotThrow(() -> SearchParam.newBuilder()
|
|
|
+ .withCollectionName("collection1")
|
|
|
+ .withPartitionNames(partitions)
|
|
|
+ .withParams("dummy")
|
|
|
+ .withOutFields(outputFields)
|
|
|
+ .withVectorFieldName("field1")
|
|
|
+ .withMetricType(MetricType.L2)
|
|
|
+ .withTopK(5)
|
|
|
+ .withVectors(vectors2)
|
|
|
+ .withExpr("dummy")
|
|
|
+ .build()
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
@Test
|
|
@@ -1998,7 +2012,7 @@ class MilvusServiceClientTest {
|
|
|
SearchParam param = SearchParam.newBuilder()
|
|
|
.withCollectionName("collection1")
|
|
|
.withPartitionNames(partitions)
|
|
|
- .withParams("dummy")
|
|
|
+ .withParams("{}")
|
|
|
.withOutFields(outputFields)
|
|
|
.addOutField("f2")
|
|
|
.withVectorFieldName("field1")
|
|
@@ -2020,7 +2034,7 @@ class MilvusServiceClientTest {
|
|
|
param = SearchParam.newBuilder()
|
|
|
.withCollectionName("collection1")
|
|
|
.withPartitionNames(partitions)
|
|
|
- .withParams("dummy")
|
|
|
+ .withParams("{}")
|
|
|
.withOutFields(outputFields)
|
|
|
.withVectorFieldName("field1")
|
|
|
.withMetricType(MetricType.HAMMING)
|