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

No way to specify no limit #475

Closed
Altreus opened this issue Oct 11, 2013 · 5 comments
Closed

No way to specify no limit #475

Altreus opened this issue Oct 11, 2013 · 5 comments

Comments

@Altreus
Copy link

Altreus commented Oct 11, 2013

https://groups.google.com/forum/#!topic/elastica-php-client/NlZeSTmYWEw

This thread from 2012 implies that not providing a limit should not default to a limit of 10, but the unit tests still test for that default.

Elastica documentation barely mentions the limit, except in passing on the search() method, and doesn't say it defaults to 10. Nor does it say how to not create one at all.

https://github.com/ruflin/Elastica/blob/master/lib/Elastica/Search.php#L474

This line implies I can provide [ 'limit' => $x ] to search() but it complains that limit is not a valid option if $x is null:

Elastica\Exception\InvalidException [ Error ]:
Invalid option limit

Using $query->setSize(null) also causes it to default to 10, as does 0.

Is there no way to remove the limit? I feel there should be.

@ruflin
Copy link
Owner

ruflin commented Oct 13, 2013

@Altreus Back in 2012 this was the actually the effect. Since then the implementation on the side of elasticsearch has changed. The option to return all results was removed (I assume for performance reason). So this is not possible anymore.

@Altreus
Copy link
Author

Altreus commented Oct 14, 2013

Hmm, if I don't provide a limit when I perform a query on my instance, I get all things. Perhaps I am using an old version of elasticsearch - centos is not known for its modernism.

@ruflin
Copy link
Owner

ruflin commented Oct 14, 2013

Which version are you using?

@SimonSimCity
Copy link

@ruflin if it's not longer possible to run a query without limit, please remove the comment here: https://github.com/ruflin/Elastica/blob/master/lib/Elastica/Query.php#L199

@ruflin
Copy link
Owner

ruflin commented Nov 14, 2013

@SimonSimCity Agree, this should be removed. Can you open an issue with that so we can directly close it with a pull request?

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

No branches or pull requests

3 participants