You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
summary: "An Array of Structs field in an entity stores an ordered set of Struct elements. Each Struct in the Array shares the same pre-defined schema, comprising multiple vectors and scalar fields."
5
-
beta: Milvus 2.6.4+
6
5
---
7
6
8
7
# Array of Structs
@@ -15,14 +14,14 @@ Here's an example of an entity from a collection that contains an Array of Struc
15
14
{
16
15
'id': 0,
17
16
'title': 'Walden',
18
-
'title_vector': [0.1, 0.2, 0.3, 0.4, 0.5]
17
+
'title_vector': [0.1, 0.2, 0.3, 0.4, 0.5],
19
18
'author': 'Henry David Thoreau',
20
19
'year_of_publication': 1845,
21
20
// highlight-start
22
21
'chunks': [
23
22
{
24
23
'text': 'When I wrote the following pages, or rather the bulk of them...',
25
-
'text_vector': [0.3, 0.2, 0.3, 0.2, 0.5]
24
+
'text_vector': [0.3, 0.2, 0.3, 0.2, 0.5],
26
25
'chapter': 'Economy',
27
26
},
28
27
{
@@ -88,7 +87,7 @@ In the example above, the `chunks` field is an Array of Structs field, and each
88
87
89
88
All vector fields in a collection must be indexed. To index a vector field within an Array of Structs field, Milvus uses an embedding list to organize the vector embeddings in each Struct element and indexes the entire embedding list as a whole.
90
89
91
-
You can use `HNSW` as the index type and any metric type listed below to build indexes for the embedding lists in an Array of Structs field.
90
+
You can use `AUTOINDEX` or `HNSW` as the index type and any metric type listed below to build indexes for the embedding lists in an Array of Structs field.
92
91
93
92
<table>
94
93
<tr>
@@ -97,23 +96,16 @@ In the example above, the `chunks` field is an Array of Structs field, and each
<td rowspan="3"><p>For embedding lists of the following types:</p><ul><li><p>FLOAT_VECTOR</p></li><li><p>FLOAT16_VECTOR</p></li><li><p>BFLOAT16_VECTOR</p></li><li><p>INT8_VECTOR</p></li></ul></td>
101
+
<td rowspan="3"><p>For embedding lists of the following types:</p><ul><li>FLOAT_VECTOR</li></ul></td>
103
102
</tr>
104
103
<tr>
105
104
<td><p><code>MAX_SIM_IP</code></p></td>
106
105
</tr>
107
106
<tr>
108
107
<td><p><code>MAX_SIM_L2</code></p></td>
109
108
</tr>
110
-
<tr>
111
-
<td><p><code>MAX_SIM_HAMMING</code></p></td>
112
-
<td rowspan="2"><p>For embedding lists of the BINARY_VECTOR type</p></td>
113
-
</tr>
114
-
<tr>
115
-
<td><p><code>MAX_SIM_JACCARD</code></p></td>
116
-
</tr>
117
109
</table>
118
110
119
111
The scalar fields in the Array of Structs field do not support indexes.
@@ -208,7 +256,7 @@ Indexing is mandatory for all vector fields, including both the vector fields in
208
256
209
257
The applicable index parameters vary depending on the index type in use. For details on applicable index parameters, refer to [Index Explained](index-explained.md) and the documentation pages specific to your selected index type.
210
258
211
-
To index an embedding list field, you need to set its index type to `HNSW`, and use `MAX_SIM_COSINE` as the metric type for Milvus to measure the similarities between embedding lists.
259
+
To index an embedding list, you need to set its index type to`AUTOINDEX` or`HNSW`, and use `MAX_SIM_COSINE` as the metric type for Milvus to measure the similarities between embedding lists.
@@ -441,13 +537,13 @@ data = [generate_record(i) for i in range(1000)]
441
537
442
538
You can perform vector searches on the vector fields of a collection and in an Array of Structs.
443
539
444
-
Specifically, you can directly use the names of the vector fields within Struct elements as the value for the `anns_field` parameter in a search request, and use `EmbeddingList` to organize query vectors neatly.
540
+
Specifically, you should concatenate the name of the Array of Structs field and those of the target vector fields within Struct elements as the value for the `anns_field` parameter in a search request, and use `EmbeddingList` to organize query vectors neatly.
445
541
446
542
<divclass="alert note">
447
543
448
-
Milvus provides `EmbeddingList` to help you organize query vectors for searches against an embedding list in an Array of Structs more neatly.
544
+
Milvus provides `EmbeddingList` to help you organize query vectors for searches against an embedding list in an Array of Structs more neatly. Each `EmbeddingList` contains at least a vector embedding and expects a number of topK entities in return.
449
545
450
-
However, `EmbeddingList` can used only in `search()` requests without range search or grouping search parameters, let alone `search_iterator()` requests.
546
+
However, `EmbeddingList` can be used only in `search()` requests without range search or grouping search parameters, let alone `search_iterator()` requests.
451
547
452
548
</div>
453
549
@@ -460,7 +556,7 @@ However, `EmbeddingList` can used only in `search()` requests without range sear
460
556
</div>
461
557
462
558
```python
463
-
from pymilvus import EmbeddingList
559
+
from pymilvus.client.embedding_listimport EmbeddingList
464
560
465
561
# each query embedding list triggers a single search
0 commit comments