Get
Gets entities by the specified IDs.
POST
https://${MILVUS_URI}/v1/vector/get
Example
Get a specified entity whose ID is an integer:
export MILVUS_URI="http://localhost:19530"
curl --request POST \
--url "${MILVUS_URI}/v1/vector/get" \
--header "accept: application/json" \
--header "content-type: application/json" \
-d '{
"collectionName": "medium_articles",
"outputFields": ["id", "title", "link"],
"id": 1
}'
Get a specified entity whose ID is a string:
export MILVUS_URI="http://localhost:19530"
curl --request POST \
--url "${MILVUS_URI}/v1/vector/get" \
--header "accept: application/json" \
--header "content-type: application/json" \
-d '{
"collectionName": "medium_articles",
"outputFields": ["id", "title", "link"],
"id": "id1"
}'
Get a list of entities whose IDs are integers:
export MILVUS_URI="http://localhost:19530"
curl --request POST \
--url "${MILVUS_URI}/v1/vector/get" \
--header "accept: application/json" \
--header "content-type: application/json" \
-d '{
"collectionName": "medium_articles",
"outputFields": ["id", "title", "link"],
"id": [1, 2]
}'
Get a list of entities whose IDs are strings:
export MILVUS_URI="http://localhost:19530"
curl --request POST \
--url "${MILVUS_URI}/v1/vector/get" \
--header "accept: application/json" \
--header "content-type: application/json" \
-d "{
"collectionName": "medium_articles",
"outputFields": ["id", "title", "link"],
"id": ["id1", "id2"]
}"
Request
Parameters
No query parameters required
No path parameters required
Request Body
{
"collectionName": "string",
"dbName": "string",
"id": "string",
"outputFields": []
}
Parameter | Description |
---|---|
dbName | string The name of the database. |
collectionName | string(required) The name of the collection to which this operation applies. |
outputFields | array An array of fields to return along with the search results. |
id | string(required) The ID of the entity to be retrieved |
{
"collectionName": "string",
"dbName": "string",
"id": [],
"outputFields": []
}
Parameter | Description |
---|---|
dbName | string The name of the database. |
collectionName | string(required) The name of the collection to which this operation applies. |
outputFields | array An array of fields to return along with the search results. |
id | array(required) An array of IDs of the entities to be retrieved |
{
"collectionName": "string",
"dbName": "string",
"id": "integer",
"outputFields": []
}
Parameter | Description |
---|---|
dbName | string The name of the database. |
collectionName | string(required) The name of the collection to which this operation applies. |
outputFields | array An array of fields to return along with the search results. |
id | integer(required) The ID of entity to be retrieved |
{
"collectionName": "string",
"dbName": "string",
"id": [],
"outputFields": []
}
Parameter | Description |
---|---|
dbName | string The name of the database. |
collectionName | string(required) The name of the collection to which this operation applies. |
outputFields | array An array of fields to return along with the search results. |
id | array(required) An array of IDs of the entities to be retrieved |
Response
Returns the search results.
Response Bodies
- Response body if we process your request successfully
{
"code": 200,
"data": {}
}
- Response body if we failed to process your request
{
"code": integer,
"message": string
}
Properties
The properties in the returned response are listed in the following table.
Property | Description |
---|---|
code | integer Indicates whether the request succeeds.
|
data | array A data array of objects. |
message | string Indicates the possible reason for the reported error. |
Possible Errors
Error Code | Description |
---|---|
800 | database not found |
1800 | user hasn’t authenticate |
1801 | can only accept json format request |
1802 | missing required parameters |
1805 | fail to parse search result |
1806 | please check the primary key and its’ type can only in [int |