Skip to content

Commit 6ab1a7f

Browse files
authored
Fix PIT example in search.md (#869)
Signed-off-by: Mauricio Scheffer <[email protected]>
1 parent 7336f51 commit 6ab1a7f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

guides/search.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,9 @@ search_body = {
268268
}
269269

270270
# create a point in time
271-
pit = client.create_point_in_time(
271+
pit = client.create_pit(
272272
index = 'movies',
273-
keep_alive = '1m'
273+
params = {'keep_alive': '1m'}
274274
)
275275

276276
# include pit info in the search body
@@ -288,14 +288,12 @@ page_1 = client.search(
288288
size = 2,
289289
body = pit_search_body
290290
)['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']})
292292
page_2 = client.search(
293-
size = 2,
294293
body = pit_search_body
295294
)['hits']['hits']
296295
pit_search_body.update({'search_after':page_2[-1]['sort']})
297296
page_3 = client.search(
298-
size = 2,
299297
body = pit_search_body
300298
)['hits']['hits']
301299

@@ -305,7 +303,7 @@ print([hit['_source']['title'] for hit in page_2])
305303
print([hit['_source']['title'] for hit in page_3])
306304

307305
# 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'] })
309307
```
310308

311309
## Cleanup

0 commit comments

Comments
 (0)