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

Implementing new methods for scrolling #17

Merged
merged 1 commit into from
Mar 4, 2019

Conversation

tcatrain
Copy link
Collaborator

@tcatrain tcatrain commented Nov 29, 2018

I encountered an issue using your great module. I needed to use and mock scroll methods in order to have a good coverage, so I implemented a few things :

# Method to generate an elasticsearch like scroll_id
def get_random_scroll_id():
    ...

# Method used to scroll over a elasticsearch query results
# without having to query again
def scroll(self, scroll_id, params=None):
    ...

When using the search method if params['scroll'] is provided, then you'll have a result['_scroll_id'] value in the response, that you'll be able to use further on to get next set of hits.
When using the scroll parameter, hits count will be limited either to 10 which is elasticsearch default size, either to params['size'] if provided. Next hits set will be of the same size until no more hits are available for the current query.

New code is unit tested, and existing tests are passing.
Please, give me any feedback if you are forseeing any issue with this ✌️

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 98.788% when pulling e68e930 on tcatrain:master into 7ad1551 on vrcmarcos:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 98.788% when pulling e68e930 on tcatrain:master into 7ad1551 on vrcmarcos:master.

@vrcmarcos vrcmarcos merged commit 3a31753 into vrcmarcos:master Mar 4, 2019
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 this pull request may close these issues.

3 participants