跳到主要内容

prepare_index_params()

此操作用于准备索引参数,以便为特定 Collection 构建索引。

Notes

此方法仅适用于 Dedicated serving 集群和按需计算。

  • 要在 serving 集群的 Collection 中执行此操作,请使用集群 Endpoint 创建 MilvusClient。

    • Free & Serverless

      https://{cluster-id}.serverless.{region}.vectordb.zillizcloud.com

    • Dedicated

      https://{cluster-id}.{region}.vectordb.zillizcloud.com:19530

  • 要在按需计算的 Collection 中执行此操作,请使用项目 Endpoints 创建 MilvusClient,然后创建一个会话并将其附加到按需集群以执行搜索。

    https://{project-id}.{region}.api.zillizcloud.com

请求语法​

python
pymilvus.MilvusClient.prepare_index_params() -> IndexParams

参数:

N/A

返回类型:

IndexParams

返回值:

IndexParams 包含一个 IndexParam 对象列表。

  • IndexParams

    IndexParam 对象列表。

    python
    ├── IndexParams
    │ └── add_index()

    它提供 add_index() 方法,用于向列表中添加索引。

异常:

无

示例​

python
from pymilvus import MilvusClient

index_params = MilvusClient.prepare_index_params()
最低 SDK 版本v2.3.x