-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Milvus-doc-bot
authored and
Milvus-doc-bot
committed
Nov 13, 2024
1 parent
7db21fd
commit 40ab106
Showing
4 changed files
with
8 additions
and
8 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
localization/v2.4.x/site/en/userGuide/manage-indexes/index-scalar-fields.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"codeList":["# Auto indexing\nclient = MilvusClient(\n uri=\"http://localhost:19530\"\n)\n\nindex_params = client.create_index_params() # Prepare an empty IndexParams object, without having to specify any index parameters\n\nindex_params.add_index(\n field_name=\"scalar_1\", # Name of the scalar field to be indexed\n index_type=\"\", # Type of index to be created. For auto indexing, leave it empty or omit this parameter.\n index_name=\"default_index\" # Name of the index to be created\n)\n\nclient.create_index(\n collection_name=\"test_scalar_index\", # Specify the collection name\n index_params=index_params\n)\n","import io.milvus.v2.common.IndexParam;\nimport io.milvus.v2.service.index.request.CreateIndexReq;\n\nIndexParam indexParamForScalarField = IndexParam.builder()\n .fieldName(\"scalar_1\") // Name of the scalar field to be indexed\n .indexName(\"default_index\") // Name of the index to be created\n .indexType(\"\") // Type of index to be created. For auto indexing, leave it empty or omit this parameter.\n .build();\n\nList<IndexParam> indexParams = new ArrayList<>();\nindexParams.add(indexParamForVectorField);\n\nCreateIndexReq createIndexReq = CreateIndexReq.builder()\n .collectionName(\"test_scalar_index\") // Specify the collection name\n .indexParams(indexParams)\n .build();\n\nclient.createIndex(createIndexReq);\n","await client.createIndex({\n collection_name: \"test_scalar_index\", // Specify the collection name\n field_name: \"scalar_1\", // Name of the scalar field to be indexed\n index_name: \"default_index\", // Name of the index to be created\n index_type: \"\" // Type of index to be created. For auto indexing, leave it empty or omit this parameter.\n})\n","index_params = client.create_index_params() # Prepare an IndexParams object\n\nindex_params.add_index(\n field_name=\"scalar_2\", # Name of the scalar field to be indexed\n index_type=\"INVERTED\", # Type of index to be created\n index_name=\"inverted_index\" # Name of the index to be created\n)\n\nclient.create_index(\n collection_name=\"test_scalar_index\", # Specify the collection name\n index_params=index_params\n)\n","import io.milvus.v2.common.IndexParam;\nimport io.milvus.v2.service.index.request.CreateIndexReq;\n\nIndexParam indexParamForScalarField = IndexParam.builder()\n .fieldName(\"scalar_1\") // Name of the scalar field to be indexed\n .indexName(\"inverted_index\") // Name of the index to be created\n .indexType(\"INVERTED\") // Type of index to be created\n .build();\n\nList<IndexParam> indexParams = new ArrayList<>();\nindexParams.add(indexParamForVectorField);\n\nCreateIndexReq createIndexReq = CreateIndexReq.builder()\n .collectionName(\"test_scalar_index\") // Specify the collection name\n .indexParams(indexParams)\n .build();\n\nclient.createIndex(createIndexReq);\n","await client.createIndex({\n collection_name: \"test_scalar_index\", // Specify the collection name\n field_name: \"scalar_1\", // Name of the scalar field to be indexed\n index_name: \"inverted_index\", // Name of the index to be created\n index_type: \"INVERTED\" // Type of index to be created\n})\n","client.list_indexes(\n collection_name=\"test_scalar_index\" # Specify the collection name\n)\n\n# Output:\n# ['default_index','inverted_index']\n","import java.util.List;\nimport io.milvus.v2.service.index.request.ListIndexesReq;\n\nListIndexesReq listIndexesReq = ListIndexesReq.builder()\n .collectionName(\"test_scalar_index\") // Specify the collection name\n .build();\n\nList<String> indexNames = client.listIndexes(listIndexesReq);\n\nSystem.out.println(indexNames);\n\n// Output:\n// [\n// \"default_index\",\n// \"inverted_index\"\n// ]\n","res = await client.listIndexes({\n collection_name: 'test_scalar_index'\n})\n\nconsole.log(res.indexes)\n\n// Output:\n// [\n// \"default_index\",\n// \"inverted_index\"\n// ] \n"],"headingContent":"Index Scalar Fields","anchorList":[{"label":"Index Scalar Fields","href":"Index-Scalar-Fields","type":1,"isActive":false},{"label":"Types of scalar indexing","href":"Types-of-scalar-indexing","type":2,"isActive":false},{"label":"Auto indexing","href":"Auto-indexing","type":2,"isActive":false},{"label":"Custom indexing","href":"Custom-indexing","type":2,"isActive":false},{"label":"Verifying the result","href":"Verifying-the-result","type":2,"isActive":false},{"label":"Limits","href":"Limits","type":2,"isActive":false}]} | ||
{"codeList":["# Auto indexing\nclient = MilvusClient(\n uri=\"http://localhost:19530\"\n)\n\nindex_params = MilvusClient.prepare_index_params() # Prepare an empty IndexParams object, without having to specify any index parameters\n\nindex_params.add_index(\n field_name=\"scalar_1\", # Name of the scalar field to be indexed\n index_type=\"\", # Type of index to be created. For auto indexing, leave it empty or omit this parameter.\n index_name=\"default_index\" # Name of the index to be created\n)\n\nclient.create_index(\n collection_name=\"test_scalar_index\", # Specify the collection name\n index_params=index_params\n)\n","import io.milvus.v2.common.IndexParam;\nimport io.milvus.v2.service.index.request.CreateIndexReq;\n\nIndexParam indexParamForScalarField = IndexParam.builder()\n .fieldName(\"scalar_1\") // Name of the scalar field to be indexed\n .indexName(\"default_index\") // Name of the index to be created\n .indexType(\"\") // Type of index to be created. For auto indexing, leave it empty or omit this parameter.\n .build();\n\nList<IndexParam> indexParams = new ArrayList<>();\nindexParams.add(indexParamForVectorField);\n\nCreateIndexReq createIndexReq = CreateIndexReq.builder()\n .collectionName(\"test_scalar_index\") // Specify the collection name\n .indexParams(indexParams)\n .build();\n\nclient.createIndex(createIndexReq);\n","await client.createIndex({\n collection_name: \"test_scalar_index\", // Specify the collection name\n field_name: \"scalar_1\", // Name of the scalar field to be indexed\n index_name: \"default_index\", // Name of the index to be created\n index_type: \"\" // Type of index to be created. For auto indexing, leave it empty or omit this parameter.\n})\n","index_params = MilvusClient.prepare_index_params() # Prepare an IndexParams object\n\nindex_params.add_index(\n field_name=\"scalar_2\", # Name of the scalar field to be indexed\n index_type=\"INVERTED\", # Type of index to be created\n index_name=\"inverted_index\" # Name of the index to be created\n)\n\nclient.create_index(\n collection_name=\"test_scalar_index\", # Specify the collection name\n index_params=index_params\n)\n","import io.milvus.v2.common.IndexParam;\nimport io.milvus.v2.service.index.request.CreateIndexReq;\n\nIndexParam indexParamForScalarField = IndexParam.builder()\n .fieldName(\"scalar_1\") // Name of the scalar field to be indexed\n .indexName(\"inverted_index\") // Name of the index to be created\n .indexType(\"INVERTED\") // Type of index to be created\n .build();\n\nList<IndexParam> indexParams = new ArrayList<>();\nindexParams.add(indexParamForVectorField);\n\nCreateIndexReq createIndexReq = CreateIndexReq.builder()\n .collectionName(\"test_scalar_index\") // Specify the collection name\n .indexParams(indexParams)\n .build();\n\nclient.createIndex(createIndexReq);\n","await client.createIndex({\n collection_name: \"test_scalar_index\", // Specify the collection name\n field_name: \"scalar_1\", // Name of the scalar field to be indexed\n index_name: \"inverted_index\", // Name of the index to be created\n index_type: \"INVERTED\" // Type of index to be created\n})\n","client.list_indexes(\n collection_name=\"test_scalar_index\" # Specify the collection name\n)\n\n# Output:\n# ['default_index','inverted_index']\n","import java.util.List;\nimport io.milvus.v2.service.index.request.ListIndexesReq;\n\nListIndexesReq listIndexesReq = ListIndexesReq.builder()\n .collectionName(\"test_scalar_index\") // Specify the collection name\n .build();\n\nList<String> indexNames = client.listIndexes(listIndexesReq);\n\nSystem.out.println(indexNames);\n\n// Output:\n// [\n// \"default_index\",\n// \"inverted_index\"\n// ]\n","res = await client.listIndexes({\n collection_name: 'test_scalar_index'\n})\n\nconsole.log(res.indexes)\n\n// Output:\n// [\n// \"default_index\",\n// \"inverted_index\"\n// ] \n"],"headingContent":"Index Scalar Fields","anchorList":[{"label":"Index Scalar Fields","href":"Index-Scalar-Fields","type":1,"isActive":false},{"label":"Types of scalar indexing","href":"Types-of-scalar-indexing","type":2,"isActive":false},{"label":"Auto indexing","href":"Auto-indexing","type":2,"isActive":false},{"label":"Custom indexing","href":"Custom-indexing","type":2,"isActive":false},{"label":"Verifying the result","href":"Verifying-the-result","type":2,"isActive":false},{"label":"Limits","href":"Limits","type":2,"isActive":false}]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.