Fix/issue 638/updated point in time guide (#661)
* Updated point in time guide & CHANGELOG. Signed-off-by: Djcarrillo6 <[email protected]> * Updated point in time guide. Signed-off-by: Djcarrillo6 <[email protected]> CHAGELOG w/PR info. Signed-off-by: Djcarrillo6 <[email protected]> --------- Signed-off-by: Djcarrillo6 <[email protected]>
This commit is contained in:
+43
-2
@@ -1,6 +1,7 @@
|
||||
- [Point-in-Time](#point-in-time)
|
||||
- [Point-in-Time - Deprecated Implementation Examples](#point-in-time---deprecated-implementation-examples)
|
||||
- [Point-in-Time - Updated Implementation Examples](#point-in-time---updated-implementation-examples)
|
||||
|
||||
### Point-in-Time
|
||||
### Point-in-Time - Deprecated Implementation Examples
|
||||
|
||||
[Point in Time (PIT)](https://opensearch.org/docs/latest/search-plugins/point-in-time/) lets you run different queries against a dataset that is fixed in time.
|
||||
|
||||
@@ -41,3 +42,43 @@ Delete all point in time.
|
||||
response = client.delete_point_in_time(body=None, all=True)
|
||||
print(response)
|
||||
```
|
||||
|
||||
|
||||
### Point-in-Time - Updated Implementation Examples
|
||||
|
||||
Create a point in time on an index.
|
||||
|
||||
```python
|
||||
index_name = "test-index"
|
||||
response = client.create_pit(
|
||||
index=index_name,
|
||||
params={"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.
|
||||
|
||||
```python
|
||||
response = client.get_all_pits()
|
||||
print(response)
|
||||
```
|
||||
|
||||
Delete a point in time.
|
||||
|
||||
```python
|
||||
pit_body = {"pit_id": pit_id}
|
||||
response = client.delete_pit(body=pit_body)
|
||||
print(response)
|
||||
```
|
||||
|
||||
Delete all point in time.
|
||||
|
||||
```python
|
||||
response = client.delete_all_pits()
|
||||
print(response)
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user