Skip to content

Enable scrolling in search API endpoint #3334

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

Open
berggren opened this issue Mar 11, 2025 · 1 comment
Open

Enable scrolling in search API endpoint #3334

berggren opened this issue Mar 11, 2025 · 1 comment

Comments

@berggren
Copy link
Contributor

There is no way to fetch scrolled results from the API. You can set scrolling=True but you cannot pass in the scroll_id which make it impossible to build client side streaming.

https://github.com/google/timesketch/blob/cc9032059c0f58bd548400c711e2695f1e0906c1/timesketch/lib/datastores/opensearch.py#L634C9-L634C22

Adding something like:

        if enable_scroll:
            scroll_id = result["_scroll_id"]
            scroll_size = result["hits"]["total"]
        else:
            scroll_id = None
            scroll_size = 0

        return self.client.scroll(scroll_id=scroll_id, scroll="5m")

dark-eternal-05 added a commit to dark-eternal-05/timesketch that referenced this issue Mar 13, 2025
Attempt to solve following Bug

Enable scrolling in search API endpoint google#3334
@jkppr jkppr linked a pull request Mar 13, 2025 that will close this issue
@jkppr
Copy link
Collaborator

jkppr commented Apr 11, 2025

Doesn't the Search class in the API client make use of this already?

If search_obj.max_entries > 10k it should send the scrolling request and request one page after the other until all data is returned: https://github.com/google/timesketch/blob/master/api_client/python/timesketch_api_client/search.py#L563

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants