跳到主要内容

get_query_segment_info()

Near Deprecation

此操作用于获取查询集群中 sealed 和 growing Segment 的信息。

请求语法​

python
get_query_segment_info(
collection_name: str,
timeout: float | None,
using: str = "default",
)

参数:

  • collection_name (str) -

    [必需]

    现有 Collection 的名称。

  • using (str) -

    所使用连接的别名。

    默认值为 default,表示此操作使用默认连接。

  • timeout (float | None)

    此操作的超时时长。将其设置为 None 表示当收到任意响应或发生任意错误时,此操作超时。

返回类型:

list

返回值:

由 QuerySegmentInfo 对象组成的列表,其中每个对象都报告一个 Segment 的状态。

异常:

N/A

示例​

python
from pymilvus import connections, Collection, utility

# Connect to YOUR_CLUSTER_ENDPOINT
connections.connect()

# Get an existing collection
collection = Collection("test_collection")

# Get the query segment info
res = utility.get_query_segment_info(collection_name="test_collection")

print(res)

# segmentID: 446781855409287839
# collectionID: 446738261027224920
# partitionID: 446738261027224921
# num_rows: 5
# state: Sealed
# nodeIds: 3
最低 SDK 版本Inherit