Files
opensearch-pyd/guides/point_in_time.md
T
Daniel (dB.) Doubrovkine 58217d98ff Reorganize documentation and add samples. (#447)
Signed-off-by: dblock <dblock@amazon.com>
2023-07-24 10:23:51 -07:00

849 B

Point-in-Time

Point in Time (PIT) lets you run different queries against a dataset that is fixed in time.

Create a point in time on an index.

index_name = "test-index"
response = client.create_point_in_time(
    index=index_name,
    keep_alive="1m"
)

pit_id = response.get("pit_id")
print('\n Point in time ID:')
print(pit_id)

List all point in time which are alive in the cluster.

response = client.list_all_point_in_time()
print(response)

Delete a point in time.

pit_body = {
    "pit_id": [pit_id]
}
response = client.delete_point_in_time(body=pit_body)
print(response)

Delete all point in time.

response = client.delete_point_in_time(body=None, all=True)
print(response)