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

Set Limit in My Query #725

Closed
joaopalopes24 opened this issue Apr 6, 2023 · 6 comments
Closed

Set Limit in My Query #725

joaopalopes24 opened this issue Apr 6, 2023 · 6 comments
Labels

Comments

@joaopalopes24
Copy link

Scout Version

10.0.2

Scout Driver

Meilisearch

Laravel Version

10.5.0

PHP Version

8.2.4

Database Driver & Version

MariaDB 10.7.8

SDK Version

1.0.0

Meilisearch CLI Version

1.1.0

Description

I'm performing a search via Laravel Scout Builder, and I want to bring all my data, so I set a limit equal to 10,000, but my result is always limited to a thousand results, even changing the limit.

ContactMessage::search()->take(10000)->get();

image

And in my database, we have over a thousand records.

Steps To Reproduce

Create a table with over a thousand records, and try to bring everything in using the limit.

@joaopalopes24
Copy link
Author

Using the Scout count, and below the actual amount in the database.

ContactMessage::search()->take(10000)->count();

image

@mmachatschek
Copy link
Contributor

@joaopalopes24 this is the maxTotalHits setting on meilisearch side which prevents users from scrapping the whole data of a meilisearch DB.

this is the setting (which is by default max 1000 items returned) https://docs.meilisearch.com/reference/api/settings.html#pagination

@driesvints
Copy link
Member

Thanks @mmachatschek. Wondering if we should note this in the docs because this seems to keep popping up.

@mmachatschek
Copy link
Contributor

@driesvints it may be worth mentioning in the docs

@driesvints
Copy link
Member

@mmachatschek done: laravel/docs#8704

@joaopalopes24
Copy link
Author

Thank you @mmachatschek @driesvints

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

No branches or pull requests

3 participants