Skip to content

Commit 940c997

Browse files
authored
Merge pull request #978 from milvus-io/update-ref
update docs
2 parents 9ef3e56 + a527132 commit 940c997

File tree

16 files changed

+345
-28
lines changed

16 files changed

+345
-28
lines changed

API_Reference/milvus-sdk-java/v2.5.x/v2/Collections/CollectionSchema/addField.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ CollectionSchema.addField(AddFieldReq.builder()
2323
.maxCapacity(Integer maxCapacity)
2424
.isNullable(Boolean isNullable)
2525
.defaultValue(DataType dataType)
26+
.enableAnalyzer(Boolean enableAnalyzer)
27+
.enableMatch(Boolean enableMatch)
28+
.analyzerParams(Map<String, Object>, analyzerParams)
2629

2730
.build()
2831
)
@@ -110,6 +113,45 @@ CollectionSchema.addField(AddFieldReq.builder()
110113

111114
Sets a default value for a specific field in a collection schema when creating it. This is particularly useful when you want certain fields to have an initial value even if no value is explicitly provided during data insertion.
112115

116+
- `enableAnalyzer(Boolean enableAnalyzer)`
117+
118+
Whether to enable text analysis for the specified `VARCHAR` field. When set to `true`, it instructs Milvus to use a text analyzer, which tokenizes and filters the text content of the field.
119+
120+
- `enableMatch(Boolean enableMatch)`
121+
122+
Whether to enable keyword matching for the specified `VARCHAR` field. When set to `true`, Milvus creates an inverted index for the field, allowing for quick and efficient keyword lookups. `enableMatch` works in conjunction with `enableAnalyzer` to provide structured term-based text search, with `enableAnalyzer` handling tokenization and `enableMatch` handling the search operations on these tokens.
123+
124+
- `analyzerParams(Map<String, Object>, analyzerParams)`
125+
126+
Configures the analyzer for text processing, specifically for `DataType.VarChar` fields. This parameter configures tokenizer and filter settings, particularly for text fields used in [keyword matching](https://milvus.io/docs/keyword-match.md) or [full text search](https://milvus.io/docs/full-text-search.md). Depending on the type of analyzer, it can be configured in either of the following methods:
127+
128+
- Built-in analyzer
129+
130+
```java
131+
Map<String, Object> analyzerParams = new HashMap<>();
132+
analyzerParams.put("type", "english");
133+
```
134+
135+
- `type` (*String*) -
136+
137+
Pre-configured analyzer type built into Milvus, which can be used out-of-the-box by specifying its name. Possible values: `standard`, `english`, `chinese`. For more information, refer to [Standard Analyzer](https://milvus.io/docs/standard-analyzer.md), [English Analyzer](https://milvus.io/docs/english-analyzer.md), and [Chinese Analyzer](https://milvus.io/docs/chinese-analyzer.md).
138+
139+
- Custom analyzer
140+
141+
```java
142+
Map<String, Object> analyzerParams = new HashMap<>();
143+
analyzerParams.put("tokenizer", "standard");
144+
analyzerParams.put("filter", Collections.singletonList("lowercase"));
145+
```
146+
147+
- `tokenizer` (*String*) -
148+
149+
Defines the tokenizer type. Possible values: `standard` (default), `whitespace`, `jieba`. For more information, refer to [Standard Tokenizer](https://milvus.io/docs/standard-tokenizer.md), [Whitespace Tokenizer](https://milvus.io/docs/whitespace-tokenizer.md), and [Jieba Tokenizer](https://milvus.io/docs/jieba-tokenizer.md).
150+
151+
- `filter` (*List\<String>*) -
152+
153+
Lists filters to refine tokens produced by the tokenizer, with options for built-in filters and custom filters. For more information, refer to [Alphanumonly Filter](https://milvus.io/docs/alphanumonly-filer.md) and others.
154+
113155
**RETURNS:**
114156

115157
*void*
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# addFunction()
2+
3+
This operation adds a function to convert raw data into vector representations.
4+
5+
```java
6+
public CollectionSchema addFunction(Function function)
7+
```
8+
9+
## Request Syntax
10+
11+
```java
12+
addFunction(Function.builder()
13+
.functionType(FunctionType functionType)
14+
.name(String name)
15+
.inputFieldNames(List<String> inputFieldNames)
16+
.outputFieldNames(List<String> outputFieldNames)
17+
.description(String description)
18+
.build());
19+
```
20+
21+
**BUILDER METHODS:**
22+
23+
- `functionType(FunctionType functionType)`
24+
25+
The type of function for processing raw data. Possible values:
26+
27+
- `FunctionType.BM25`: Uses the BM25 algorithm for generating sparse embeddings from a `VARCHAR` field.
28+
29+
- `name(String name)`
30+
31+
The name of the function. This identifier is used to reference the function within queries and collections.
32+
33+
- `inputFieldNames(List<String> inputFieldNames)`
34+
35+
The name of the field containing the raw data that requires conversion to vector representation. For functions using `FunctionType.BM25`, this parameter accepts only one field name.
36+
37+
- `outputFieldNames(List<String> outputFieldNames)`
38+
39+
The name of the field where the generated embeddings will be stored. This should correspond to a vector field defined in the collection schema. For functions using `FunctionType.BM25`, this parameter accepts only one field name.
40+
41+
- `description(String description)`
42+
43+
A brief description of the function’s purpose. This can be useful for documentation or clarity in larger projects and defaults to an empty string.
44+
45+
**RETURN TYPE:**
46+
47+
*Function*
48+
49+
**RETURNS:**
50+
51+
A `Function` object
52+
53+
**EXCEPTIONS:**
54+
55+
- **MilvusClientExceptions**
56+
57+
This exception will be raised when any error occurs during this operation.
58+
59+
## Example
60+
61+
```java
62+
import io.milvus.common.clientenum.FunctionType;
63+
import io.milvus.v2.service.collection.request.CreateCollectionReq.Function;
64+
65+
import java.util.*;
66+
67+
schema.addFunction(Function.builder()
68+
.functionType(FunctionType.BM25)
69+
.name("text_bm25_emb")
70+
.inputFieldNames(Collections.singletonList("text"))
71+
.outputFieldNames(Collections.singletonList("vector"))
72+
.build());
73+
```
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Function
2+
3+
A `Function` instance for generating vector embeddings from user-provided raw data in Milvus.
4+
5+
```java
6+
io.milvus.v2.service.collection.request.CreateCollectionReq.Function
7+
```
8+
9+
## Constructor
10+
11+
This constructor initializes a new `Function` instance designed to transform user's raw data into vector embeddings. This is achieved through an automated process that simplifies similarity search operations.
12+
13+
```java
14+
CreateCollectionReq.Function.builder()
15+
.name(String name)
16+
.description(String description)
17+
.functionType(FunctionType functionType)
18+
.inputFieldNames(List<String> inputFieldNames)
19+
.outputFieldNames(List<String> outputFieldNames)
20+
```
21+
22+
**BUILDER METHODS:**
23+
24+
- `name(String name)`
25+
26+
The name of the function. This identifier is used to reference the function within queries and collections.
27+
28+
- `description(String description)`
29+
30+
A brief description of the function's purpose. This can be useful for documentation or clarity in larger projects and defaults to an empty string.
31+
32+
- `functionType(FunctionType functionType)`
33+
34+
The type of function for processing raw data. Possible values:
35+
36+
- `FunctionType.BM25`: Uses the BM25 algorithm for generating sparse embeddings from a `VARCHAR` field.
37+
38+
- `inputFieldNames(List<String> inputFieldNames)`
39+
40+
The name of the field containing the raw data that requires conversion to vector representation. For functions using `FunctionType.BM25`, this parameter accepts only one field name.
41+
42+
- `outputFieldNames(List<String> outputFieldNames)`
43+
44+
The name of the field where the generated embeddings will be stored. This should correspond to a vector field defined in the collection schema. For functions using `FunctionType.BM25`, this parameter accepts only one field name.
45+
46+
**RETURN TYPE:**
47+
48+
*Function*
49+
50+
**RETURNS:**
51+
52+
A `Function` object that can be registered with a Milvus collection, facilitating automatic embedding generation during data insertion.
53+
54+
**EXCEPTIONS:**
55+
56+
- **MilvusClientExceptions**
57+
58+
This exception will be raised when any error occurs during this operation.
59+
60+
## Example
61+
62+
```java
63+
CreateCollectionReq.Function.builder()
64+
.functionType(FunctionType.BM25)
65+
.name("text_bm25_emb")
66+
.inputFieldNames(Collections.singletonList("text"))
67+
.outputFieldNames(Collections.singletonList("vector"))
68+
.build());
69+
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# FunctionType
2+
3+
This is an enumeration that provides the following constants.
4+
5+
## Constants
6+
7+
- BM25
8+
9+
Sets the function type to **BM25**.
10+
11+
- Unknown
12+
13+
Sets the function type to **Unknown**.

API_Reference/milvus-sdk-java/v2.5.x/v2/Management/IndexParam.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ IndexParam.builder()
3434

3535
- `metricType(IndexParam.MetricType metricType)`
3636

37-
The distance metric to use for the index. Possible values are **L2**, **IP**, **COSINE**, **HAMMING**, and **JACCARD**.
37+
The algorithm that is used to measure similarity between vectors. Possible values: `IP`, `L2`, `COSINE`, `HAMMING`, `JACCARD`, `BM25` (used only for full text search). For more information, refer to [Metric Types](https://milvus.io/docs/metric.md).
38+
39+
This is available only when the specified field is a vector field.
3840

3941
- `extraParams(Map<String, Object> extraParams)`
4042

API_Reference/pymilvus/v2.5.x/MilvusClient/Function/Function.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Function
22

3-
A `Function` instance for generating vector embeddings from user-provided raw text data in Milvus.
3+
A `Function` instance for generating vector embeddings from user-provided raw data in Milvus.
44

55
```python
66
class pymilvus.Function
@@ -27,7 +27,7 @@ Function(
2727

2828
**[REQUIRED]**
2929

30-
The name of the function. This identifier is used to reference the function within queries and collections.
30+
The name of the function. This identifier is used to reference the function within queries and collections.
3131

3232
- `function_type` (*FunctionType*) -
3333

API_Reference/pymilvus/v2.5.x/MilvusClient/Management/add_index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ IndexParams.add_index(
3030

3131
- **metric_type** (*str*) -
3232

33-
The algorithm that is used to measure similarity between vectors. Possible values: `IP`, `L2`, `COSINE`, `HAMMING`, `JACCARD`, `BM25`. For more information, refer to [Metric Types](https://milvus.io/docs/metric.md).
33+
The algorithm that is used to measure similarity between vectors. Possible values: `IP`, `L2`, `COSINE`, `HAMMING`, `JACCARD`, `BM25` (used only for full text search). For more information, refer to [Metric Types](https://milvus.io/docs/metric.md).
3434

35-
This is available only when the specified field is a vector field.
35+
This is available only when the specified field is a vector field.
3636

3737
- **params** (*dict*) -
3838

API_Reference_MDX/milvus-restful/v2.5.x/v2/Collection (v2)/Create.mdx

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

API_Reference_MDX/milvus-restful/v2.5.x/v2/Collection (v2)/List.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ import RestSpecs from '@site/src/components/RestSpecs';
1515

1616
<RestSpecs specs={specs} endpoint={endpoint} method={method} target="milvus" lang="en-US" />
1717

18-
export const specs = {"summary":"List Collections","deprecated":false,"description":"This operation lists all collection names.","x-i18n":{"zh-CN":{"summary":"查看 Collection 列表","description":"列出所有 Collection 名称。"}},"tags":["Collection Operations (V2)"],"parameters":[{"name":"Authorization","in":"header","description":"The authentication token should be <include target=\"zilliz\">an API key with appropriate privileges or </include>a pair of colon-joined username and password, like `username:password`.","required":true,"example":"Bearer {{TOKEN}}","schema":{"type":"string"},"x-i18n":{"zh-CN":{"description":"认证令牌,应为<include target=\"zilliz\">具备适当权限的 API 密钥或</include>用冒号分隔的用户名和密码,如 `username:password`。"}}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"dbName":{"type":"string","description":"The name of an existing database.","x-i18n":{"zh-CN":{"description":"现有数据库名称。"}},"x-include-target":["milvus"]}}},"examples":{"1":{"summary":"milvus","x-include-target":["milvus"],"value":{"dbName":"_default"}},"2":{"summary":"zilliz","x-include-target":["zilliz"],"value":{}}}}}},"responses":{"200":{"description":"This operation lists all collections in the database used in the current connection.","x-i18n":{"zh-CN":{"description":"该操作列出当前连接中使用的数据库中的所有 Collection。"}},"content":{"application/json":{"schema":{"oneOf":[{"x-tab-label":"success","type":"object","properties":{"code":{"description":"Response code.","x-i18n":{"zh-CN":{"description":"响应码。"}},"type":"integer"},"data":{"type":"array","items":{"type":"string","description":"A collection name.","x-i18n":{"zh-CN":{"description":"Collection 名称。"}}},"description":"Response payload which is a list of collection names.","x-i18n":{"zh-CN":{"description":"响应载荷,一个 Collection 名称列表。"}}}}},{"x-tab-label":"failure","description":"Returns an error message.","x-i18n":{"zh-CN":{"description":"返回错误消息。"}},"x-i18n-langs":["zh-CN"],"type":"object","properties":{"code":{"type":"integer","description":"Response code.","x-i18n":{"zh-CN":{"description":"响应码。"}}},"message":{"type":"string","description":"Error message.","x-i18n":{"zh-CN":{"description":"错误描述。"}}}}}]},"examples":{"1":{"summary":"success","x-target-response":"OPTION 1","value":{"code":0,"data":["quick_setup_new","customized_setup_1","customized_setup_2"]}},"2":{"summary":"failure","x-target-response":"OPTION 2","value":{"code":0,"message":"The token is illegal."}}}}}}},"security":[]}
18+
export const specs = {"summary":"List Collections","deprecated":false,"description":"This operation lists all collection names.","x-i18n":{"zh-CN":{"summary":"查看 Collection 列表","description":"列出所有 Collection 名称。"}},"tags":["Collection Operations (V2)"],"parameters":[{"name":"Authorization","in":"header","description":"The authentication token should be <include target=\"zilliz\">an API key with appropriate privileges or </include>a pair of colon-joined username and password, like `username:password`.","required":true,"example":"Bearer {{TOKEN}}","schema":{"type":"string"},"x-i18n":{"zh-CN":{"description":"认证令牌,应为<include target=\"zilliz\">具备适当权限的 API 密钥或</include>用冒号分隔的用户名和密码,如 `username:password`。"}}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"dbName":{"type":"string","description":"The name of an existing database.","x-i18n":{"zh-CN":{"description":"现有数据库名称。"}}}}},"example":{"dbName":"_default"}}}},"responses":{"200":{"description":"This operation lists all collections in the database used in the current connection.","x-i18n":{"zh-CN":{"description":"该操作列出当前连接中使用的数据库中的所有 Collection。"}},"content":{"application/json":{"schema":{"oneOf":[{"x-tab-label":"success","type":"object","properties":{"code":{"description":"Response code.","x-i18n":{"zh-CN":{"description":"响应码。"}},"type":"integer"},"data":{"type":"array","items":{"type":"string","description":"A collection name.","x-i18n":{"zh-CN":{"description":"Collection 名称。"}}},"description":"Response payload which is a list of collection names.","x-i18n":{"zh-CN":{"description":"响应载荷,一个 Collection 名称列表。"}}}}},{"x-tab-label":"failure","description":"Returns an error message.","x-i18n":{"zh-CN":{"description":"返回错误消息。"}},"x-i18n-langs":["zh-CN"],"type":"object","properties":{"code":{"type":"integer","description":"Response code.","x-i18n":{"zh-CN":{"description":"响应码。"}}},"message":{"type":"string","description":"Error message.","x-i18n":{"zh-CN":{"description":"错误描述。"}}}}}]},"examples":{"1":{"summary":"success","x-target-response":"OPTION 1","value":{"code":0,"data":["quick_setup_new","customized_setup_1","customized_setup_2"]}},"2":{"summary":"failure","x-target-response":"OPTION 2","value":{"code":0,"message":"The token is illegal."}}}}}}},"security":[]}
1919
export const endpoint = "/v2/vectordb/collections/list"
2020
export const method = "post"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
displayed_sidebar: restfulSidebar
3+
sidebar_positition: 10
4+
slug: /restful/alter
5+
title: "Alter | RESTful"
6+
description: "This operation modifies a new database. | RESTful"
7+
hide_table_of_contents: true
8+
sidebar_label: "Alter"
9+
sidebar_custom_props: { badges: ['post']}
10+
---
11+
12+
# Alter
13+
14+
import RestSpecs from '@site/src/components/RestSpecs';
15+
16+
<RestSpecs specs={specs} endpoint={endpoint} method={method} target="milvus" lang="en-US" />
17+
18+
export const specs = {"summary":"Alter","deprecated":false,"description":"This operation modifies a new database.","x-i18n":{"zh-CN":{"summary":"修改数据库","description":"此操作用于修改指定数据库。"}},"tags":["Database Operations (V2)"],"x-include-target":["milvus"],"parameters":[{"name":"Authorization","in":"header","description":"The authentication token should be <include target=\"zilliz\">an API key with appropriate privileges or </include>a pair of colon-joined username and password, like `username:password`.","required":true,"example":"Bearer {{TOKEN}}","schema":{"type":"string"},"x-i18n":{"zh-CN":{"description":"认证令牌,应为<include target=\"zilliz\">具备适当权限的 API 密钥或</include>用冒号分隔的用户名和密码,如 `username:password`。"}}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"dbName":{"type":"string","description":"The name of the database to modify.","x-i18n":{"zh-CN":{"description":"待修改数据库名称。"}}},"properties":{"type":"object","description":"Database properties to modify. For example, you can reset the `mmap.enabled` property to `false` to disable the mmap feature for the collections in the database.","x-i18n":{"zh-CN":{"description":"待修改的数据库属性。例如,可以重新设置 `mmap.enabled` 属性为 `false` 以禁用数据库中 Collection 的 mmap 特性。"}}}},"required":["dbName"]},"example":{"dbName":"test","properties":{"mmap.enabled":true}}}}},"responses":{"200":{"description":"Returns an empty object.","x-i18n":{"zh-CN":{"description":"返回空对象。"}},"content":{"application/json":{"schema":{"oneOf":[{"x-tab-label":"success","type":"object","properties":{"code":{"type":"integer","description":"Response code.","x-i18n":{"zh-CN":{"description":"响应码。"}}},"data":{"type":"object","description":"Response payload which is an empty object.","x-i18n":{"zh-CN":{"description":"响应载荷,为空对象。"}},"properties":{}}}},{"x-tab-label":"failure","description":"Returns an error message.","x-i18n":{"zh-CN":{"description":"返回错误消息。"}},"x-i18n-langs":["zh-CN"],"type":"object","properties":{"code":{"type":"integer","description":"Response code.","x-i18n":{"zh-CN":{"description":"响应码。"}}},"message":{"type":"string","description":"Error message.","x-i18n":{"zh-CN":{"description":"错误描述。"}}}}}]},"examples":{"1":{"summary":"success","x-target-response":"OPTION 1","value":{"code":0,"data":{}}},"2":{"summary":"failure","x-target-response":"OPTION 2","value":{"code":0,"message":"The token is illegal."}}}}}}}}
19+
export const endpoint = "/v2/vectordb/databases/alter"
20+
export const method = "post"

0 commit comments

Comments
 (0)