Browse Source

Varchar index name compatible with 2.2.12 (#572)

Signed-off-by: yhmo <yihua.mo@zilliz.com>
groot 1 year ago
parent
commit
d98689b5d0
2 changed files with 7 additions and 3 deletions
  1. 2 2
      docker-compose.yml
  2. 5 1
      src/main/java/io/milvus/param/index/CreateIndexParam.java

+ 2 - 2
docker-compose.yml

@@ -31,7 +31,7 @@ services:
 
   standalone:
     container_name: milvus-javasdk-test-standalone
-    image: milvusdb/milvus:v2.2.10
+    image: milvusdb/milvus:v2.2.11
     command: ["milvus", "run", "standalone"]
     environment:
       ETCD_ENDPOINTS: etcd:2379
@@ -75,7 +75,7 @@ services:
 
   standaloneslave:
     container_name: milvus-javasdk-test-slave-standalone
-    image: milvusdb/milvus:v2.2.10
+    image: milvusdb/milvus:v2.2.11
     command: ["milvus", "run", "standalone"]
     environment:
       ETCD_ENDPOINTS: etcdslave:2379

+ 5 - 1
src/main/java/io/milvus/param/index/CreateIndexParam.java

@@ -56,7 +56,11 @@ public class CreateIndexParam {
         this.indexName = builder.indexName;
         this.indexType = builder.indexType;
         if (builder.indexType != IndexType.INVALID) {
-            this.extraParam.put(Constant.INDEX_TYPE, builder.indexType.name());
+            String indexName = builder.indexType.name();
+            if (builder.indexType == IndexType.TRIE) {
+                indexName = "Trie"; // from v2.2.12, the server side requires "Trie"
+            }
+            this.extraParam.put(Constant.INDEX_TYPE, indexName);
         }
         if (builder.metricType != MetricType.INVALID) {
             this.extraParam.put(Constant.METRIC_TYPE, builder.metricType.name());