Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
Signed-off-by: AnthonyTsu1984 <[email protected]>
  • Loading branch information
AnthonyTsu1984 committed Jun 25, 2024
1 parent 6f3a078 commit 6202671
Show file tree
Hide file tree
Showing 15 changed files with 72 additions and 88 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ connect_param = S3ConnectParam(

<table>
<tr>
<th><strong>Service Name</strong></th>
<th><strong>Endpoint</strong></th>
<th><p><strong>Service Name</strong></p></th>
<th><p><strong>Endpoint</strong></p></th>
</tr>
<tr>
<td><strong>AWS S3</strong></td>
<td>s3.amazonaws.com</td>
<td><p><strong>AWS S3</strong></p></td>
<td><p>s3.amazonaws.com</p></td>
</tr>
<tr>
<td><strong>GCS</strong></td>
<td>storage.googleapis.com</td>
<td><p><strong>GCS</strong></p></td>
<td><p>storage.googleapis.com</p></td>
</tr>
</table>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This operation takes in documents and encodes them into vector embeddings.

When using **BM25EmbeddingFunction**, note that **encoding_queries()** and **encoding_documents()** operations cannot be interchanged mathematically. Therefore, there is no implemented **\_\_call\_\_()** available.
When using **BM25EmbeddingFunction**, note that **encoding_queries()** and **encoding_documents()** operations cannot be interchanged mathematically. Therefore, there is no implemented **__call__()** available.

## Request syntax

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This operation takes in a list of query strings and encodes each query into a vector embedding.

When using **BM25EmbeddingFunction**, note that **encoding_queries()** and **encoding_documents()** operations cannot be interchanged mathematically. Therefore, there is no implemented **\_\_call\_\_()** available.
When using **BM25EmbeddingFunction**, note that **encoding_queries()** and **encoding_documents()** operations cannot be interchanged mathematically. Therefore, there is no implemented **__call__()** available.

## Request syntax

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ To prevent potential errors when directly using the **__call()__** method, avoid
# Instance created
sentence_transformer_ef = SentenceTransformerEmbeddingFunction()

# __call__ method will be called
# \_\_call\_\_ method will be called
sentence_transformer_ef(
texts: List[str]
) -> List[np.array]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This operation in [SpladeEmbeddingFunction](SpladeEmbeddingFunction.md) takes a list of text strings and directly encodes them into vector embeddings.

Unlike [encode_documents()](encode_documents.md) or [encode_queries()](encode_queries.md), which enable you to prepend **doc_instruction** or **query_instruction** and utilize **k_tokens_document** or **k_tokens_query** for result pruning, the **call**() method directly returns embeddings without offering the option to prepend instructions or prune results.
Unlike [encode_documents()](encode_documents.md) or [encode_queries()](encode_queries.md), which enable you to prepend **doc_instruction** or **query_instruction** and utilize **k_tokens_document** or **k_tokens_query** for result pruning, the **\_\_call\_\_()** method directly returns embeddings without offering the option to prepend instructions or prune results.

## Request syntax

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ voyage_ef = VoyageEmbeddingFunction(
)
```

<DocCardList />
<DocCardList />
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This operation in [VoyageEmbeddingFunction](VoyageEmbeddingFunction.md) takes a list of text strings and directly encodes them into vector embeddings.

The `call` method of VoyageEmbeddingFunction shares the same functionality as [encode_documents()](encode_documents.md) and [encode_queries()](encode_queries.md).
The **\_\_call\_\_()** method of VoyageEmbeddingFunction shares the same functionality as [encode_documents()](encode_documents.md) and [encode_queries()](encode_queries.md).

## Request syntax

Expand Down
51 changes: 18 additions & 33 deletions API_Reference/pymilvus/v2.4.x/MilvusClient/Collections/DataType.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,74 +5,59 @@ This is an enumeration that provides the following constants.
## Constants

- NONE = 0

Sets the data type to **NoneType**.
Sets the data type to **NoneType**.

- BOOL = 1

Sets the data type to **Boolean**.
Sets the data type to **Boolean**.

- INT8 = 2

Sets the data type to **Int8**.
Sets the data type to **Int8**.

- INT16 = 3

Sets the data type to **Int16**.
Sets the data type to **Int16**.

- INT32 = 4

Sets the data type to **Int32**.
Sets the data type to **Int32**.

- INT64 = 5

Sets the data type to **Int64**.
Sets the data type to **Int64**.

- FLOAT = 10

Sets the data type to **Float**.
Sets the data type to **Float**.

- DOUBLE = 11

Sets the data type to **Double**.
Sets the data type to **Double**.

- STRING = 20

Sets the data type to **String**.
Sets the data type to **String**.

- VARCHAR = 21

Sets the data type to **Varchar**.
Sets the data type to **Varchar**.

- ARRAY = 22

Sets the data type to **Array**.
Sets the data type to **Array**.

- JSON = 23

Sets the data type to **JSON**.
Sets the data type to **JSON**.

- BINARY_VECTOR = 100

Sets the data type to **Binary Vector**.
Sets the data type to **Binary Vector**.

- FLOAT_VECTOR = 101

Sets the data type to **Float Vector**.
Sets the data type to **Float Vector**.

- FLOAT16_VECTOR = 102

Sets the data type to **Float16**.
Sets the data type to **Float16**.

- BFLOAT16_VECTOR = 103

Sets the data type to **BFloat16**.
Sets the data type to **BFloat16**.

- SPARSE_FLOAT_VECTOR = 104

Sets the data type to **Sparse Vector**.
Sets the data type to **Sparse Vector**.

- UNKNOWN = 999
Sets the data type to **Unknown**.

Sets the data type to **Unknown**.

39 changes: 19 additions & 20 deletions API_Reference/pymilvus/v2.4.x/MilvusClient/Collections/IndexType.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,77 +6,76 @@ This is an enumeration that provides the following constants.

- GPU_BRUTE_FORCE

Sets the index type to **GPU_BRUTE_FORCE**. This applies to GPU indexes only.
Sets the index type to **GPU_BRUTE_FORCE**. This applies to GPU indexes only.

- GPU_IVF_FLAT

Sets the index type to **GPU_IVF_FLAT**. This applies to GPU indexes only.
Sets the index type to **GPU_IVF_FLAT**. This applies to GPU indexes only.

- GPU_IVF_PQ

Sets the index type to **GPU_IVF_PQ**. This applies to GPU indexes only.
Sets the index type to **GPU_IVF_PQ**. This applies to GPU indexes only.

- GPU_CAGRA

Sets the index type to **GPU_CAGRA**. This applies to GPU indexes only.
Sets the index type to **GPU_CAGRA**. This applies to GPU indexes only.

- FLAT

Sets the index type to **FLAT**.
Sets the index type to **FLAT**.

- IVF_FLAT

Sets the index type to **IVF_FLAT**.
Sets the index type to **IVF_FLAT**.

- IVF_PQ

Sets the index type to **IVF_PQ**.
Sets the index type to **IVF_PQ**.

- SCANN

Sets the index type to **SCANN**.
Sets the index type to **SCANN**.

- IVF_SQ8

Sets the index type to **IVF_SQ8**.
Sets the index type to **IVF_SQ8**.

- BIN_FLAT

Sets the index type to **BIN_FLAT**. This applies to binary vectors only.
Sets the index type to **BIN_FLAT**. This applies to binary vectors only.

- BIN_IVF_FLAT

Sets the index type to **BIN_IVF_FLAT**. This applies to binary vectors only.
Sets the index type to **BIN_IVF_FLAT**. This applies to binary vectors only.

- HNSW

Sets the index type to **HNSW**.
Sets the index type to **HNSW**.

- DISKANN

Sets the index type to **DISKANN**.
Sets the index type to **DISKANN**.

- SPARSE_INVERTED_INDEX

Sets the index type to **SPARSE_INVERTED_INDEX**. This applies to sparse vectors only.
Sets the index type to **SPARSE_INVERTED_INDEX**. This applies to sparse vectors only.

- SPARSE_WAND

Sets the index type to **SPARSE_WAND**. This applies to sparse vectors only.
Sets the index type to **SPARSE_WAND**. This applies to sparse vectors only.

- INVERTED

Sets the index type to **INVERTED**. This applies to scalar fields only.
Sets the index type to **INVERTED**. This applies to scalar fields only.

- STL_SORT

Sets the index type to **STL_SORT**. This applies to scalar fields only.
Sets the index type to **STL_SORT**. This applies to scalar fields only.

- TRIE / Trie

Sets the index type to **TRIE**. This applies to VarChar scalar fields only.
Sets the index type to **TRIE**. This applies to VarChar scalar fields only.

- AUTOINDEX

Sets the index type to **AUTOINDEX**.

Sets the index type to **AUTOINDEX**.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# create_collection()

This operation creates a collection either with default or customized settings.
This operation supports creating a collection in two distinct ways: quick setup or custom setup.

## Request syntax

Expand All @@ -14,8 +14,8 @@ create_collection(
metric_type: str = "COSINE",
auto_id: bool = False,
timeout: Optional[float] = None,
schema: Optional[CollectionSchema] = None,
index_params: Optional[IndexParams] = None,
schema: Optional[CollectionSchema] = None, # Used for custom setup
index_params: Optional[IndexParams] = None, # Used for custom setup
**kwargs,
) -> None
```
Expand All @@ -32,7 +32,7 @@ create_collection(

The dimension of the collection field to hold vector embeddings.

The value is usually determined by the model you use to generate vector embeddings.
The value is usually determined by the model you use to generate vector embeddings and should be an integer greater than 1.

This parameter is designed for the quick setup of a collection and will be ignored if **schema** is not **None** and a field in the schema has its **dim** set to a positive integer.

Expand Down Expand Up @@ -84,7 +84,7 @@ create_collection(

The schema of this collection.

Setting this to **None** indicates this collection will be created with default settings.
Setting this to **None** indicates this collection will be created in a quick setup manner.

To set up a collection with a customized schema, you need to create a **CollectionSchema** object and reference it here. In this case, Milvus ignores all other schema-related settings carried in the request.

Expand Down Expand Up @@ -145,8 +145,6 @@ create_collection(

The value defaults to **64**, indicating that 64 partitions are to be created along with this collection. This parameter applies when **partition_key_field** is set to the name of a field.

This parameter is not applicable to Milvus Lite. For more information on Milvus Lite limits, refer to [Run Milvus Lite](https://milvus.io/docs/milvus_lite.md).

- **consistency_level** (*int* | *str*)

The consistency level of the target collection.
Expand Down Expand Up @@ -210,7 +208,7 @@ You can choose between a quick setup or a customized setup as follows:

- **Quick setup**

The quick setup collection has two fields: the primary and vector fields. It also allows the insertion of undefined fields and their values in key-value pairs in a dynamic field.
The quick setup collection has two mandatory fields: the primary and vector fields. It also allows the insertion of undefined fields and their values in key-value pairs in a dynamic field.

```python
client.create_collection(
Expand Down Expand Up @@ -244,7 +242,7 @@ You can choose between a quick setup or a customized setup as follows:
)
```

In the above code, the collection will be created and automatically loaded into memory.
In the above code, the collection will be created, indexed, and loaded into memory.

- **Customized setup with index parameters**

Expand Down Expand Up @@ -287,7 +285,7 @@ You can choose between a quick setup or a customized setup as follows:
)
```

In the above code, the collection will be created and automatically loaded into memory.
In the above code, the collection will be created, indexed, and loaded into memory.

- **Customized setup without index parameters**

Expand All @@ -311,7 +309,7 @@ You can choose between a quick setup or a customized setup as follows:
)
```

In the above code, the collection will also be created, but its data will not automatically loaded into memory.
In the above code, the collection will also be created. However, without `index_param`, data in the collection will not be indexed and loaded into memory.

## Related methods

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ schema.add_field(field_name="my_vector", datatype=DataType.FLOAT_VECTOR, dim=5)
# }

# 3. Create index parameters
index_params = client.create_index_params()
index_params = client.prepare_index_params()

# 4. Add indexes
# - For a scalar field
Expand Down
2 changes: 1 addition & 1 deletion API_Reference/pymilvus/v2.4.x/MilvusClient/Vector/query.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ query(

The value defaults to **None**. If specified, only the specified partitions are involved in queries.

This parameter is not applicable to Milvus Lite. For more information on Milvus Lite limits, refer to [Run Milvus Lite](https://milvus.io/docs/milvus_lite.md).
This parameter is not applicable to Milvus Lite. For more information on Milvus Lite limits, refer to [Run Milvus Lite](https://milvus.io/docs/milvus_lite.md).

- **kwargs** -

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ upsert(

If specified, the data is to be inserted or updated in the specified partition.

This parameter is not applicable to Milvus Lite. For more information on Milvus Lite limits, refer to [Run Milvus Lite](https://milvus.io/docs/milvus_lite.md).
This parameter is not applicable to Milvus Lite. For more information on Milvus Lite limits, refer to [Run Milvus Lite](https://milvus.io/docs/milvus_lite.md).

**RETURN TYPE:**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ set_properties(

**PARAMETERS:**

- properties (dict) -
- **properties** (dict) -

A set of collection properties in the form of a dictionary. Currently, you can set the following properties:

- **collection.ttl.seconds**

Once this property is set, data in the current collection expires in the specified time. Expired data in the collection will be cleaned up and will not be involved in searches or queries.

- **collection.mmap.enabled**
- **mmap.enabled**

Allows you to enable or disable memory mapping for a Milvus collection. For more information, refer to [Configure memory mapping](https://milvus.io/docs/mmap.md).
Whether to enable memory-mapped storage at the collection level. For more information, refer to [Configure memory mapping](https://milvus.io/docs/mmap.md#Configure-memory-mapping).

- **timeout** (*float*) -

Expand Down
Loading

0 comments on commit 6202671

Please sign in to comment.