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

The function all() returns 10 documents by default #20

Open
andryw opened this issue Mar 21, 2016 · 2 comments
Open

The function all() returns 10 documents by default #20

andryw opened this issue Mar 21, 2016 · 2 comments

Comments

@andryw
Copy link
Contributor

andryw commented Mar 21, 2016

The function all() returns 10 documents by default. Should it return all documents?

@rochacbruno
Copy link
Contributor

Elasticsearch has a default size of 10, There is no way to perform an unlimited search, one form is to get the count and use the from: 0 to: count but for large collections E.S can trow overflow error.

One solution is to use the scan method which gets all documents paginated, so .all() would be a paginated by default function.

I don't know which solution is the best.

@ederfmartins what do you think?

@ederfmartins
Copy link
Contributor

Set size = 'count' put a infection into code, since it breaks for large
collections. I think all() should use scan. But this solution add a new
constraint on es parameter (it must implement scan).

elasticsearch.helpers.scan is a simple function. Integrate it into esengine
code seems a good trade of. What you think @rochacbruno
https://github.com/rochacbruno?

On Mon, Mar 21, 2016 at 10:58 AM, Bruno Rocha [email protected]
wrote:

Elasticsearch has a default size of 10, There is no way to perform an
unlimited search, one form is to get the count and use the from: 0 to:
count but for large collections E.S can trow overflow error.

One solution is to use the scan method which gets all documents
paginated, so .all() would be a paginated by default function.

I don't know which solution is the best.

@ederfmartins https://github.com/ederfmartins what do you think?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#20 (comment)

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

No branches or pull requests

3 participants