milvus-logo
LFAI
< Docs
  • RESTful
    • Vector Operations

Get

Gets entities by the specified IDs.

POST
https://${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/get

Example

Get a specified entity whose ID is an integer:

curl --request POST \
     --url "${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/get" \
     --header "Authorization: Bearer ${TOKEN}" \
     --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:

curl --request POST \
     --url "${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/get" \
     --header "Authorization: Bearer ${TOKEN}" \
     --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:

curl --request POST \
     --url "${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/get" \
     --header "Authorization: Bearer ${TOKEN}" \
     --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:

curl --request POST \
     --url "${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/get" \
     --header "Authorization: Bearer ${TOKEN}" \
     --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",
    "id": "string",
    "outputFields": []
}
ParameterDescription
collectionNamestring(required)
The name of the collection to which this operation applies.
outputFieldsarray
An array of fields to return along with the search results.
idstring(required)
The ID of the entity to be retrieved
{
    "collectionName": "string",
    "id": [],
    "outputFields": []
}
ParameterDescription
collectionNamestring(required)
The name of the collection to which this operation applies.
outputFieldsarray
An array of fields to return along with the search results.
idarray(required)
An array of IDs of the entities to be retrieved
{
    "collectionName": "string",
    "id": "integer",
    "outputFields": []
}
ParameterDescription
collectionNamestring(required)
The name of the collection to which this operation applies.
outputFieldsarray
An array of fields to return along with the search results.
idinteger(required)
The ID of entity to be retrieved
{
    "collectionName": "string",
    "id": [],
    "outputFields": []
}
ParameterDescription
collectionNamestring(required)
The name of the collection to which this operation applies.
outputFieldsarray
An array of fields to return along with the search results.
idarray(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.

PropertyDescription
codeinteger
Indicates whether the request succeeds.
  • 200: The request succeeds.
  • Others: Some error occurs.
dataarray
A data array of objects.
messagestring
Indicates the possible reason for the reported error.

Possible Errors

Error CodeDescription
800database not found
1800user hasn't authenticate
1801can only accept json format request
1802missing required parameters
1805fail to parse search result
1806please check the primary key and its' type can only in [int