From 4ad54459c974cb8a452b370f7806050288cf0785 Mon Sep 17 00:00:00 2001 From: Milvus-doc-bot Date: Mon, 2 Dec 2024 03:26:39 +0000 Subject: [PATCH] Generate en docs --- .../en/userGuide/search-query-get/full-text-search.json | 2 +- .../site/en/userGuide/search-query-get/full-text-search.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/localization/v2.5.x/site/en/userGuide/search-query-get/full-text-search.json b/localization/v2.5.x/site/en/userGuide/search-query-get/full-text-search.json index 5fe95a3fc..a692ecbce 100644 --- a/localization/v2.5.x/site/en/userGuide/search-query-get/full-text-search.json +++ b/localization/v2.5.x/site/en/userGuide/search-query-get/full-text-search.json @@ -1 +1 @@ -{"codeList":["from pymilvus import MilvusClient, DataType, Function, FunctionType​\n​\nschema = MilvusClient.create_schema()​\n​\nschema.add_field(field_name=\"id\", datatype=DataType.INT64, is_primary=True, auto_id=True)​\nschema.add_field(field_name=\"text\", datatype=DataType.VARCHAR, max_length=1000, enable_analyzer=True)​\nschema.add_field(field_name=\"sparse\", datatype=DataType.SPARSE_FLOAT_VECTOR)​\n\n","import io.milvus.v2.common.DataType;\nimport io.milvus.v2.service.collection.request.AddFieldReq;\nimport io.milvus.v2.service.collection.request.CreateCollectionReq;\n\nCreateCollectionReq.CollectionSchema schema = CreateCollectionReq.CollectionSchema.builder()\n .build();\nschema.addField(AddFieldReq.builder()\n .fieldName(\"id\")\n .dataType(DataType.Int64)\n .isPrimaryKey(true)\n .autoID(true)\n .build());\nschema.addField(AddFieldReq.builder()\n .fieldName(\"text\")\n .dataType(DataType.VarChar)\n .maxLength(1000)\n .enableAnalyzer(true)\n .build());\nschema.addField(AddFieldReq.builder()\n .fieldName(\"sparse\")\n .dataType(DataType.SparseFloatVector)\n .build());\n","import { MilvusClient, DataType } from \"@zilliz/milvus2-sdk-node\";\n\nconst address = \"http://localhost:19530\";\nconst token = \"root:Milvus\";\nconst client = new MilvusClient({address, token});\nconst schema = [\n {\n name: \"id\",\n data_type: DataType.Int64,\n is_primary_key: true,\n },\n {\n name: \"text\",\n data_type: \"VarChar\",\n enable_analyzer: true,\n enable_match: true,\n max_length: 1000,\n },\n {\n name: \"sparse\",\n data_type: DataType.SparseFloatVector,\n },\n];\n\n\nconsole.log(res.results)\n","export schema='{\n \"autoId\": true,\n \"enabledDynamicField\": false,\n \"fields\": [\n {\n \"fieldName\": \"id\",\n \"dataType\": \"Int64\",\n \"isPrimary\": true\n },\n {\n \"fieldName\": \"text\",\n \"dataType\": \"VarChar\",\n \"elementTypeParams\": {\n \"max_length\": 1000,\n \"enable_analyzer\": true\n }\n },\n {\n \"fieldName\": \"sparse\",\n \"dataType\": \"SparseFloatVector\"\n }\n ]\n }'\n","bm25_function = Function(​\n name=\"text_bm25_emb\", # Function name​\n input_field_names=[\"text\"], # Name of the VARCHAR field containing raw text data​\n output_field_names=[\"sparse\"], # Name of the SPARSE_FLOAT_VECTOR field reserved to store generated embeddings​\n function_type=FunctionType.BM25,​\n)​\n​\nschema.add_function(bm25_function)​\n\n","import io.milvus.common.clientenum.FunctionType;\nimport io.milvus.v2.service.collection.request.CreateCollectionReq.Function;\n\nimport java.util.*;\n\nschema.addFunction(Function.builder()\n .functionType(FunctionType.BM25)\n .name(\"text_bm25_emb\")\n .inputFieldNames(Collections.singletonList(\"text\"))\n .outputFieldNames(Collections.singletonList(\"vector\"))\n .build());\n","const functions = [\n {\n name: 'text_bm25_emb',\n description: 'bm25 function',\n type: FunctionType.BM25,\n input_field_names: ['text'],\n output_field_names: ['vector'],\n params: {},\n },\n];\n","export schema='{\n \"autoId\": true,\n \"enabledDynamicField\": false,\n \"fields\": [\n {\n \"fieldName\": \"id\",\n \"dataType\": \"Int64\",\n \"isPrimary\": true\n },\n {\n \"fieldName\": \"text\",\n \"dataType\": \"VarChar\",\n \"elementTypeParams\": {\n \"max_length\": 1000,\n \"enable_analyzer\": true\n }\n },\n {\n \"fieldName\": \"sparse\",\n \"dataType\": \"SparseFloatVector\"\n }\n ],\n \"functions\": [\n {\n \"name\": \"text_bm25_emb\",\n \"type\": \"BM25\",\n \"inputFieldNames\": [\"text\"],\n \"outputFieldNames\": [\"sparse\"],\n \"params\": {}\n }\n ]\n }'\n","index_params = MilvusClient.prepare_index_params()​\n​\nindex_params.add_index(​\n field_name=\"sparse\",​\n index_type=\"AUTOINDEX\", ​\n metric_type=\"BM25\"​\n)​\n\n","import io.milvus.v2.common.IndexParam;\n\nList indexes = new ArrayList<>();\nindexes.add(IndexParam.builder()\n .fieldName(\"sparse\")\n .indexType(IndexParam.IndexType.SPARSE_INVERTED_INDEX)\n .metricType(IndexParam.MetricType.BM25)\n .build());\n","const index_params = [\n {\n fieldName: \"sparse\",\n metricType: \"BM25\",\n indexType: \"AUTOINDEX\",\n },\n];\n","export indexParams='[\n {\n \"fieldName\": \"sparse\",\n \"metricType\": \"BM25\",\n \"indexType\": \"AUTOINDEX\"\n }\n ]'\n","MilvusClient.create_collection(​\n collection_name='demo', ​\n schema=schema, ​\n index_params=index_params​\n)​\n\n","import io.milvus.v2.service.collection.request.CreateCollectionReq;\n\nCreateCollectionReq requestCreate = CreateCollectionReq.builder()\n .collectionName(\"demo\")\n .collectionSchema(schema)\n .indexParams(indexes)\n .build();\nclient.createCollection(requestCreate);\n","await client.create_collection(\n collection_name: 'demo', \n schema: schema, \n index_params: index_params,\n functions: functions\n);\n","export CLUSTER_ENDPOINT=\"http://localhost:19530\"\nexport TOKEN=\"root:Milvus\"\n\ncurl --request POST \\\n--url \"${CLUSTER_ENDPOINT}/v2/vectordb/collections/create\" \\\n--header \"Authorization: Bearer ${TOKEN}\" \\\n--header \"Content-Type: application/json\" \\\n-d \"{\n \\\"collectionName\\\": \\\"demo\\\",\n \\\"schema\\\": $schema,\n \\\"indexParams\\\": $indexParams\n}\"\n","client.insert('demo', [\n {'text': 'information retrieval is a field of study.'},\n {'text': 'information retrieval focuses on finding relevant information in large datasets.'},\n {'text': 'data mining and information retrieval overlap in research.'},\n])\n\n","import com.google.gson.Gson;\nimport com.google.gson.JsonObject;\n\nimport io.milvus.v2.service.vector.request.InsertReq;\n\nGson gson = new Gson();\nList rows = Arrays.asList(\n gson.fromJson(\"{\\\"text\\\": \\\"information retrieval is a field of study.\\\"}\", JsonObject.class),\n gson.fromJson(\"{\\\"text\\\": \\\"information retrieval focuses on finding relevant information in large datasets.\\\"}\", JsonObject.class),\n gson.fromJson(\"{\\\"text\\\": \\\"data mining and information retrieval overlap in research.\\\"}\", JsonObject.class)\n);\n\nclient.insert(InsertReq.builder()\n .collectionName(\"demo\")\n .data(rows)\n .build());\n","await client.insert({\ncollection_name: 'demo', \ndata: [\n {'text': 'information retrieval is a field of study.'},\n {'text': 'information retrieval focuses on finding relevant information in large datasets.'},\n {'text': 'data mining and information retrieval overlap in research.'},\n]);\n","curl --request POST \\\n--url \"${CLUSTER_ENDPOINT}/v2/vectordb/entities/insert\" \\\n--header \"Authorization: Bearer ${TOKEN}\" \\\n--header \"Content-Type: application/json\" \\\n-d '{\n \"data\": [\n {\"text\": \"information retrieval is a field of study.\"},\n {\"text\": \"information retrieval focuses on finding relevant information in large datasets.\"},\n {\"text\": \"data mining and information retrieval overlap in research.\"} \n ],\n \"collectionName\": \"demo\"\n}'\n","search_params = {​\n 'params': {'drop_ratio_search': 0.6},​\n}​\n​\nMilvusClient.search(​\n collection_name='demo', ​\n data=['whats the focus of information retrieval?'],​\n anns_field='sparse',​\n limit=3,​\n search_params=search_params​\n)​\n\n","import io.milvus.v2.service.vector.request.SearchReq;\nimport io.milvus.v2.service.vector.request.data.EmbeddedText;\nimport io.milvus.v2.service.vector.response.SearchResp;\n\nMap searchParams = new HashMap<>();\nsearchParams.put(\"drop_ratio_search\", 0.6);\nSearchResp searchResp = client.search(SearchReq.builder()\n .collectionName(\"demo\")\n .data(Collections.singletonList(new EmbeddedText(\"whats the focus of information retrieval?\")))\n .annsField(\"sparse\")\n .topK(3)\n .searchParams(searchParams)\n .outputFields(Collections.singletonList(\"text\"))\n .build());\n","await client.search(\n collection_name: 'demo', \n data: ['whats the focus of information retrieval?'],\n anns_field: 'sparse',\n limit: 3,\n params: {'drop_ratio_search': 0.6},\n)\n","curl --request POST \\\n--url \"${CLUSTER_ENDPOINT}/v2/vectordb/entities/search\" \\\n--header \"Authorization: Bearer ${TOKEN}\" \\\n--header \"Content-Type: application/json\" \\\n--data-raw '{\n \"collectionName\": \"demo\",\n \"data\": [\n \"whats the focus of information retrieval?\"\n ],\n \"annsField\": \"sparse\",\n \"limit\": 3,\n \"outputFields\": [\n \"text\"\n ],\n \"searchParams\":{\n \"params\":{\n \"drop_ratio_search\":0.6\n }\n }\n}'\n"],"headingContent":"Full Text Search​","anchorList":[{"label":"Full Text Search​","href":"Full-Text-Search​","type":1,"isActive":false},{"label":"Overview​","href":"Overview​","type":2,"isActive":false},{"label":"Create a collection for full text search​","href":"Create-a-collection-for-full-text-search​","type":2,"isActive":false},{"label":"Insert text data","href":"Insert-text-data","type":2,"isActive":false},{"label":"Perform full text search","href":"Perform-full-text-search","type":2,"isActive":false}]} \ No newline at end of file +{"codeList":["from pymilvus import MilvusClient, DataType, Function, FunctionType​\n​\nschema = MilvusClient.create_schema()​\n​\nschema.add_field(field_name=\"id\", datatype=DataType.INT64, is_primary=True, auto_id=True)​\nschema.add_field(field_name=\"text\", datatype=DataType.VARCHAR, max_length=1000, enable_analyzer=True)​\nschema.add_field(field_name=\"sparse\", datatype=DataType.SPARSE_FLOAT_VECTOR)​\n\n","import io.milvus.v2.common.DataType;\nimport io.milvus.v2.service.collection.request.AddFieldReq;\nimport io.milvus.v2.service.collection.request.CreateCollectionReq;\n\nCreateCollectionReq.CollectionSchema schema = CreateCollectionReq.CollectionSchema.builder()\n .build();\nschema.addField(AddFieldReq.builder()\n .fieldName(\"id\")\n .dataType(DataType.Int64)\n .isPrimaryKey(true)\n .autoID(true)\n .build());\nschema.addField(AddFieldReq.builder()\n .fieldName(\"text\")\n .dataType(DataType.VarChar)\n .maxLength(1000)\n .enableAnalyzer(true)\n .build());\nschema.addField(AddFieldReq.builder()\n .fieldName(\"sparse\")\n .dataType(DataType.SparseFloatVector)\n .build());\n","import { MilvusClient, DataType } from \"@zilliz/milvus2-sdk-node\";\n\nconst address = \"http://localhost:19530\";\nconst token = \"root:Milvus\";\nconst client = new MilvusClient({address, token});\nconst schema = [\n {\n name: \"id\",\n data_type: DataType.Int64,\n is_primary_key: true,\n },\n {\n name: \"text\",\n data_type: \"VarChar\",\n enable_analyzer: true,\n enable_match: true,\n max_length: 1000,\n },\n {\n name: \"sparse\",\n data_type: DataType.SparseFloatVector,\n },\n];\n\n\nconsole.log(res.results)\n","export schema='{\n \"autoId\": true,\n \"enabledDynamicField\": false,\n \"fields\": [\n {\n \"fieldName\": \"id\",\n \"dataType\": \"Int64\",\n \"isPrimary\": true\n },\n {\n \"fieldName\": \"text\",\n \"dataType\": \"VarChar\",\n \"elementTypeParams\": {\n \"max_length\": 1000,\n \"enable_analyzer\": true\n }\n },\n {\n \"fieldName\": \"sparse\",\n \"dataType\": \"SparseFloatVector\"\n }\n ]\n }'\n","bm25_function = Function(​\n name=\"text_bm25_emb\", # Function name​\n input_field_names=[\"text\"], # Name of the VARCHAR field containing raw text data​\n output_field_names=[\"sparse\"], # Name of the SPARSE_FLOAT_VECTOR field reserved to store generated embeddings​\n function_type=FunctionType.BM25,​\n)​\n​\nschema.add_function(bm25_function)​\n\n","import io.milvus.common.clientenum.FunctionType;\nimport io.milvus.v2.service.collection.request.CreateCollectionReq.Function;\n\nimport java.util.*;\n\nschema.addFunction(Function.builder()\n .functionType(FunctionType.BM25)\n .name(\"text_bm25_emb\")\n .inputFieldNames(Collections.singletonList(\"text\"))\n .outputFieldNames(Collections.singletonList(\"vector\"))\n .build());\n","const functions = [\n {\n name: 'text_bm25_emb',\n description: 'bm25 function',\n type: FunctionType.BM25,\n input_field_names: ['text'],\n output_field_names: ['vector'],\n params: {},\n },\n];\n","export schema='{\n \"autoId\": true,\n \"enabledDynamicField\": false,\n \"fields\": [\n {\n \"fieldName\": \"id\",\n \"dataType\": \"Int64\",\n \"isPrimary\": true\n },\n {\n \"fieldName\": \"text\",\n \"dataType\": \"VarChar\",\n \"elementTypeParams\": {\n \"max_length\": 1000,\n \"enable_analyzer\": true\n }\n },\n {\n \"fieldName\": \"sparse\",\n \"dataType\": \"SparseFloatVector\"\n }\n ],\n \"functions\": [\n {\n \"name\": \"text_bm25_emb\",\n \"type\": \"BM25\",\n \"inputFieldNames\": [\"text\"],\n \"outputFieldNames\": [\"sparse\"],\n \"params\": {}\n }\n ]\n }'\n","index_params = MilvusClient.prepare_index_params()​\n​\nindex_params.add_index(​\n field_name=\"sparse\",​\n index_type=\"AUTOINDEX\", ​\n metric_type=\"BM25\"​\n)​\n\n","import io.milvus.v2.common.IndexParam;\n\nList indexes = new ArrayList<>();\nindexes.add(IndexParam.builder()\n .fieldName(\"sparse\")\n .indexType(IndexParam.IndexType.SPARSE_INVERTED_INDEX)\n .metricType(IndexParam.MetricType.BM25)\n .build());\n","const index_params = [\n {\n field_name: \"sparse\",\n metric_type: \"BM25\",\n index_type: \"AUTOINDEX\",\n },\n];\n","export indexParams='[\n {\n \"fieldName\": \"sparse\",\n \"metricType\": \"BM25\",\n \"indexType\": \"AUTOINDEX\"\n }\n ]'\n","MilvusClient.create_collection(​\n collection_name='demo', ​\n schema=schema, ​\n index_params=index_params​\n)​\n\n","import io.milvus.v2.service.collection.request.CreateCollectionReq;\n\nCreateCollectionReq requestCreate = CreateCollectionReq.builder()\n .collectionName(\"demo\")\n .collectionSchema(schema)\n .indexParams(indexes)\n .build();\nclient.createCollection(requestCreate);\n","await client.create_collection(\n collection_name: 'demo', \n schema: schema, \n index_params: index_params,\n functions: functions\n);\n","export CLUSTER_ENDPOINT=\"http://localhost:19530\"\nexport TOKEN=\"root:Milvus\"\n\ncurl --request POST \\\n--url \"${CLUSTER_ENDPOINT}/v2/vectordb/collections/create\" \\\n--header \"Authorization: Bearer ${TOKEN}\" \\\n--header \"Content-Type: application/json\" \\\n-d \"{\n \\\"collectionName\\\": \\\"demo\\\",\n \\\"schema\\\": $schema,\n \\\"indexParams\\\": $indexParams\n}\"\n","client.insert('demo', [\n {'text': 'information retrieval is a field of study.'},\n {'text': 'information retrieval focuses on finding relevant information in large datasets.'},\n {'text': 'data mining and information retrieval overlap in research.'},\n])\n\n","import com.google.gson.Gson;\nimport com.google.gson.JsonObject;\n\nimport io.milvus.v2.service.vector.request.InsertReq;\n\nGson gson = new Gson();\nList rows = Arrays.asList(\n gson.fromJson(\"{\\\"text\\\": \\\"information retrieval is a field of study.\\\"}\", JsonObject.class),\n gson.fromJson(\"{\\\"text\\\": \\\"information retrieval focuses on finding relevant information in large datasets.\\\"}\", JsonObject.class),\n gson.fromJson(\"{\\\"text\\\": \\\"data mining and information retrieval overlap in research.\\\"}\", JsonObject.class)\n);\n\nclient.insert(InsertReq.builder()\n .collectionName(\"demo\")\n .data(rows)\n .build());\n","await client.insert({\ncollection_name: 'demo', \ndata: [\n {'text': 'information retrieval is a field of study.'},\n {'text': 'information retrieval focuses on finding relevant information in large datasets.'},\n {'text': 'data mining and information retrieval overlap in research.'},\n]);\n","curl --request POST \\\n--url \"${CLUSTER_ENDPOINT}/v2/vectordb/entities/insert\" \\\n--header \"Authorization: Bearer ${TOKEN}\" \\\n--header \"Content-Type: application/json\" \\\n-d '{\n \"data\": [\n {\"text\": \"information retrieval is a field of study.\"},\n {\"text\": \"information retrieval focuses on finding relevant information in large datasets.\"},\n {\"text\": \"data mining and information retrieval overlap in research.\"} \n ],\n \"collectionName\": \"demo\"\n}'\n","search_params = {​\n 'params': {'drop_ratio_search': 0.6},​\n}​\n​\nMilvusClient.search(​\n collection_name='demo', ​\n data=['whats the focus of information retrieval?'],​\n anns_field='sparse',​\n limit=3,​\n search_params=search_params​\n)​\n\n","import io.milvus.v2.service.vector.request.SearchReq;\nimport io.milvus.v2.service.vector.request.data.EmbeddedText;\nimport io.milvus.v2.service.vector.response.SearchResp;\n\nMap searchParams = new HashMap<>();\nsearchParams.put(\"drop_ratio_search\", 0.6);\nSearchResp searchResp = client.search(SearchReq.builder()\n .collectionName(\"demo\")\n .data(Collections.singletonList(new EmbeddedText(\"whats the focus of information retrieval?\")))\n .annsField(\"sparse\")\n .topK(3)\n .searchParams(searchParams)\n .outputFields(Collections.singletonList(\"text\"))\n .build());\n","await client.search(\n collection_name: 'demo', \n data: ['whats the focus of information retrieval?'],\n anns_field: 'sparse',\n limit: 3,\n params: {'drop_ratio_search': 0.6},\n)\n","curl --request POST \\\n--url \"${CLUSTER_ENDPOINT}/v2/vectordb/entities/search\" \\\n--header \"Authorization: Bearer ${TOKEN}\" \\\n--header \"Content-Type: application/json\" \\\n--data-raw '{\n \"collectionName\": \"demo\",\n \"data\": [\n \"whats the focus of information retrieval?\"\n ],\n \"annsField\": \"sparse\",\n \"limit\": 3,\n \"outputFields\": [\n \"text\"\n ],\n \"searchParams\":{\n \"params\":{\n \"drop_ratio_search\":0.6\n }\n }\n}'\n"],"headingContent":"Full Text Search​","anchorList":[{"label":"Full Text Search​","href":"Full-Text-Search​","type":1,"isActive":false},{"label":"Overview​","href":"Overview​","type":2,"isActive":false},{"label":"Create a collection for full text search​","href":"Create-a-collection-for-full-text-search​","type":2,"isActive":false},{"label":"Insert text data","href":"Insert-text-data","type":2,"isActive":false},{"label":"Perform full text search","href":"Perform-full-text-search","type":2,"isActive":false}]} \ No newline at end of file diff --git a/localization/v2.5.x/site/en/userGuide/search-query-get/full-text-search.md b/localization/v2.5.x/site/en/userGuide/search-query-get/full-text-search.md index ca4639409..bd758b78f 100644 --- a/localization/v2.5.x/site/en/userGuide/search-query-get/full-text-search.md +++ b/localization/v2.5.x/site/en/userGuide/search-query-get/full-text-search.md @@ -294,9 +294,9 @@ indexes.add(
const index_params = [
   {
-    fieldName: "sparse",
-    metricType: "BM25",
-    indexType: "AUTOINDEX",
+    field_name: "sparse",
+    metric_type: "BM25",
+    index_type: "AUTOINDEX",
   },
 ];