-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #978 from milvus-io/update-ref
update docs
- Loading branch information
Showing
16 changed files
with
345 additions
and
28 deletions.
There are no files selected for viewing
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
73 changes: 73 additions & 0 deletions
73
...Reference/milvus-sdk-java/v2.5.x/v2/Collections/CollectionSchema/addFunction.md
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 |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# addFunction() | ||
|
||
This operation adds a function to convert raw data into vector representations. | ||
|
||
```java | ||
public CollectionSchema addFunction(Function function) | ||
``` | ||
|
||
## Request Syntax | ||
|
||
```java | ||
addFunction(Function.builder() | ||
.functionType(FunctionType functionType) | ||
.name(String name) | ||
.inputFieldNames(List<String> inputFieldNames) | ||
.outputFieldNames(List<String> outputFieldNames) | ||
.description(String description) | ||
.build()); | ||
``` | ||
|
||
**BUILDER METHODS:** | ||
|
||
- `functionType(FunctionType functionType)` | ||
|
||
The type of function for processing raw data. Possible values: | ||
|
||
- `FunctionType.BM25`: Uses the BM25 algorithm for generating sparse embeddings from a `VARCHAR` field. | ||
|
||
- `name(String name)` | ||
|
||
The name of the function. This identifier is used to reference the function within queries and collections. | ||
|
||
- `inputFieldNames(List<String> inputFieldNames)` | ||
|
||
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. | ||
|
||
- `outputFieldNames(List<String> outputFieldNames)` | ||
|
||
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. | ||
|
||
- `description(String description)` | ||
|
||
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. | ||
|
||
**RETURN TYPE:** | ||
|
||
*Function* | ||
|
||
**RETURNS:** | ||
|
||
A `Function` object | ||
|
||
**EXCEPTIONS:** | ||
|
||
- **MilvusClientExceptions** | ||
|
||
This exception will be raised when any error occurs during this operation. | ||
|
||
## Example | ||
|
||
```java | ||
import io.milvus.common.clientenum.FunctionType; | ||
import io.milvus.v2.service.collection.request.CreateCollectionReq.Function; | ||
|
||
import java.util.*; | ||
|
||
schema.addFunction(Function.builder() | ||
.functionType(FunctionType.BM25) | ||
.name("text_bm25_emb") | ||
.inputFieldNames(Collections.singletonList("text")) | ||
.outputFieldNames(Collections.singletonList("vector")) | ||
.build()); | ||
``` |
69 changes: 69 additions & 0 deletions
69
API_Reference/milvus-sdk-java/v2.5.x/v2/Collections/Function.md
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 |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Function | ||
|
||
A `Function` instance for generating vector embeddings from user-provided raw data in Milvus. | ||
|
||
```java | ||
io.milvus.v2.service.collection.request.CreateCollectionReq.Function | ||
``` | ||
|
||
## Constructor | ||
|
||
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. | ||
|
||
```java | ||
CreateCollectionReq.Function.builder() | ||
.name(String name) | ||
.description(String description) | ||
.functionType(FunctionType functionType) | ||
.inputFieldNames(List<String> inputFieldNames) | ||
.outputFieldNames(List<String> outputFieldNames) | ||
``` | ||
|
||
**BUILDER METHODS:** | ||
|
||
- `name(String name)` | ||
|
||
The name of the function. This identifier is used to reference the function within queries and collections. | ||
|
||
- `description(String description)` | ||
|
||
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. | ||
|
||
- `functionType(FunctionType functionType)` | ||
|
||
The type of function for processing raw data. Possible values: | ||
|
||
- `FunctionType.BM25`: Uses the BM25 algorithm for generating sparse embeddings from a `VARCHAR` field. | ||
|
||
- `inputFieldNames(List<String> inputFieldNames)` | ||
|
||
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. | ||
|
||
- `outputFieldNames(List<String> outputFieldNames)` | ||
|
||
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. | ||
|
||
**RETURN TYPE:** | ||
|
||
*Function* | ||
|
||
**RETURNS:** | ||
|
||
A `Function` object that can be registered with a Milvus collection, facilitating automatic embedding generation during data insertion. | ||
|
||
**EXCEPTIONS:** | ||
|
||
- **MilvusClientExceptions** | ||
|
||
This exception will be raised when any error occurs during this operation. | ||
|
||
## Example | ||
|
||
```java | ||
CreateCollectionReq.Function.builder() | ||
.functionType(FunctionType.BM25) | ||
.name("text_bm25_emb") | ||
.inputFieldNames(Collections.singletonList("text")) | ||
.outputFieldNames(Collections.singletonList("vector")) | ||
.build()); | ||
``` |
13 changes: 13 additions & 0 deletions
13
API_Reference/milvus-sdk-java/v2.5.x/v2/Collections/FunctionType.md
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# FunctionType | ||
|
||
This is an enumeration that provides the following constants. | ||
|
||
## Constants | ||
|
||
- BM25 | ||
|
||
Sets the function type to **BM25**. | ||
|
||
- Unknown | ||
|
||
Sets the function type to **Unknown**. |
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
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
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
2 changes: 1 addition & 1 deletion
2
API_Reference_MDX/milvus-restful/v2.5.x/v2/Collection (v2)/Create.mdx
Large diffs are not rendered by default.
Oops, something went wrong.
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
20 changes: 20 additions & 0 deletions
20
API_Reference_MDX/milvus-restful/v2.5.x/v2/Database (v2)/alter.mdx
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
displayed_sidebar: restfulSidebar | ||
sidebar_positition: 10 | ||
slug: /restful/alter | ||
title: "Alter | RESTful" | ||
description: "This operation modifies a new database. | RESTful" | ||
hide_table_of_contents: true | ||
sidebar_label: "Alter" | ||
sidebar_custom_props: { badges: ['post']} | ||
--- | ||
|
||
# Alter | ||
|
||
import RestSpecs from '@site/src/components/RestSpecs'; | ||
|
||
<RestSpecs specs={specs} endpoint={endpoint} method={method} target="milvus" lang="en-US" /> | ||
|
||
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."}}}}}}}} | ||
export const endpoint = "/v2/vectordb/databases/alter" | ||
export const method = "post" |
Oops, something went wrong.