meilisearch-js-plugins icon indicating copy to clipboard operation
meilisearch-js-plugins copied to clipboard

Using instant search with hitsPerPage = 0 returns 1 result

Open 8byr0 opened this issue 11 months ago • 1 comments

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 :

https://github.com/meilisearch/meilisearch-js-plugins/blob/8df981ab5f614813aedd99c88c5bee7688011f07/packages/instant-meilisearch/src/adapter/search-response-adapter/pagination-adapter.ts#L18-L23

search params adapter

https://github.com/meilisearch/meilisearch-js-plugins/blob/8df981ab5f614813aedd99c88c5bee7688011f07/packages/instant-meilisearch/src/adapter/search-request-adapter/search-params-adapter.ts#L37-L40

8byr0 avatar Jan 17 '25 17:01 8byr0

Hello @8byr0, thanks for opening this issue.

Feel free to send a PR if you have the time, I will take time to review it. 🙏

Strift avatar Jan 21 '25 05:01 Strift