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

Using instant search with hitsPerPage = 0 returns 1 result #1365

Open
8byr0 opened this issue Jan 17, 2025 · 0 comments
Open

Using instant search with hitsPerPage = 0 returns 1 result #1365

8byr0 opened this issue Jan 17, 2025 · 0 comments

Comments

@8byr0
Copy link

8byr0 commented Jan 17, 2025

Description
Using <Configure hitsPerPage={0} /> is tranformed to { "limit": 1 } in the request sent to meilisearch therefore returning 1 hit when 0 have been requested.

Expected behavior
Choosing 0 hits per page should set the limit to 0 in generated ms request

Seems to come from

pagination adapter :

const { limit = 20, offset = 0, hits } = searchResponse
const additionalPage = hits.length >= limit ? 1 : 0
return offset / hitsPerPage + 1 + additionalPage
}

search params adapter

return {
limit: hitsPerPage + 1,
offset: page * hitsPerPage,
}

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

1 participant