Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PIT example in search.md #869

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions guides/search.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,9 @@ search_body = {
}

# create a point in time
pit = client.create_point_in_time(
pit = client.create_pit(
index = 'movies',
keep_alive = '1m'
params = {'keep_alive': '1m'}
)

# include pit info in the search body
Expand All @@ -288,14 +288,12 @@ page_1 = client.search(
size = 2,
body = pit_search_body
)['hits']['hits']
pit_search_body.update({'search_after':page_1[-1]['sort']})
pit_search_body.update({'size': 2, 'search_after':page_1[-1]['sort']})
page_2 = client.search(
size = 2,
body = pit_search_body
)['hits']['hits']
pit_search_body.update({'search_after':page_2[-1]['sort']})
page_3 = client.search(
size = 2,
body = pit_search_body
)['hits']['hits']

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

# delete the point in time
client.delete_point_in_time(body = { 'pit_id': pit['pit_id'] })
client.delete_pit(body = { 'pit_id': pit['pit_id'] })
```

## Cleanup
Expand Down
Loading