All Products
Search
Document Center

Vector Retrieval Service:Search for vectors

Last Updated:Apr 11, 2024

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

  1. Log on to the DashVector console.

  2. 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.image.png

  3. In the left-side bar, click Similar Vector Search. Then, configure parameters and click Search. image.pngThe 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].

    Note

    The 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.

  4. Parameter

    Parameter name in API

    Description

    Distance

    score

    The similarity of vectors.

    • 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.

    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: {"price":100,"type":"dress"}.

    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.