This topic describes how to search for vectors by using the DashVector console, SDKs, or the HTTP API.
Use the DashVector console to search for vectors
Log on to the DashVector console.
In the left-side navigation pane, click Clusters. On the Clusters page, find the collection that you want to manage and click Details in the Operation column.
In the left-side bar, click Similar Vector Search. Then, configure parameters and click Search.
The following table describes the parameters.
Parameter
Parameter name in API
Description
Required
Query Vector
vector
The vector. Example: [1.00,2.00,3.00,4.00].
NoteThe number of dimensions and data type of the vector must be the same as those of the current collection.
Yes
Filter conditions
filter
The conditional filter, which must comply with the syntax of the SQL WHERE clause. For more information, see Conditional filtering.
No
Partition
partition
The partition name. You can select a partition based on your business requirements. Default value: default.
Yes
TopK
topk
The maximum number of vectors that can be returned. Valid values: 1 to 1024. Default value: 10.
Yes
The following table describes the parameters in the search results.
The value description of this parameter varies based on the distance measurement method. For more information, see What is a vector?
The returned results are sorted in descending order by similarity.
Parameter | Parameter name in API | Description |
Distance | score | The similarity of vectors. |
Primary Key ID | id | The primary key ID of the similar vector. |
Vector | vector | The vector. Example: [1.00,2.00,3.00,4.00]. |
Attribute | fields | The attribute information in the JSON format. Example: |
Partition | partition | The partition to which the similar vector belongs. |
Use SDKs to search vectors
For more information about how to search for vectors by using the SDK for Python, see Search for documents.
For more information about how to search for vectors by using the SDK for Java, see Search for documents.
Use the HTTP API to search vectors
For more information, see Search for documents.