Browse Source

update py and js template

tumao 3 years ago
parent
commit
f3843fb879
2 changed files with 3 additions and 3 deletions
  1. 2 2
      client/src/utils/code/Js.ts
  2. 1 1
      client/src/utils/code/Py.ts

+ 2 - 2
client/src/utils/code/Js.ts

@@ -7,8 +7,8 @@ export const getCreateIndexJSCode = (params: CreateIndexCodeParam) => {
 const client = new MilvusClient(milvus_address)
 const client = new MilvusClient(milvus_address)
 
 
 client.indexManager.createIndex({
 client.indexManager.createIndex({
-  collection_name: ${collectionName},
-  field_name: ${fieldName},
+  collection_name: '${collectionName}',
+  field_name: '${fieldName}',
   extra_params: ${JSON.stringify(extraParams, null, 2)},
   extra_params: ${JSON.stringify(extraParams, null, 2)},
 });`;
 });`;
 
 

+ 1 - 1
client/src/utils/code/Py.ts

@@ -17,7 +17,7 @@ export const getCreateIndexPYCode = (params: CreateIndexCodeParam) => {
     ...obj,
     ...obj,
     params: parseValue(obj.params),
     params: parseValue(obj.params),
   };
   };
-  const pyCode = `from pymilvus_orm import Collection,
+  const pyCode = `from pymilvus_orm import Collection
 
 
 collection = Collection('${collectionName}')
 collection = Collection('${collectionName}')
 index = ${JSON.stringify(index, replacer, 4)}
 index = ${JSON.stringify(index, replacer, 4)}