Skip to content

Added Response.search_after() method #1829

New issue

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

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

Already on GitHub? # to your account

Merged
merged 2 commits into from
May 21, 2024

Conversation

miguelgrinberg
Copy link
Collaborator

@miguelgrinberg miguelgrinberg commented May 20, 2024

The intention is to rebuild the change proposed in #1623 as independent pieces supporting search_after, point-in-time, and ultimately a better version of scan() that uses them.

This PR implements search_after support in the Response class, also available through the Search class for convenience.

@miguelgrinberg miguelgrinberg requested a review from pquentin May 20, 2024 17:06
@pySilver
Copy link

Nice work! it would be nice to have search_after shortcut built-in into this lib.

Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM.

@pytest.mark.asyncio
async def test_search_after_no_search(async_data_client):
s = AsyncSearch(index="flat-git")
with raises(ValueError):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: using the match parameter of pytest.raises would help clarify what errors we're actually raising here and in the following tests

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll add that as well. Thanks!

@miguelgrinberg miguelgrinberg added the backport 8.x Backport to 8.x label May 21, 2024
@miguelgrinberg miguelgrinberg merged commit 891ba7c into elastic:main May 21, 2024
17 checks passed
@miguelgrinberg miguelgrinberg deleted the search-after branch May 21, 2024 14:47
github-actions bot pushed a commit that referenced this pull request May 21, 2024
* Added Response.search_after() method

* add match clause to pytest.raises

(cherry picked from commit 891ba7c)
miguelgrinberg added a commit that referenced this pull request May 21, 2024
* Added Response.search_after() method

* add match clause to pytest.raises

(cherry picked from commit 891ba7c)

Co-authored-by: Miguel Grinberg <miguel.grinberg@gmail.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
backport 8.x Backport to 8.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants