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

Clarify accepted values for /search limit #2774

Closed
guimachiavelli opened this issue Mar 27, 2024 · 2 comments · Fixed by #3107
Closed

Clarify accepted values for /search limit #2774

guimachiavelli opened this issue Mar 27, 2024 · 2 comments · Fixed by #3107
Labels
fix/improvement good first issue Issues that are easy or quick to fix

Comments

@guimachiavelli
Copy link
Member

Documentations currently states the limit search parameter accepts "any positive integer".

We should update the /search reference so it's clear limit also accepts 0 as a value. This will cause Meilisearch to return no search results.

References

@guimachiavelli guimachiavelli added fix/improvement good first issue Issues that are easy or quick to fix labels Mar 27, 2024
postmeback added a commit to postmeback/meilisearch-documentation that referenced this issue Aug 5, 2024
@RecreationalMath
Copy link
Contributor

RecreationalMath commented Dec 12, 2024

Hi @guimachiavelli

Since the slack discussion is private, I wanted to know if there is anything else I need to know before fixing this doc issue that is not already mentioned in issue description?

Also if your time permits, I'm curious to know what purpose would setting the limit to zero serve? It will be easier to understand if you can share an example scenario where setting the limit to zero would be desirable/required.

Thanks!

@guimachiavelli
Copy link
Member Author

Hello, @RecreationalMath, and apologies for the delay in replying.

The slack discussion is mostly about language differences. According to our French colleagues, 0 is a positive integer; in English, instead, 0 is simply an integer, neither positive nor negative. We wanted to amend the documentation so it's clear to everyone that limit accepts both positive integers and 0.

As to why someone would make a search request with limit: 0, you may want to do that when all you want is a quick estimate of total hits in a query. This may be useful when programming paginated search interfaces. It's not something we expect to be used super often, though.

Thanks for your interest!

RecreationalMath added a commit to RecreationalMath/documentation that referenced this issue Jan 16, 2025
Fixes meilisearch#2774
Updated `expected values` for limit in `reference/api/search.mdx` file to include zero
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix/improvement good first issue Issues that are easy or quick to fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants