File tree 1 file changed +4
-6
lines changed
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -268,9 +268,9 @@ search_body = {
268
268
}
269
269
270
270
# create a point in time
271
- pit = client.create_point_in_time (
271
+ pit = client.create_pit (
272
272
index = ' movies' ,
273
- keep_alive = ' 1m'
273
+ params = { ' keep_alive ' : ' 1m' }
274
274
)
275
275
276
276
# include pit info in the search body
@@ -288,14 +288,12 @@ page_1 = client.search(
288
288
size = 2 ,
289
289
body = pit_search_body
290
290
)[' hits' ][' hits' ]
291
- pit_search_body.update({' search_after' :page_1[- 1 ][' sort' ]})
291
+ pit_search_body.update({' size ' : 2 , ' search_after' :page_1[- 1 ][' sort' ]})
292
292
page_2 = client.search(
293
- size = 2 ,
294
293
body = pit_search_body
295
294
)[' hits' ][' hits' ]
296
295
pit_search_body.update({' search_after' :page_2[- 1 ][' sort' ]})
297
296
page_3 = client.search(
298
- size = 2 ,
299
297
body = pit_search_body
300
298
)[' hits' ][' hits' ]
301
299
@@ -305,7 +303,7 @@ print([hit['_source']['title'] for hit in page_2])
305
303
print ([hit[' _source' ][' title' ] for hit in page_3])
306
304
307
305
# delete the point in time
308
- client.delete_point_in_time (body = { ' pit_id' : pit[' pit_id' ] })
306
+ client.delete_pit (body = { ' pit_id' : pit[' pit_id' ] })
309
307
```
310
308
311
309
## Cleanup
You can’t perform that action at this time.
0 commit comments