メインコンテンツまでスキップ

flush_all()

この操作はすべてのセグメントをシールします。

リクエスト構文

python
flush_all(
using: str = "default",
timeout: float | None,
**kwargs,
)

パラメータ:

  • using (str) -

    使用する接続のエイリアスです。

    デフォルト値は default で、この操作がデフォルト接続を使用することを示します。

  • timeout (float | None)

    この操作のタイムアウト時間です。これを None に設定すると、いずれかのレスポンスが到着するか、何らかのエラーが発生した時点でこの操作はタイムアウトします。

戻り値の型:

NoneType

戻り値:

None

例外:

該当なし

python
from pymilvus import (
connections,
Collection,
FieldSchema,
CollectionSchema,
DataType,
utility,
)

# Connect to YOUR_CLUSTER_ENDPOINT
connections.connect()

# Create a collection
collection = Collection(
name="test_collection_flush",
schema=CollectionSchema(fields=[
FieldSchema("film_id", DataType.INT64, is_primary=True),
FieldSchema("films", dtype=DataType.FLOAT_VECTOR, dim=128)
])
)

# Insert data
collection.insert([[1, 2], [[1.0, 2.0], [3.0, 4.0]]])

utility.flush_all(_async=False) # synchronized flush_all
# or use `future` to flush_all asynchronously

future = utility.flush_all(_async=True)
future.done() # flush_all finished

以下の操作は flush_all() メソッドに関連しています。

Ctrl I