Query
Conducts a query on scalar fields in a collection.
The base URL for this API is in the following format:
https://${CLUSTER_ENDPOINT}
- You need to fill in
${CLUSTER_ENDPOINT}
with that of your Zilliz Cloud cluster. - To get the endpoint, refer to On Zilliz Cloud Console or use the Describe Cluster API to extract the values from the responses.
export CLUSTER_ENDPOINT=""
The authentication token should be an API key with appropriate privileges or a pair of colon-joined username and password, like username:password
.
The name of the collection to which this operation applies.
The name of the partitions to which this operation applies.
PartitionName
The filter used to find matches for the query.
The maximum number of entities to return.
The sum of this value and that of offset
should be less than 16384.
The number of entities to skip in the search results.
The sum of this value and that of limit
should be less than 16384.
An array of fields to return along with the search results. When setting this to count(*)
, you need to set limit
to 0 to get the total count of the entities that match the filter.
An output field name.
export TOKEN="db_admin:xxxxxxxxxxxxx"
curl --request POST \
--url "${CLUSTER_ENDPOINT}/v1/vector/query" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Content-Type: application/json" \
-d '{
"collectionName": "medium_articles",
"outputFields": [
"id",
"title",
"link"
],
"filter": "id in [443300716234671427, 443300716234671426]",
"limit": 100,
"offset": 0
}'
Response code.
Response payload which is an array of objects that contain the specified output fields and their corresponding values.
Response payload which is an object that contains the specified output fields and their corresponding values.
Returns an error message.
Response code.
Error message.
{
"code": 200,
"data": [
{
"color": "red_7025",
"id": 1
},
{
"color": "red_4794",
"id": 4
},
{
"color": "red_9392",
"id": 6
}
]
}