Skip to content

Commit

Permalink
PR #551
Browse files Browse the repository at this point in the history
  • Loading branch information
PahudPlus committed Jun 30, 2020
1 parent 7e05413 commit b80329d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
10 changes: 5 additions & 5 deletions site/en/guides/milvus_operation.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Currently, a collection only supports one index type, and switching the index ty
```python
>>> import random
# Generate 20 vectors of 256 dimension
>>> vectors = [[random.random() for _ in range(dim)] for _ in range(20)]
>>> vectors = [[random.random() for _ in range(256)] for _ in range(20)]
```

2. Insert the list of vectors. If you do not specify vector ids, Milvus automatically generates IDs for the vectors.
Expand Down Expand Up @@ -224,17 +224,17 @@ A segment is a data file that Milvus automatically creates by merging inserted v
2. Search vectors.
```python
# create 5 vectors of 32-dimension
>>> q_records = [[random.random() for _ in range(dim)] for _ in range(5)]
# create 5 vectors of 256-dimension
>>> q_records = [[random.random() for _ in range(256)] for _ in range(5)]
# search vectors
>>> milvus.search(collection_name='test01', query_records=q_records, top_k=2, params=search_param)
```
#### Search vectors in a partition
```python
# create 5 vectors of 32-dimension
>>> q_records = [[random.random() for _ in range(dim)] for _ in range(5)]
# create 5 vectors of 256-dimension
>>> q_records = [[random.random() for _ in range(256)] for _ in range(5)]
>>> milvus.search(collection_name='test01', query_records=q_records, top_k=1, partition_tags=['tag01'], params=search_param)
```
Expand Down
12 changes: 6 additions & 6 deletions site/en/menuStructure/en.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"menuList": [
{
"id": "about_milvus",
"id": "aboutmilvus",
"title": "About Milvus",
"lang": "en",
"label1": "",
Expand All @@ -14,7 +14,7 @@
"id": "overview.md",
"title": "Milvus Overview",
"lang": "en",
"label1": "about_milvus",
"label1": "aboutmilvus",
"label2": null,
"label3": null,
"order": 0
Expand All @@ -23,7 +23,7 @@
"id": "vector.md",
"title": "Feature Vector",
"lang": "en",
"label1": "about_milvus",
"label1": "aboutmilvus",
"label2": null,
"label3": null,
"order": 1
Expand All @@ -32,7 +32,7 @@
"id": "traditional_db.md",
"title": "Traditional Databases",
"lang": "en",
"label1": "about_milvus",
"label1": "aboutmilvus",
"label2": null,
"label3": null,
"order": 2
Expand All @@ -41,7 +41,7 @@
"id": "index_method.md",
"title": "Vector Search Methods",
"lang": "en",
"label1": "about_milvus",
"label1": "aboutmilvus",
"label2": null,
"label3": null,
"order": 3
Expand All @@ -50,7 +50,7 @@
"id": "vector_db.md",
"title": "Other Feature Vector Search Tools",
"lang": "en",
"label1": "about_milvus",
"label1": "aboutmilvus",
"label2": null,
"label3": null,
"order": 4
Expand Down
10 changes: 5 additions & 5 deletions site/zh-CN/guides/milvus_operation.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ sidebar_label: Learn Milvus Operations
```python
>>> import random
# Generate 20 vectors of 256 dimension
>>> vectors = [[random.random() for _ in range(dim)] for _ in range(20)]
>>> vectors = [[random.random() for _ in range(256)] for _ in range(20)]
```

2. 插入向量列表。如果你不指定向量 ID,Milvus 自动为向量分配 ID
Expand Down Expand Up @@ -227,16 +227,16 @@ Segment 是 Milvus 自动将插入的向量数据合并所获得的数据文件
2. 创建随机向量作为 `query_records` 进行搜索。
```python
# create 5 vectors of 32-dimension
>>> q_records = [[random.random() for _ in range(dim)] for _ in range(5)]
# create 5 vectors of 256-dimension
>>> q_records = [[random.random() for _ in range(256)] for _ in range(5)]
>>> milvus.search(collection_name='test01', query_records=q_records, top_k=2, params=search_param)
```
#### 在分区中搜索向量
```python
# create 5 vectors of 32-dimension
>>> q_records = [[random.random() for _ in range(dim)] for _ in range(5)]
# create 5 vectors of 256-dimension
>>> q_records = [[random.random() for _ in range(256)] for _ in range(5)]
>>> milvus.search(collection_name='test01', query_records=q_records, top_k=1, partition_tags=['tag01'], params=search_param)
```
Expand Down

0 comments on commit b80329d

Please sign in to comment.