vector
batch_get
Read multiple vectors by key.
db.vectors.get_many(collection: 'str', keys: 'Sequence[str]') -> 'BatchResult'wire vector_batch_get
Reads several vector keys and returns positional item results. Each item records found or missing state.
Itemwise batches return one positional item result per input item. The outer batch status summarizes whether all, some, or none of the items succeeded.
To see the complete help for this command, run:
help(db.vectors.get_many)
Example
Read many vectors at once.
_ = db.vectors.create_collection("docs", 3, metric="cosine")_ = db.vectors.upsert_many("docs", [{"key": "a", "vector": [1.0, 0.0, 0.0]}, {"key": "b", "vector": [0.0, 1.0, 0.0]}])[i.result.value.key for i in db.vectors.get_many("docs", ["a", "b"]).items]
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| collection | string | yes | Collection name. |
| keys | array | yes | Keys to read. |
| branch | string or null | no | Target branch. Defaults to the executor handle branch. |
| space | string or null | no | Target product space. Defaults to `"default"`. |
Returns
BatchResult<Maybe<VectorVersionedData>>
- dataBatchResult8
- typestring
Errors
Recover by code. Retry policy and commit outcome come from the shipped error registry.
| Code | Retry | Commit outcome |
|---|---|---|
| failed_precondition.engine.runtime_closed | never | not_started |
| not_found.engine.branch | never | not_applicable |
| invalid_argument.engine.product_space | never | not_started |
| invalid_argument.engine.vector_collection | never | not_started |
| invalid_argument.engine.vector_key | never | not_started |
| not_found.engine.vector_collection | never | not_applicable |
| invalid_argument.engine.vector_batch | never | not_started |